From b70d10fc9d84e4f76835dbd396e82e68ede2a3f6 Mon Sep 17 00:00:00 2001 From: Kevin Longe <273747162+kvlonge@users.noreply.github.com> Date: Sat, 5 Dec 2026 17:42:02 +0000 Subject: [PATCH] Darken the tool stack's dots in light mode, and drop the card's glow --- index.html | 4 ++-- styles.css | 2 +- tools.js | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 9ba7044..2c98fb4 100644 --- a/index.html +++ b/index.html @@ -28,9 +28,9 @@ - + - +
Skip to tools diff --git a/styles.css b/styles.css index 60cc377..5d9c998 100644 --- a/styles.css +++ b/styles.css @@ -290,7 +290,7 @@ h1 { margin: 0; max-width: 11ch; font-size: clamp(44px, 5.4vw, 80px); line-heigh @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); } +.is-exploded .tool.is-active { opacity: 1; visibility: visible; transition: opacity .3s ease; } @media (max-width: 900px) { .tool-x { grid-template-columns: minmax(0, 1fr); gap: 32px; } diff --git a/tools.js b/tools.js index 972ca7b..b5675f5 100644 --- a/tools.js +++ b/tools.js @@ -77,6 +77,8 @@ let dpr = 1; let ink = [23, 26, 31]; let bg = [255, 255, 255]; + // On a light page the dots are drawn larger and more opaque, or the discs fade into the white. + let weight = { size: 1, alpha: 0.3 }; let angle = 0.6; let last = 0; let frame = 0; @@ -114,6 +116,7 @@ const style = getComputedStyle(document.documentElement); ink = rgb(style.getPropertyValue('--ink')); bg = rgb(style.getPropertyValue('--background')); + weight = bg[0] + bg[1] + bg[2] > 3 * 128 ? { size: 1.3, alpha: 0.75 } : { size: 1, alpha: 0.3 }; for (const disc of discs) disc.accent = rgb(getComputedStyle(chips.querySelector(`[data-tool="${disc.key}"]`)).getPropertyValue('--accent')); } function sizeDiscs() { @@ -204,7 +207,7 @@ buckets.forEach((pts, b) => { if (!pts.length) return; const l = (b + 0.5) / 5; - dots(pts, dot * (0.45 + 1.1 * l) * (1 + 0.25 * d.glow), colour, Math.min(1, (0.3 + 0.7 * l) * fade)); + dots(pts, dot * weight.size * (0.45 + 1.1 * l) * (1 + 0.25 * d.glow), colour, Math.min(1, (weight.alpha + (1 - weight.alpha) * l) * fade)); }); } }