Skip to content

Add 3D hero orb and scroll-driven, scroll-aware backdrop#7

Merged
Yasar2019 merged 2 commits into
mainfrom
codex/add-interactive-3d-design-elements
Dec 19, 2025
Merged

Add 3D hero orb and scroll-driven, scroll-aware backdrop#7
Yasar2019 merged 2 commits into
mainfrom
codex/add-interactive-3d-design-elements

Conversation

@Yasar2019
Copy link
Copy Markdown
Owner

Motivation

  • Give the portfolio a modern, professional visual polish with subtle 3D motion and parallax that does not distract from content.
  • Introduce a scroll-driven variable so background and hero visuals can react smoothly to user scrolling for richer, tactile UX.
  • Keep changes lightweight and CSS-driven to maintain performance and easy theming.

Description

  • Add a scroll progress driver in App.jsx that publishes --scroll-progress to :root using a requestAnimationFrame-friendly scroll listener.
  • Extend src/styles/GlobalStyles.js with --scroll-progress, subtle backdrop layers (body::before and body::after) and scroll-tied transforms/opacity to create a parallax/backdrop effect.
  • Enhance src/Components/Header.jsx with a positioned HeroScene containing an animated 3D Orb and Ring elements, and adjust header layering (z-index) so content sits above the visuals.
  • Make HeaderSection position: relative and overflow: hidden to contain the scene and enable parallax translation via var(--scroll-progress).

Testing

  • Started the local dev server with npm start (Parcel) — bundling completed successfully (server reported "Built in ...").
  • Verified the dev server responded with HTTP/1.1 200 OK via curl.
  • Attempted an automated Playwright screenshot of the running site, but the headless navigation failed to connect (network error). This did not affect the build step which succeeded.
  • No unit tests were added or run as part of this change.

Codex Task

@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://witty-mud-031b23a0f-7.eastus2.2.azurestaticapps.net

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces scroll-driven visual enhancements to the portfolio site, including a 3D animated hero orb with orbital rings and parallax backdrop effects that respond to scroll position.

Key Changes:

  • Implements scroll progress tracking using requestAnimationFrame for performance-optimized scroll detection
  • Adds CSS custom property --scroll-progress that updates dynamically as users scroll
  • Introduces a 3D animated orb with spinning rings in the header section, positioned behind content using z-index layering

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
src/App.jsx Adds scroll progress tracking with useEffect hook that updates --scroll-progress CSS variable
src/styles/GlobalStyles.js Defines --scroll-progress variable and creates scroll-reactive backdrop layers using body::before and body::after pseudo-elements
src/Components/Header.jsx Introduces HeroScene, Orb, and Ring styled components with 3D transforms and animations; adds z-index layering to ensure content appears above decorative elements

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Components/Header.jsx
Comment on lines +187 to +193
<HeroScene>
<Orb>
<Ring />
<Ring />
<Ring />
</Orb>
</HeroScene>
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The 3D orb and rings are purely decorative but may confuse screen reader users. Add aria-hidden="true" to the HeroScene component to hide it from assistive technologies.

Copilot uses AI. Check for mistakes.
Comment thread src/App.jsx
@@ -1,6 +1,6 @@
// src/App.js
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The file comment says "src/App.js" but the file is named "App.jsx". Update the comment to match the actual filename.

Suggested change
// src/App.js
// src/App.jsx

Copilot uses AI. Check for mistakes.
0
)
scale(1.02);
filter: blur(0px);
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The blur filter is set to 0px which has no effect. Either remove this line if no blur is intended, or set it to a non-zero value if a blur effect is desired.

Suggested change
filter: blur(0px);

Copilot uses AI. Check for mistakes.
Comment thread src/Components/Header.jsx
Comment on lines +58 to +65
@keyframes orbSpin {
from {
transform: rotateX(18deg) rotateY(0deg);
}
to {
transform: rotateX(18deg) rotateY(360deg);
}
}
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The keyframes animation is defined inside the styled component definition. While this works, it creates duplicate keyframe definitions in the generated CSS each time the component is used. Move the keyframes definition outside the styled component using styled-components' keyframes helper to avoid duplication and improve performance.

