mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-16 14:52:31 +00:00
ruler: solid-ink dimming, one frosted world, bbox-sized pools
Heading dimming stops being translucency: dimmed words (queue, pile, riding) now render a solid ink-toward-paper color-mix at the same visual level, so they mask the footage passing beneath instead of letting it bleed through 35%-alpha gray. The rail frost's inner edge goes back to a feather, but on a smoothstep-like multi-stop curve so no seam reads while letters fly in and out (the hard cutoff + hairline read as visually split). The contrast pools become part of the same frosted world: backdrop blur at the rail's level with a matching non-linear corner mask, and their size derives from the stacks' worst-case bounding boxes (full pile + current heading up top, full queue below, longest label wide) plus a Pool pad knob — no more viewport-height guessing. The reduced-motion queue pool gets the same frost. Tuned @ Mpx defaults to the reference screen's real 1.65 CSS-megapixels. Claude-Session: https://claude.ai/code/session_01YBoaBEt3gynzTwogBFtn4B
This commit is contained in:
1 parent
c3834bc9d9
commit
81ee9a3533
4 files changed
+71
-32
No files matched your search
@@ -55,7 +55,7 @@ export const galaxyLayoutTuner = defineTunables(
|
||||
min: 0.5,
|
||||
max: 12,
|
||||
step: 0.1,
|
||||
default: 5,
|
||||
default: 1.65,
|
||||
info: "Viewport area (CSS megapixels) the card count was tuned at. Smaller viewports get proportionally fewer cards — never more than the count knob.",
|
||||
},
|
||||
cardHFrac: {
|
||||
|
||||
@@ -398,7 +398,14 @@ export default function HeadingFlow({
|
||||
} else {
|
||||
el.style.transform = `translate3d(${x}px, ${y}px, 0) translate(-50%, -50%) rotate(${rot}deg) scale(${scale})`;
|
||||
}
|
||||
el.style.opacity = String(alpha);
|
||||
// Dimming is a solid ink-toward-paper mix, not translucency:
|
||||
// dimmed headings must still mask the footage passing beneath
|
||||
// them, and translucent gray over video reads as no contrast.
|
||||
el.style.opacity = "1";
|
||||
el.style.color =
|
||||
alpha >= 0.995
|
||||
? "var(--ink-strong)"
|
||||
: `color-mix(in srgb, var(--ink-strong) ${(clamp01(alpha) * 100).toFixed(1)}%, var(--bg))`;
|
||||
if (alpha > maxAlpha) maxAlpha = alpha;
|
||||
// Per-axis extents (swapped when the glyph is rotated toward
|
||||
// vertical) so hit boxes stay tight: a shared radius made
|
||||
@@ -514,13 +521,19 @@ export default function HeadingFlow({
|
||||
className="fixed z-40"
|
||||
style={{ bottom: layout.queuePad, ...sideStyle }}
|
||||
>
|
||||
{/* Same contrast pool as the full instrument's queue. */}
|
||||
{/* Same frosted contrast pool as the full instrument's queue. */}
|
||||
<div
|
||||
aria-hidden
|
||||
className="absolute -inset-x-16 -inset-y-10"
|
||||
style={{
|
||||
opacity: pools.poolAlpha,
|
||||
background: `radial-gradient(closest-side, color-mix(in srgb, var(--bg) 85%, transparent), transparent)`,
|
||||
backdropFilter: "blur(9px)",
|
||||
WebkitBackdropFilter: "blur(9px)",
|
||||
backgroundColor: "color-mix(in srgb, var(--bg) 82%, transparent)",
|
||||
maskImage:
|
||||
"radial-gradient(closest-side, black 55%, transparent 100%)",
|
||||
WebkitMaskImage:
|
||||
"radial-gradient(closest-side, black 55%, transparent 100%)",
|
||||
}}
|
||||
/>
|
||||
<ul className="relative flex flex-col gap-1.5">
|
||||
@@ -562,29 +575,63 @@ export default function HeadingFlow({
|
||||
}
|
||||
};
|
||||
|
||||
// Contrast-pool geometry derived from the stacks' worst-case bounding
|
||||
// boxes: the top pool covers a full pile plus the current heading, the
|
||||
// bottom pool a full queue, and both fit the longest label at full size —
|
||||
// no viewport-relative guessing.
|
||||
const n = sections.length;
|
||||
let poolW = 260;
|
||||
for (const s of sections) {
|
||||
const m = metrics[s.label];
|
||||
if (m) poolW = Math.max(poolW, m.total * layout.headingPx);
|
||||
}
|
||||
poolW += layout.railW + layout.textPad + pools.poolPad;
|
||||
const topPoolH =
|
||||
NAV_H +
|
||||
layout.topPad +
|
||||
Math.max(0, n - 1) * layout.queueSlot +
|
||||
layout.currentGap +
|
||||
layout.headingPx +
|
||||
pools.poolPad;
|
||||
const bottomPoolH = layout.queuePad + n * layout.queueSlot + pools.poolPad;
|
||||
const poolMask = (cornerY: string) =>
|
||||
`radial-gradient(115% 115% at ${side === "right" ? "100%" : "0%"} ${cornerY}, black 45%, rgba(0,0,0,0.8) 62%, rgba(0,0,0,0.45) 78%, rgba(0,0,0,0.15) 91%, transparent 100%)`;
|
||||
|
||||
return (
|
||||
<div className="pointer-events-none fixed inset-0 z-40">
|
||||
{/* Contrast pools: page-bg radial fades pinned to the rail's top and
|
||||
{/* Contrast pools: frosted page-bg fades pinned to the rail's top and
|
||||
bottom corners, so the top stack and the bottom queue always read
|
||||
over whatever content scrolls beneath them. */}
|
||||
over whatever content scrolls beneath them. Blur level matches the
|
||||
rail frost, so a letter flying between rail and stack stays in one
|
||||
continuous frosted world. */}
|
||||
<div
|
||||
aria-hidden
|
||||
className="absolute top-0 w-[clamp(220px,24vw,400px)]"
|
||||
className="absolute top-0"
|
||||
style={{
|
||||
...(side === "right" ? { right: 0 } : { left: 0 }),
|
||||
height: `${pools.poolVh}vh`,
|
||||
width: poolW,
|
||||
height: topPoolH,
|
||||
opacity: pools.poolAlpha,
|
||||
background: `radial-gradient(110% 100% at ${side === "right" ? "100%" : "0%"} 0%, color-mix(in srgb, var(--bg) 88%, transparent), color-mix(in srgb, var(--bg) 48%, transparent) 52%, transparent 78%)`,
|
||||
backdropFilter: "blur(9px)",
|
||||
WebkitBackdropFilter: "blur(9px)",
|
||||
backgroundColor: "color-mix(in srgb, var(--bg) 80%, transparent)",
|
||||
maskImage: poolMask("0%"),
|
||||
WebkitMaskImage: poolMask("0%"),
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
aria-hidden
|
||||
className="absolute bottom-0 w-[clamp(220px,24vw,400px)]"
|
||||
className="absolute bottom-0"
|
||||
style={{
|
||||
...(side === "right" ? { right: 0 } : { left: 0 }),
|
||||
height: `${pools.poolVh * 0.9}vh`,
|
||||
width: poolW,
|
||||
height: bottomPoolH,
|
||||
opacity: pools.poolAlpha,
|
||||
background: `radial-gradient(110% 100% at ${side === "right" ? "100%" : "0%"} 100%, color-mix(in srgb, var(--bg) 88%, transparent), color-mix(in srgb, var(--bg) 48%, transparent) 52%, transparent 78%)`,
|
||||
backdropFilter: "blur(9px)",
|
||||
WebkitBackdropFilter: "blur(9px)",
|
||||
backgroundColor: "color-mix(in srgb, var(--bg) 80%, transparent)",
|
||||
maskImage: poolMask("100%"),
|
||||
WebkitMaskImage: poolMask("100%"),
|
||||
}}
|
||||
/>
|
||||
{sections.map((s, wi) => {
|
||||
|
||||
@@ -363,12 +363,12 @@ export const rulerLookTuner = defineTunables("rulerLook", "Ruler look", {
|
||||
default: 1,
|
||||
info: "Strength of the page-bg contrast pools behind the top stack and the bottom queue (0 = none).",
|
||||
},
|
||||
poolVh: {
|
||||
label: "Pool size vh",
|
||||
min: 10,
|
||||
max: 60,
|
||||
step: 2,
|
||||
default: 36,
|
||||
info: "Height of the top contrast pool in viewport-height percent; the bottom pool runs slightly smaller.",
|
||||
poolPad: {
|
||||
label: "Pool pad px",
|
||||
min: 0,
|
||||
max: 160,
|
||||
step: 8,
|
||||
default: 64,
|
||||
info: "Feather margin the contrast pools extend beyond the top stack's and bottom queue's actual bounding boxes.",
|
||||
},
|
||||
});
|
||||
@@ -550,9 +550,9 @@ export default function ScrollRuler() {
|
||||
>
|
||||
{/* Frost underlay: content flows under the rail (no reserved
|
||||
gutter); this pane blurs and tints whatever passes beneath so
|
||||
the instrumentation always reads. Hard cutoff at the inner
|
||||
edge, finished with a hairline — the same edge treatment as
|
||||
the galaxy cards' frames. */}
|
||||
the instrumentation always reads. The inner edge feathers on a
|
||||
smoothstep-like curve — soft enough that letters flying in and
|
||||
out never read a seam. */}
|
||||
<div
|
||||
aria-hidden
|
||||
className="absolute inset-0"
|
||||
@@ -560,16 +560,8 @@ export default function ScrollRuler() {
|
||||
backdropFilter: "blur(9px)",
|
||||
WebkitBackdropFilter: "blur(9px)",
|
||||
backgroundColor: "color-mix(in srgb, var(--bg) 55%, transparent)",
|
||||
}}
|
||||
/>
|
||||
<span
|
||||
aria-hidden
|
||||
className="absolute inset-y-0 block"
|
||||
style={{
|
||||
...(side === "right" ? { left: 0 } : { right: 0 }),
|
||||
width: 1,
|
||||
backgroundColor: "var(--line-strong)",
|
||||
opacity: 0.35,
|
||||
maskImage: `linear-gradient(${side === "right" ? "to left" : "to right"}, black 50%, rgba(0,0,0,0.86) 64%, rgba(0,0,0,0.6) 76%, rgba(0,0,0,0.32) 86%, rgba(0,0,0,0.1) 94%, transparent 100%)`,
|
||||
WebkitMaskImage: `linear-gradient(${side === "right" ? "to left" : "to right"}, black 50%, rgba(0,0,0,0.86) 64%, rgba(0,0,0,0.6) 76%, rgba(0,0,0,0.32) 86%, rgba(0,0,0,0.1) 94%, transparent 100%)`,
|
||||
}}
|
||||
/>
|
||||
|
||||
|
||||
Reference in new issue
Block a user