Commit 49887f11 by PLN (Algolia)

404: center text and code overlay join the difference blend (work shows through…

404: center text and code overlay join the difference blend (work shows through the h=code panel, text reads as a negative layer), main overlay stops eating clicks (pointer-events-none — click-to-home had never actually worked), a pinned sketch that won't boot yields to two bag picks instead of an empty void
parent a08e0841
......@@ -2,7 +2,7 @@ import fs from 'fs';
import path from 'path';
import matter from 'gray-matter';
import NotFoundHydra from '@/components/not-found-hydra';
import { resolveHydraSketch } from '@/lib/hydra-sketch';
import { resolveHydraSketch, withLocalAssets } from '@/lib/hydra-sketch';
export const metadata = {
title: '404 | Vous êtes dans l’espace entre les pages',
......@@ -17,11 +17,6 @@ export const metadata = {
* Asset refs are rewritten to the static copies in /images/hydra (see
* scripts/hydra-assets.mjs): the git-raw originals are cross-origin and
* case-fragile, and backgrounds vanished for some visitors. */
function withLocalAssets(source, rewrites) {
let out = source;
for (const [ref, local] of Object.entries(rewrites)) out = out.split(ref).join(local);
return out;
}
/** Native stage of a sketch, from a `// stage:` comment in the source or a
* `stage:` frontmatter line — default 1280×720, the laptop format most
......@@ -62,14 +57,16 @@ export default async function NotFound() {
return (
<div className="block relative min-h-[100dvh] cursor-pointer">
<NotFoundHydra sketches={sketches} />
{/* No z-index here: a stacking context on <main> would seal the
children's mix-blend-mode away from the canvas behind — plain
positioned paint order (after the fixed wrapper) keeps it on top. */}
<main
className="relative min-h-[100dvh] flex flex-col items-center justify-center px-6 text-center"
style={{ zIndex: 1 }}
className="pointer-events-none relative min-h-[100dvh] flex flex-col items-center justify-center px-6 text-center"
>
<h1 className="text-7xl font-bold tracking-tight text-[var(--text-primary)] [text-shadow:0_0_24px_var(--surface)]">
<h1 className="text-7xl font-bold tracking-tight text-white [mix-blend-mode:difference]">
404
</h1>
<p className="mt-6 text-lg text-[var(--text-primary)] text-balance [text-shadow:0_1px_12px_var(--surface)]">
<p className="mt-6 text-lg text-white text-balance [mix-blend-mode:difference]">
Vous êtes dans l’Espace entre les Pages.
</p>
</main>
......
......@@ -127,11 +127,12 @@ export default function NotFoundHydra({ sketches }) {
HydraModule = Hydra;
// ?art=<id> pins the piece (reload keeps it); otherwise one visit
// in five dreams (generative) and the rest rotate via the
// shuffle-bag — a failing boot falls to the next candidate
// shuffle-bag. A pinned sketch that won't boot yields to two bag
// picks — a pin must never leave the void empty (yet/30wild did).
const wanted = new URLSearchParams(window.location.search).get('art');
let candidates;
if (wanted === generativePiece().id) candidates = [generativePiece()];
else if (wanted && sketches.some((s) => s.id === wanted)) candidates = sketches.filter((s) => s.id === wanted);
else if (wanted && sketches.some((s) => s.id === wanted)) candidates = [...sketches.filter((s) => s.id === wanted), ...bag(sketches, 2)];
else candidates = Math.random() < GENERATIVE_RATE ? [generativePiece()] : bag(sketches, 3);
for (const piece of candidates) {
if (boot(piece)) {
......@@ -237,9 +238,13 @@ export default function NotFoundHydra({ sketches }) {
inset: 0,
zIndex: 3,
overflow: 'auto',
background: 'rgba(8, 8, 12, 0.88)',
// light scrim + difference blend: the dark scrim is a near
// no-op in difference, so the work shows through and the code
// reads as a negative layer over it — same trick as the bar
background: 'rgba(8, 8, 12, 0.35)',
backdropFilter: 'blur(2px)',
color: 'var(--text-primary, #e8e8f0)',
mixBlendMode: 'difference',
color: '#e8e8f0',
cursor: 'pointer',
padding: 'clamp(1rem, 4vw, 3rem)',
}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment