Skip to content

Commit 767401b

Browse files
superterranclaude
andcommitted
Give the hero wave height: ripples spreading from the mark
The bars only ever moved left and right, so the effect read as a narrow strip the icon sat in front of. Faint rings in the mark's own rounded-square shape now spread out from it on every side and fade before the canvas edge. They brighten with the same low-passed loudness as the aura, so the glow, the rings and the bars read as one effect. They are computed from the clock, so the reduced-motion frame shows a still set of rings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent ada913b commit 767401b

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

‎site/index.html‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,32 @@ <h2 id="how-h">How it works</h2>
254254
// `rad` is fully transparent anyway, so filling the full bitmap was blending
255255
// roughly a million untouched pixels on every frame for no visible result.
256256
ctx.fillRect(cx - rad, cy - rad, rad * 2, rad * 2);
257+
258+
// Ripples: the mark's own rounded square, spreading out from it on every
259+
// side. The bars alone only ever moved left and right, so the effect read
260+
// as a strip the icon sat in front of; the rings give it height, and put
261+
// the icon at the centre of the motion rather than in its way. Computed
262+
// from the clock rather than kept as objects, so the reduced-motion frame
263+
// and a resize both get the same rings with no state to carry.
264+
const RINGS = 4, PERIOD = 5.2; // one ring every 1.3s
265+
const half = 48; // the mark's half-size
266+
const reach = Math.min(h * 0.5, w * 0.5) - half - 6;
267+
ctx.lineWidth = 1.5;
268+
ctx.strokeStyle = colour;
269+
for (let k = 0; k < RINGS; k++) {
270+
const phase = ((time / PERIOD) + k / RINGS) % 1;
271+
const s = half + phase * reach;
272+
// Fades as it grows, and is gone before it meets the canvas edge.
273+
// Louder moments make the rings brighter, the same swell as the aura.
274+
const alpha = Math.pow(1 - phase, 1.8) * (0.16 + glow * 0.22) * Math.min(1, phase * 6);
275+
if (alpha < 0.004) continue;
276+
ctx.globalAlpha = alpha;
277+
ctx.beginPath();
278+
ctx.roundRect(cx - s, cy - s, s * 2, s * 2, 22 * (s / half) * 0.9);
279+
ctx.stroke();
280+
}
281+
ctx.globalAlpha = 1;
282+
257283
const mid = h * 0.5;
258284
const centre = w / 2;
259285
// The mark's own half-width, plus breathing room: bars inside this radius

0 commit comments

Comments
 (0)