diff --git a/web/src/components/Lightbox.astro b/web/src/components/Lightbox.astro new file mode 100644 index 00000000..7528b1c4 --- /dev/null +++ b/web/src/components/Lightbox.astro @@ -0,0 +1,214 @@ +--- +/* One dialog for every screenshot on the page, rather than one per image. + * + * WHY A SHARED DIALOG. The features page carries six 2880x1800 screenshots. Six + * dialogs would mean six copies of the markup and six more elements the + * browser has to consider, for a UI that can only ever show one at a time. The + * buttons carry the source and the caption; this fills itself in on open. + * + * WHY AND NOT A DIV. The three things a hand-rolled overlay reliably + * gets wrong are all free here: Escape closes it, focus is trapped inside while + * it is open, and focus returns to the button that opened it when it closes. + * ::backdrop is a real element, so the dimming needs no extra node. + * + * PROGRESSIVE. Without JavaScript the inside each button still renders at + * its normal size and the page reads exactly as it did before. The button is + * only an affordance; nothing depends on it. + */ +--- + + + + {/* alt is set from the trigger, so the expanded view says the same thing the + inline one did rather than going unlabelled. */} + + + + + + + diff --git a/web/src/layouts/Base.astro b/web/src/layouts/Base.astro index b9d2a02e..375f4c65 100644 --- a/web/src/layouts/Base.astro +++ b/web/src/layouts/Base.astro @@ -72,6 +72,15 @@ const ogImage = new URL("/og.png", Astro.site ?? "https://polyemesis.com"); system is 94 KB — one file per family covering every weight used. */} + {/* THE THIRD FACE WAS THE ONE LEFT OUT, and it is above the fold on every + page: the hero eyebrow, the `docker run` line a visitor copies, the + footer column labels. Measured on the live site over Slow 4G it began + loading 592ms after its two preloaded siblings, because the browser only + learned it was needed once the stylesheet had been parsed. + + No extra bytes — the file is fetched either way. This only moves the + discovery earlier. */} +