Copilot uses AI. Check for mistakes.
Comment thread src/Components/Header.jsx
Comment on lines +90 to +98
@keyframes ringFloat {
0%,
100% {
filter: drop-shadow(0 0 8px rgba(255, 111, 97, 0.2));
}
50% {
filter: drop-shadow(0 0 18px rgba(73, 135, 255, 0.3));
}
}
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The keyframes animation is defined inside the styled component definition. While this works, it creates duplicate keyframe definitions in the generated CSS each time the component is used. Move the keyframes definition outside the styled component using styled-components' keyframes helper to avoid duplication and improve performance.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://witty-mud-031b23a0f-7.eastus2.2.azurestaticapps.net

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/App.jsx

updateScrollProgress();
window.addEventListener('scroll', handleScroll, { passive: true });
window.addEventListener('resize', handleScroll);
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The resize event listener should use the passive option for better scroll performance, similar to the scroll listener. Resize handlers that don't call preventDefault can benefit from being marked as passive.

Suggested change
window.addEventListener('resize', handleScroll);
window.addEventListener('resize', handleScroll, { passive: true });

Copilot uses AI. Check for mistakes.
inset: -20%;
pointer-events: none;
z-index: -1;
transition: transform 0.25s ease-out;
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Using both transform and transition on pseudo-elements that update via CSS custom properties can cause layout thrashing. Since --scroll-progress changes frequently during scrolling, the transition: transform 0.25s will attempt to animate every scroll update, creating a laggy effect. Consider removing the transition property to allow transforms to update smoothly with the scroll position, or use will-change: transform to optimize rendering.

Suggested change
transition: transform 0.25s ease-out;
will-change: transform;

Copilot uses AI. Check for mistakes.
Comment thread src/Components/Header.jsx
Comment on lines +187 to +193
<HeroScene>
<Orb>
<Ring />
<Ring />
<Ring />
</Orb>
</HeroScene>
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The HeroScene, Orb, and Ring elements are decorative and use pointer-events: none, but they should have aria-hidden="true" to ensure screen readers skip them entirely. Consider adding this attribute to the HeroScene component to improve accessibility.

Copilot uses AI. Check for mistakes.
)
rotate(calc(var(--scroll-progress) * 2deg));
}

Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Users with vestibular motion disorders may experience discomfort from the scroll-driven parallax effects on the backdrop pseudo-elements. Consider adding a prefers-reduced-motion media query to disable the transform animations for users who have requested reduced motion in their system settings.

Suggested change
@media (prefers-reduced-motion: reduce) {
body::before,
body::after {
transition: none;
transform: none;
}
}

Copilot uses AI. Check for mistakes.
Comment thread src/Components/Header.jsx
Comment on lines +76 to +88
&:nth-child(1) {
transform: rotateX(65deg) rotateZ(20deg) translateZ(25px);
}

&:nth-child(2) {
transform: rotateY(75deg) rotateZ(-15deg) translateZ(-10px);
animation-delay: 1.5s;
}

&:nth-child(3) {
transform: rotateX(80deg) rotateZ(80deg) translateZ(10px);
animation-delay: 3s;
}
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The animation on the Ring component will not work as intended. The nth-child selectors apply static transforms that override the animation property. The ringFloat animation will be superseded by the transform declarations in the nth-child rules. Either remove the transform from nth-child selectors and apply them via CSS variables in the animation, or use a different approach to differentiate the rings.

Copilot uses AI. Check for mistakes.
@Yasar2019 Yasar2019 merged commit 009cdc9 into main Dec 19, 2025
8 checks passed
@Yasar2019 Yasar2019 deleted the codex/add-interactive-3d-design-elements branch December 19, 2025 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants