refactor: centralize background crossfade, add light/dark toggle, project card reveal#18
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
refactor: centralize background crossfade, add light/dark toggle, project card reveal#18devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
…ination Co-Authored-By: Caleb Bae <baecal000@gmail.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… themed scrollbars Co-Authored-By: Caleb Bae <baecal000@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Background crossfade centralization (original scope).
PageBackgroundis now the single owner of the animated page background: each dark↔light transition is a declarative phase inbackground/sceneConfig.ts(PAGE_BG_PHASES), observed by plain ScrollTriggers whose progress deterministically computes one light-layer opacity, applied through a singlegsap.quickTowriter. This removes the three competing tweens that could leave the background stuck white after a fast bottom→top scroll. Navbar light/dark now derives from the same value (NAVBAR_LIGHT_THRESHOLD) instead of per-section enter/leave callbacks.Fast-scroll seam fixes.
PAGE_BG_SNAP_DELTA: if a single update moves the target opacity by ≥0.35 (Home/End, fast fling), the layer snaps viagsap.setbefore resuming the smoothed writer, so it can never lag mid-crossfade.bg-backgroundfrom the animated Teams/Constellation sections (directors message → constellation boundary line); the fixedPageBackgroundis now the only painter there. Reduced-motion fallbacks keep their own opaque backgrounds.Site-wide light/dark toggle. Semantic tokens (
--color-background/foreground/muted/surface/surface-foreground+ new--color-card) now resolve through--theme-*variables declared on:rootand[data-theme="light"]. AThemeTogglein the navbar (sun/moon, desktop + mobile menu) flipsdocumentElement.dataset.theme, persists tolocalStorage, and a pre-paint inline script inlayout.tsxrestores it without a flash. Navbar reads it viauseSyncExternalStore; the white/black logo choice isscrollPhaseLight XOR siteThemeLightsince the "light" phase surface is dark in light mode. The hero keeps its dark art direction via a.theme-scope-darkoverride plus an opaque backdrop layer that fades out with the rest of the scene. Hard-codedwhite/neutralclasses in Teams, Constellation, NodeTooltip, Projects, Mission, and the timeline year labels were swept to token-based equivalents so both themes stay readable.Project cards scroll-in reveal.
Projectsis now a client component: cards fade/slide in (autoAlpha 0, y 40, staggered,once: true) when the section reaches 75% viewport, configured inprojects/sceneConfig.ts; skipped under reduced motion.Thicker themed scrollbars. Global 12px rounded scrollbars (
::-webkit-scrollbar+ Firefoxscrollbar-color) usingcolor-mixon the foreground token so they adapt to the theme.Also:
useNavbarThememoved touseSyncExternalStore,FooterReveal's ResizeObserver now debouncesScrollTrigger.refresh()and only fires on height change, andCometTrailBackgroundreuses the sharedBrandShaderBackgroundconfig.Known pre-existing lint error (also on
main):ReunionTower.tsx:395cam.nearmutation (react-hooks/immutability) — untouched as out of scope.Runtime/browser testing intentionally not performed per requester's instruction ("DO NOT test yourself through the web I WILL DO THAT"); validated via
npm run lint,tsc --noEmit, andnpm run build.Link to Devin session: https://app.devin.ai/sessions/826fedd0d8ff4bcc8b4e3e8947dcfcf3
Requested by: @balebbae