Skip to content

Optimize homepage hero animation to reduce scroll-time jank - #8

Draft
jasonkdeng with Copilot wants to merge 4 commits into
mainfrom
copilot/optimize-home-page-animation
Draft

Optimize homepage hero animation to reduce scroll-time jank#8
jasonkdeng with Copilot wants to merge 4 commits into
mainfrom
copilot/optimize-home-page-animation

Conversation

Copilot AI commented Apr 22, 2026

Copy link
Copy Markdown

Homepage hero animation was laggy due to avoidable per-frame work during scroll. This change reduces animation overhead in the turbine/cloud path while keeping the visual behavior and timing intact.

  • Cloud animation update-path cleanup

    • Replaced string-based x transforms ("-120vw" -> "120vw") and per-frame parsing with numeric motion values plus useMotionTemplate.
    • Derived cloud offsets directly from a shared numeric motion value.
    • Memoized CloudSVG to avoid redundant rerenders.
  • Turbine animation state/DOM churn reduction

    • Switched from deprecated motionValue.onChange callback style to useMotionValueEvent.
    • Cached .mainAbout element in a ref and toggled visibility class only on threshold state transitions.
    • Prevented redundant setIsAnimationComplete calls by guarding updates behind ref-based change detection.
    • Synced rotateInputEnd through a ref so scroll listeners use current threshold without re-subscribing.
  • Representative change

    const rawXVw = useTransform(scrollYProgress, [0, rotateInputEnd], [-120, 120]);
    const xVw = useSpring(rawXVw, { stiffness: 120, damping: 20 });
    const x = useMotionTemplate`${xVw}vw`;
    
    const x2Vw = useTransform(xVw, (v) => v * 0.7);
    const x2 = useMotionTemplate`${x2Vw}vw`;

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/waturbine-website/waturbine-website/node_modules/.bin/next build (dns block)
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node /home/REDACTED/work/waturbine-website/waturbine-website/node_modules/next/dist/server/lib/start-server.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@vercel

vercel Bot commented Apr 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
waturbine-website Ready Ready Preview, Comment Apr 22, 2026 2:12am

@netlify

netlify Bot commented Apr 22, 2026

Copy link
Copy Markdown

Deploy Preview for waturbine ready!

Name Link
🔨 Latest commit 2893811
🔍 Latest deploy log https://app.netlify.com/projects/waturbine/deploys/69e82e8aa6351800087896bc
😎 Deploy Preview https://deploy-preview-8--waturbine.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI changed the title [WIP] Fix laggy animation on home page Optimize homepage hero animation to reduce scroll-time jank Apr 22, 2026
Copilot AI requested a review from jasonkdeng April 22, 2026 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Laggy animation on home page. Can it be optimized?

2 participants