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'; ...@@ -2,7 +2,7 @@ import fs from 'fs';
import path from 'path'; import path from 'path';
import matter from 'gray-matter'; import matter from 'gray-matter';
import NotFoundHydra from '@/components/not-found-hydra'; import NotFoundHydra from '@/components/not-found-hydra';
import { resolveHydraSketch } from '@/lib/hydra-sketch'; import { resolveHydraSketch, withLocalAssets } from '@/lib/hydra-sketch';
export const metadata = { export const metadata = {
title: '404 | Vous êtes dans l’espace entre les pages', title: '404 | Vous êtes dans l’espace entre les pages',
...@@ -17,11 +17,6 @@ export const metadata = { ...@@ -17,11 +17,6 @@ export const metadata = {
* Asset refs are rewritten to the static copies in /images/hydra (see * Asset refs are rewritten to the static copies in /images/hydra (see
* scripts/hydra-assets.mjs): the git-raw originals are cross-origin and * scripts/hydra-assets.mjs): the git-raw originals are cross-origin and
* case-fragile, and backgrounds vanished for some visitors. */ * 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 /** Native stage of a sketch, from a `// stage:` comment in the source or a
* `stage:` frontmatter line — default 1280×720, the laptop format most * `stage:` frontmatter line — default 1280×720, the laptop format most
...@@ -62,14 +57,16 @@ export default async function NotFound() { ...@@ -62,14 +57,16 @@ export default async function NotFound() {
return ( return (
<div className="block relative min-h-[100dvh] cursor-pointer"> <div className="block relative min-h-[100dvh] cursor-pointer">
<NotFoundHydra sketches={sketches} /> <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 <main
className="relative min-h-[100dvh] flex flex-col items-center justify-center px-6 text-center" className="pointer-events-none relative min-h-[100dvh] flex flex-col items-center justify-center px-6 text-center"
style={{ zIndex: 1 }}
> >
<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 404
</h1> </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. Vous êtes dans l’Espace entre les Pages.
</p> </p>
</main> </main>
......
...@@ -127,11 +127,12 @@ export default function NotFoundHydra({ sketches }) { ...@@ -127,11 +127,12 @@ export default function NotFoundHydra({ sketches }) {
HydraModule = Hydra; HydraModule = Hydra;
// ?art=<id> pins the piece (reload keeps it); otherwise one visit // ?art=<id> pins the piece (reload keeps it); otherwise one visit
// in five dreams (generative) and the rest rotate via the // 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'); const wanted = new URLSearchParams(window.location.search).get('art');
let candidates; let candidates;
if (wanted === generativePiece().id) candidates = [generativePiece()]; 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); else candidates = Math.random() < GENERATIVE_RATE ? [generativePiece()] : bag(sketches, 3);
for (const piece of candidates) { for (const piece of candidates) {
if (boot(piece)) { if (boot(piece)) {
...@@ -237,9 +238,13 @@ export default function NotFoundHydra({ sketches }) { ...@@ -237,9 +238,13 @@ export default function NotFoundHydra({ sketches }) {
inset: 0, inset: 0,
zIndex: 3, zIndex: 3,
overflow: 'auto', 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)', backdropFilter: 'blur(2px)',
color: 'var(--text-primary, #e8e8f0)', mixBlendMode: 'difference',
color: '#e8e8f0',
cursor: 'pointer', cursor: 'pointer',
padding: 'clamp(1rem, 4vw, 3rem)', 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