INNER CODE UNIT · JavaScript

invLerp

mario-andreschak/FLUJO · githubpages/short/app.js:125

  const invLerp = (a, b, v) => clamp((v - a) / Math.max(.0001, b - a));
  const easeOut = p => 1 - Math.pow(1 - clamp(p), 3);
  const easeInOut = p => {
    p = clamp(p);
    return p < .5 ? 4 * p * p * p : 1 - Math.pow(-2 * p + 2, 3) / 2;
  };
  const smoothstep = p => {
    p = clamp(p);
    return p * p * (3 - 2 * p);
  };
  const mixTransform = (x = 0, y = 0, scale = 1, rotate = 0) =>
    `translate3d(${x}px, ${y}px, 0) scale(${scale}) rotate(${rotate}deg)`;

  const stage = $("#stage");
  const voiceover = $("#voiceover");
  const captions = $("#captions");
  const poster = $("#poster");
  const endOverlay = $("#end-overlay");

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…