From 4046d6ad1397491fd79e35d61e7ab0cf8e7db61c Mon Sep 17 00:00:00 2001 From: Kevin Longe <273747162+kvlonge@users.noreply.github.com> Date: Wed, 2 Dec 2026 18:15:27 +0000 Subject: [PATCH] Keep the tool cards hidden until the stack is built, so they don't jump on load --- index.html | 4 ++-- styles.css | 4 ++++ theme.js | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index d1b1c48..6237cc3 100644 --- a/index.html +++ b/index.html @@ -27,8 +27,8 @@ - - + + diff --git a/styles.css b/styles.css index 0db8007..be139e8 100644 --- a/styles.css +++ b/styles.css @@ -275,6 +275,10 @@ h1 { margin: 0; max-width: 11ch; font-size: clamp(44px, 5.4vw, 80px); line-heigh .tool-x-chip img.wide { width: 24px; } /* Every card sits in the same cell, so the section is as tall as the longest card and nothing below jumps; each card keeps its own height and starts at the top, so a short one has no empty terminal. */ +/* With scripts on, the plain grid would show for a frame and then squash into the right-hand column. + It stays hidden until tools.js has built the stack, and shows after 3 s if that never happens. */ +.js .tools:not(.is-exploded) .tool-grid { visibility: hidden; animation: tools-fallback 0s 3s forwards; } +@keyframes tools-fallback { to { visibility: visible; } } .is-exploded .tool-grid { grid-template-columns: minmax(0, 1fr); border: 0; } .is-exploded .tool { grid-row: 1; grid-column: 1; align-self: start; grid-template-rows: auto auto auto 1fr; border: 1px solid var(--line); opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s .3s; } .is-exploded .tool.is-active { opacity: 1; visibility: visible; transition: opacity .3s ease; box-shadow: 0 30px 80px color-mix(in srgb, var(--accent) 16%, transparent); } diff --git a/theme.js b/theme.js index 1aba173..8c98e38 100644 --- a/theme.js +++ b/theme.js @@ -1,5 +1,7 @@ (() => { const root = document.documentElement; + // tools.js rebuilds the tool section; until it has, styles.css keeps the cards out of sight. + root.classList.add('js'); const system = window.matchMedia('(prefers-color-scheme: dark)'); let preference = null;