INNER CODE UNIT · JavaScript
enter
mario-andreschak/FLUJO · githubpages/short/app.js:289
const enter = easeOut(invLerp(at, at + duration, local));
const exit = exitAt < Infinity ? 1 - smoothstep(invLerp(exitAt, exitAt + exitDuration, local)) : 1;
const p = enter * exit;
el.style.opacity = p.toFixed(4);
el.style.transform = mixTransform(lerp(x, 0, enter), lerp(y, 0, enter), lerp(scale, 1, enter), lerp(rotate, 0, enter));
el.style.filter = `blur(${lerp(blur, 0, enter)}px)`;
return p;
}
function fadeWindow(local, start, end, fade = .45) {
if (local < start || local > end) return 0;
return Math.min(smoothstep(invLerp(start, start + fade, local)), 1 - smoothstep(invLerp(end - fade, end, local)));
}
function renderChaos(local) {
const hook = $("#hook-line");
const kicker = $("#hook-kicker");
const hookBeats = [