Skip to content

Landing 3D decor: scroll-driven rotation and higher damping#119

Open
mkayander wants to merge 10 commits intomainfrom
cursor/-bc-5976fa66-4c23-4210-9af2-74f969aa4170-9c6b
Open

Landing 3D decor: scroll-driven rotation and higher damping#119
mkayander wants to merge 10 commits intomainfrom
cursor/-bc-5976fa66-4c23-4210-9af2-74f969aa4170-9c6b

Conversation

@mkayander
Copy link
Copy Markdown
Owner

@mkayander mkayander commented Apr 7, 2026

Summary

Landing background 3D decor: mobile uses idle oscillation + screen-space touch parallax (global window touch listeners) + mobile-only entrance animations. Desktop uses mouse parallax only. No scroll-driven orbit (scroll metrics / listeners removed).

Motion

  • Mobile (useMobileLayout): time-based idle drift + touch position mapped to azimuth/polar; touch deltas decay after release. idleMotionPhaseSec / LANDING_DECOR_PYTHON_IDLE_MOTION_PHASE_SEC de-phases hero vs Python idle.
  • Desktop: mousemove parallax; blur / mouseleave resets pointer deltas.
  • Follow damping: LANDING_HERO_ORBIT_TUNING.*.frameDamping — desktop 0.48; mobile 1 (snap to target each frame after 3× from prior values).

Mobile appearance (xs / sm only, useMobileLayout)

  • useLandingDecor3dMobileEntrance: fade + slide + scale; respects reduced motion.
  • Re-arms entrance only on desktop → mobile resize.

Layout / size

  • LANDING_DECOR_PYTHON_CANVAS_SIZE_PX for larger Python ambient canvas vs hero.

Refactor

  • prefersReducedMotion in #/shared/lib/prefersReducedMotion.
  • landingHeroOrbitMotionConstants.ts holds orbit/touch/idle tuning.

Testing

  • pnpm exec eslint on touched files + pnpm run tsc (pass).

   

Open in Web Open in Cursor 

- Combine scroll-based azimuth/polar deltas with desktop pointer parallax
- Single rAF loop and passive scroll listener for mobile and desktop
- Raise HERO_MODEL_DAMPING and OrbitControls dampingFactor for snappier follow

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 7, 2026

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

Project Deployment Actions Updated (UTC)
dstruct Ready Ready Preview, Comment Apr 8, 2026 9:03am

Scroll progress was clamped after ~one viewport, so lower Python decor
appeared static. Use document scroll range and refresh on resize.

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
MainLayout wraps content in PageScrollContainer; scrolling happens on
[data-overlayscrollbars-viewport], not window. Attach scroll listener
and scroll metrics to that element with window fallback and a short
rAF chase for deferred OS init.

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
Increase azimuth/polar amplitudes, scroll multipliers, polar clamp
range, follow damping, and pointer parallax strength for clearer motion.

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
Add useLandingDecor3dMobileEntrance: fade + slide + scale on xs/sm only,
hero after mount, Python on section intersection; respects reduced motion.
Merge sx into hero and Python wrappers (inner Box for Python preserves
vertical centering).

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
@mkayander mkayander marked this pull request as ready for review April 7, 2026 17:56
cursoragent and others added 2 commits April 7, 2026 18:04
Desktop uses original pointer parallax ranges, damping, and polar
clamps; no scroll listeners. Revert OrbitControls dampingFactor to
0.005 for interactive canvases. Reset pose when crossing mobile/desktop.

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
…helper

- Extract prefersReducedMotion to shared lib; use in landing reveal + 3D entrance
- landingHeroOrbitMotionConstants: single source for desktop vs mobile orbit tuning
- getPageScrollRoot + attachPageScrollRoot simplify useHeroOrbitModelMotion
- LANDING_DECOR_CANVAS_SIZE_PX / GLASS_OPACITY_SX for hero + Python wrappers
- useLandingDecor3dMobileEntrance: re-arm entrance only on desktop→mobile
- useLandingReveal: fix id-length; eslint pragmas for intentional sync setState

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
- Add smoothed dual-sine idle azimuth/polar on mobile (respect reduced motion)
- Window touch listeners (capture) map finger position with higher gain + decay
- idleMotionPhaseSec + LANDING_DECOR_PYTHON_IDLE_MOTION_PHASE_SEC to de-phase models
- Extend LANDING_HERO_ORBIT_TUNING.mobile with idle and touch constants

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
…r touch polar

- Double desktop/mobile frameDamping for snappier follow
- LANDING_DECOR_PYTHON_CANVAS_SIZE_PX (~22% larger per breakpoint)
- Raise mobile touchPolarMultiplier for clearer vertical finger effect

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
- Remove scroll listeners and scrollPhasePx; delete getPageScrollMetrics
- Triple frameDamping (desktop 0.48; mobile 1 = snap to target)
- Mobile motion: idle + screen-space touch only

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
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