INNER CODE UNIT · JavaScript

setPathProgress

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

  function setPathProgress(path, progress) {
    const length = Number(path.dataset.length) || 1;
    const clamped = clamp(progress);
    path.style.strokeDasharray = String(length);
    path.style.strokeDashoffset = String(length * (1 - clamped));
    if (path.dataset.markerEnd) {
      path.style.markerEnd = clamped >= .97 ? path.dataset.markerEnd : "none";
    }
  }

  function sceneOpacity(t, start, end, fadeIn = 1.15, fadeOut = 1.15) {
    if (t < start || t > end) return 0;
    const enter = smoothstep(invLerp(start, start + fadeIn, t));
    const leave = 1 - smoothstep(invLerp(end - fadeOut, end, t));
    return Math.min(enter, leave);
  }

  function activateScene(scene, t) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…