Ring code: wipe eases in and out (quart), less stagger
This commit is contained in:
@@ -201,8 +201,9 @@ export function render(ctx, cx, cy, unit, theta, bits, t = 0, fade = null) {
|
||||
const from = alphaOf(prev[k][j]), to = alphaOf(ring[j]);
|
||||
const lo = a - half - cap, hi = a + half + cap;
|
||||
const dir = phase(k + 7, j + (fade.seed || 0) * 31) < 0.5 ? 1 : -1;
|
||||
const delay = phase(k + 3, j + (fade.seed || 0) * 17) * 0.25, x = Math.min(1, Math.max(0, (fade.k - delay) / 0.75));
|
||||
const e = 0.5 - 0.5 * Math.cos(Math.PI * x);
|
||||
const delay = phase(k + 3, j + (fade.seed || 0) * 17) * 0.15, x = Math.min(1, Math.max(0, (fade.k - delay) / 0.85));
|
||||
// quart in-out: eases in, crosses, eases out. sine read as a constant slide
|
||||
const e = x < 0.5 ? 8 * x ** 4 : 1 - (-2 * x + 2) ** 4 / 2;
|
||||
if (!ctx.createConicGradient) {
|
||||
ctx.globalAlpha = from + (to - from) * e;
|
||||
dash();
|
||||
|
||||
Reference in New Issue
Block a user