INNER CODE UNIT · JavaScript

painDim

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

      const painDim = 1 - smoothstep(invLerp(18.0, 19.3, local)) * .79;
      const jitter = frenzy * (Math.sin(local * (4.8 + index * .09) + index * 2.1) * (3 + index % 3));
      const jitterY = frenzy * (Math.cos(local * (5.2 + index * .07) + index) * (2 + index % 4));
      const depth = Math.sin(index * 1.7) * 16 * frenzy;
      const scale = lerp(.72, 1, enter) * (1 + frenzy * Math.sin(local * 2 + index) * .025);
      card.style.left = `${tool.x}px`;
      card.style.top = `${tool.y}px`;
      card.style.opacity = (enter * painDim).toFixed(4);
      card.style.transform = `translate3d(${jitter}px, ${jitterY}px, ${depth}px) scale(${scale}) rotate(${tool.r + jitter * .28}deg)`;
      card.style.filter = `blur(${lerp(5, frenzy * .5, enter) + (1 - painDim) * 3}px) saturate(${lerp(.65, 1.1, frenzy)})`;
    });

    $$("#chaos-paths path").forEach((path, index) => {
      const p = easeOut(invLerp(10.4 + index * .055, 13 + index * .05, local));
      path.style.opacity = (p * (1 - smoothstep(invLerp(18, 19.2, local))) * .8).toFixed(3);
      path.style.strokeDashoffset = String((local * 25 + index * 13) % 80);
    });

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…