Skip to content

fix(hero): correct Earth globe sizing, scroll range, and transition easing - #224

Merged
krishkhinchi merged 1 commit into
7-Blocks:mainfrom
krishkhinchi:Add3dEarthAnimation
Sep 18, 2026
Merged

krishkhinchi merged 1 commit into
7-Blocks:mainfrom
krishkhinchi:Add3dEarthAnimation

Conversation

@krishkhinchi

@krishkhinchi krishkhinchi commented Sep 18, 2026

Copy link
Copy Markdown
Member

User description

Summary

Fixes the hero section's 3D Earth globe scroll animation — corrects oversized initial rendering, scopes the scroll-driven sequence to the hero instead of the full page, smooths the end-of-sequence transition, and reduces cloud density on the surface texture.

Closes #223

Changes

  • Sizing/containment: Globe scale/camera distance at initial load (scroll = 0) is now computed relative to the hero container's dimensions instead of a fixed value, so it renders fully contained within the hero (no clipping behind the navbar or off the bottom edge).
  • Scroll range: ScrollTrigger start/end is now scoped to a short, explicit distance near the top of the page (~1–1.5x viewport height) instead of spanning the entire page height. The intro grow/move/rotate sequence completes early, before mid-page content sections.
  • Post-sequence cleanup: Once the intro completes, the globe is unpinned, faded out, and its render loop is stopped (pointer-events: none + visibility handling) so it no longer overlaps or obscures subsequent sections (feature blocks, stats, CTA, footer). Removed a leftover pin-spacer that was causing layout inconsistency after unpin.
  • Transition smoothness: Reworked the end-of-sequence shrink/fade to use eased scrub values instead of a hard cutoff, eliminating the visible snap/pop when the pin releases.
  • Clouds: Reduced/removed cloud layer density so land/ocean texture is clearly visible (previously too dense, obscuring the surface).
  • Verified bidirectional scroll behavior (up/down) still scrubs smoothly through all waypoints.
  • Verified responsive behavior across desktop/tablet/mobile breakpoints via matchMedia.
  • Verified prefers-reduced-motion fallback still renders a static frame with no scroll-linked transform.

Before / After

Before

image

After
image

Testing

  • Manually scrolled full page at desktop width — confirmed no section is obscured by the globe past the intro range.
  • Manually scrolled full page at mobile width — confirmed sizing/positioning holds up.
  • Verified no leftover pin-spacer or blocking elements in DevTools after unpin.
  • Verified smooth easing on scroll-down and scroll-up through the intro sequence.
  • Verified with prefers-reduced-motion: reduce enabled in OS/browser settings.
  • Checked FPS/performance during intro sequence and confirmed render loop stops once out of view.
  • No new console errors/warnings.

Notes for reviewers

  • Scale/position values are now derived from hero container bounds — flag if any hardcoded fallback values still look viewport-specific.
  • Cloud layer was [removed / reduced to ~0.3 opacity — pick whichever was implemented] — call out if you want a different density.

CodeAnt-AI Description

Add a scroll-driven 3D Earth animation to the hero section

What Changed

  • Replaced the previous globe with a full-screen 3D Earth showing day and night textures, ocean reflections, clouds, and an atmospheric glow
  • The globe now moves, rotates, grows, and fades away as users scroll through the hero section
  • Globe positioning and sizing adapt for desktop, tablet, and mobile layouts
  • Users can drag the globe to rotate it, while it continues a subtle idle rotation
  • The animation respects reduced-motion preferences and avoids rendering after the globe leaves the intro sequence
  • Updated hero telemetry to show 64,000+ tracked objects and 98.2% model confidence

Impact

✅ Richer Earth visualization
✅ Scroll-guided hero storytelling
✅ Responsive globe placement

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • New Features
    • Added a full-viewport 3D globe to the hero section with Earth, cloud, and atmospheric visuals.
    • Globe animations respond to scrolling across desktop, tablet, and mobile layouts.
    • Added pointer-drag rotation, idle motion, responsive resizing, and graceful fade-out behavior.
    • Updated hero metrics to show 64,000+ objects tracked and 98.2% model confidence.
    • Improved visual layering and transitions within the hero section.

@codeant-ai

codeant-ai Bot commented Sep 18, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 40e951f Sep 18, 2026 · 13:34 13:37

@codeant-ai

codeant-ai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: a3cc184b-f29f-4bbb-ad39-4aa2bc3bda4b

📥 Commits

Reviewing files that changed from the base of the PR and between b2bd1c1 and 40e951f.

⛔ Files ignored due to path filters (10)
  • frontend/package-lock.json is excluded by !**/package-lock.json
  • frontend/public/textures/earth/2k_earth_clouds.jpg is excluded by !**/*.jpg
  • frontend/public/textures/earth/2k_earth_daymap.jpg is excluded by !**/*.jpg
  • frontend/public/textures/earth/8081_earthbump4k.jpg is excluded by !**/*.jpg
  • frontend/public/textures/earth/8081_earthlights4k.jpg is excluded by !**/*.jpg
  • frontend/public/textures/earth/8081_earthspec4k.jpg is excluded by !**/*.jpg
  • frontend/public/textures/earth/lensflare0.png is excluded by !**/*.png
  • frontend/public/textures/earth/lensflare1.png is excluded by !**/*.png
  • frontend/public/textures/earth/night.jpg is excluded by !**/*.jpg
  • frontend/public/textures/earth/specularClouds.jpg is excluded by !**/*.jpg
📒 Files selected for processing (8)
  • frontend/package.json
  • frontend/src/components/Hero.tsx
  • frontend/src/components/ui/globe.tsx
  • frontend/src/components/ui/globe/shaders.ts
  • frontend/src/components/ui/globe/shaders/atmosphere.frag
  • frontend/src/components/ui/globe/shaders/atmosphere.vert
  • frontend/src/components/ui/globe/shaders/earth.frag
  • frontend/src/components/ui/globe/shaders/earth.vert
 ________________________________________________
< Doubling as a space heater during code review. >
 ------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codeant-ai codeant-ai Bot added the size:XL This PR changes 500-999 lines, ignoring generated files label Sep 18, 2026

@krishkhinchi krishkhinchi left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done!!

@krishkhinchi
krishkhinchi merged commit bc3fe1e into 7-Blocks:main Sep 18, 2026
8 of 9 checks passed
Comment on lines +45 to +47
{/* <MouseParallax strength={10}>
<OrbitSatellites />
</MouseParallax>

<MouseParallax strength={20} className="absolute inset-0 flex items-center justify-center">
<Globe className="h-max-[480px] w-max-[480px]" />
</MouseParallax>
</MouseParallax> */}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: The satellite component is commented out while its wrapper remains, so the timeline animates an empty overlay and no satellites appear.

