Skip to content

feat(home): add Lenis smooth scroll to homepage [INTORG-734]#308

Open
Infi-Knight wants to merge 1 commit into
stagingfrom
ravi/intorg-734
Open

feat(home): add Lenis smooth scroll to homepage [INTORG-734]#308
Infi-Knight wants to merge 1 commit into
stagingfrom
ravi/intorg-734

Conversation

@Infi-Knight
Copy link
Copy Markdown
Contributor

Summary

Adds wheel/trackpad smooth scrolling to the homepage via Lenis, mirroring the Framer prototype at inspirational-lottery-436833.framer.app. Scoped to the homepage only via a <SmoothScroll /> loader component — docs, blog, and other routes keep native scroll.

Implementation choices:

  • Lenis config: duration: 0.9 (everything else default). Pulled from the Framer prototype's compiled bundle — its Smooth Scroll component uses new Lenis({ duration: intensity/10 }) and the prototype sets intensity: 9. Scroll-curve A/B against the live prototype settles to the same final position at the same time (~900ms, easeOutExpo).
  • Accessibility: bails immediately when prefers-reduced-motion: reduce matches, and destroy()s if the preference flips at runtime. Lenis does not honor this preference by default.
  • Anchor links: same-origin a[href*="#"] clicks are intercepted and scrolled via lenis.scrollTo, with the offset read from the target's scroll-margin-top, falling back to .foundation-header.offsetHeight so sticky-header overlap is avoided.
  • Nested scrollers: walks the DOM once at init and tags overflow: auto elements with data-lenis-prevent so they keep native scroll — same approach the Framer component takes.
  • CSS: 5 standard Lenis rules added under @layer base in reset.css. They're inert unless <html> has the lenis class.

Related Issue

Fixes INTORG-734

Manual Test

  1. Load homepage on desktop with a trackpad or mouse wheel — scroll should feel eased, not snappy. Compare A/B against the Framer prototype — feel should be near-identical.
  2. DevTools → Rendering → emulate prefers-reduced-motion: reduce → reload. <html> should not have the lenis class; scrolling should be native/instant.
  3. Navigate to /about-us, /blog, or any docs page — scroll should be native (Lenis only loads on the homepage).
  4. Tab through focusable elements — focus management is unchanged.
  5. Mobile / touch — scroll stays native (Lenis's syncTouch default of false).

Checks

  • pnpm run format
  • pnpm run lint

PR Checklist

  • PR title follows Conventional Commits
  • Linked issue included
  • Scope is focused (6 files)
  • Screenshots for UI changes (smooth scroll is motion-only; see scroll-curve comparison above)

Mirrors the Framer prototype's Smooth Scroll component (Lenis with
duration: 0.9). Scoped to the homepage via a <SmoothScroll /> loader so
docs, blog, and other routes keep native scroll. Bails when the user
has prefers-reduced-motion: reduce and re-engages if the preference
changes at runtime. Anchor-link clicks are intercepted and offset by
the target's scroll-margin-top, falling back to the sticky header
height.
@netlify
Copy link
Copy Markdown

netlify Bot commented May 22, 2026

Deploy Preview for interledger-org-v5 ready!

Name Link
🔨 Latest commit 2d22bf0
🔍 Latest deploy log https://app.netlify.com/projects/interledger-org-v5/deploys/6a102885fe6f7b0008457bc2
😎 Deploy Preview https://deploy-preview-308--interledger-org-v5.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.

@Infi-Knight Infi-Knight self-assigned this May 22, 2026
Copy link
Copy Markdown
Collaborator

@JonathanMatthey JonathanMatthey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great

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.

2 participants