Assessment: 🟠 Major · 🔁 Occurrence: Often · 🏷️ Incomplete implementation

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** frontend/src/components/Hero.tsx
**Line:** 45:47
**Comment:**
	*Incomplete Implementation: The satellite component is commented out while its wrapper remains, so the timeline animates an empty overlay and no satellites appear.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment on lines +47 to +52
const renderer = new THREE.WebGLRenderer({
canvas,
antialias: true,
alpha: true,
powerPreference: "high-performance",
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: WebGLRenderer construction can throw when WebGL is unavailable, and this effect has no fallback, causing the landing page to fail instead of rendering usable content.

Assessment: 🔴 Critical · 🔁 Occurrence: Rarely · 🏷️ Possible bug

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** frontend/src/components/ui/globe.tsx
**Line:** 47:52
**Comment:**
	*Possible Bug: `WebGLRenderer` construction can throw when WebGL is unavailable, and this effect has no fallback, causing the landing page to fail instead of rendering usable content.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment on lines +62 to +64
const dayTexture = textureLoader.load(
"/textures/earth/2k_earth_daymap.jpg",
() => setIsLoaded(true)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: If the day texture request fails, isLoaded never becomes true and the canvas remains transparent indefinitely.

Assessment: 🟠 Major · 🔁 Occurrence: Sometimes · 🏷️ Possible bug

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** frontend/src/components/ui/globe.tsx
**Line:** 62:64
**Comment:**
	*Possible Bug: If the day texture request fails, `isLoaded` never becomes true and the canvas remains transparent indefinitely.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

setupTimeline({
w0: { x: 1.20, y: -0.2, scale: 0.85, tiltX: THREE.MathUtils.degToRad(23.5) },
w1: { x: 1.2, y: 0.15, scale: 1.20, tiltX: THREE.MathUtils.degToRad(18) },
w2: { x: 1.55, y: -0.2, scale: 2.80, tiltX: THREE.MathUtils.degToRad(26) },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: On desktop, the globe grows to radius 2.8 while the camera moves to z 2.7, placing the camera inside front-sided Earth and cloud meshes and making them disappear or render incorrectly.

Assessment: 🟠 Major · 🔁 Occurrence: Often · 🏷️ Logic error

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** frontend/src/components/ui/globe.tsx
**Line:** 296:296
**Comment:**
	*Logic Error: On desktop, the globe grows to radius 2.8 while the camera moves to z 2.7, placing the camera inside front-sided Earth and cloud meshes and making them disappear or render incorrectly.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

currentDragRotation = THREE.MathUtils.lerp(currentDragRotation, targetDragRotation, 0.08);

// Additive idle rotation (independent of scroll — keeps globe alive when paused)
idleRotation += delta * 0.04;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: Reduced-motion users still receive continuous idle rotation because the animation loop updates idleRotation regardless of the preference.

Assessment: 🟠 Major · 🔁 Occurrence: Sometimes · 🏷️ Logic error

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** frontend/src/components/ui/globe.tsx
**Line:** 368:368
**Comment:**
	*Logic Error: Reduced-motion users still receive continuous idle rotation because the animation loop updates `idleRotation` regardless of the preference.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

ref={canvasRef}
className={cn(
"size-full opacity-0 transition-ui contain-[layout_paint_size]"
"h-full w-full select-none touch-none pointer-events-auto transition-opacity duration-700",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: The fixed canvas covers the whole viewport and overrides its parent’s pointer-events-none, so it captures clicks on links and controls in sections beneath the hero.

Assessment: 🟠 Major · 🔁 Occurrence: Sometimes · 🏷️ Possible bug

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** frontend/src/components/ui/globe.tsx
**Line:** 432:432
**Comment:**
	*Possible Bug: The fixed canvas covers the whole viewport and overrides its parent’s `pointer-events-none`, so it captures clicks on links and controls in sections beneath the hero.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

@codeant-ai

codeant-ai Bot commented Sep 18, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

3 code suggestions

1. config is exposed but ignored, so existing consumers and stories cannot customize globe colors or other supported settings.

Api mismatch · frontend/src/components/ui/globe.tsx:24


2. The configured rotation is 190 degrees even though the code documents India at 78.9 degrees, so the initial globe faces the wrong longitude.

Logic error · frontend/src/components/ui/globe.tsx:161


3. This standalone shader is never imported by globe.tsx, which compiles earthFragmentShader from shaders.ts; changes here have no runtime effect.

Api mismatch · frontend/src/components/ui/globe/shaders/earth.frag:1-3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Earth globe scroll animation: sizing, scroll range, and easing issues

2 participants