Repository navigation
feat: animate home page sections using RevealOnScroll - #9
TheSeydiCharyyev merged 2 commits into
Conversation
Continue the pattern from Shapak-Apps#7 for the rest of the home page. Chosen option: reuse RevealOnScroll on the home page. This keeps the animation mechanism unified across the site without adding a new library dependency. Resolves Shapak-Apps#8
TheSeydiCharyyev
left a comment
There was a problem hiding this comment.
Checked the build locally in Chromium at 1280x800, 1366x768 and 390x844: nothing on the first screen is hidden, only elements below it wait for scroll. /#people works too: only the second row of member cards waits. Full-page screenshot is pixel-identical to production, and JS weight did not change (about 173 KB gzip).
Two things before merge:
-
The reveal CSS is now in two places:
.revealincomponents/home.cssand.project.revealincomponents/projects.css. The issue asks for one mechanism, so please keep one copy inapp/globals.cssand remove the other two. Watch one thing:.projectinprojects.cssalso setstransition, and with the same specificity the later rule wins, so project cards can lose the fade. Check that/projects/still animates as before. The!importantin the reduced-motion block is not needed:RevealOnScrolldoes not addpendingwhen reduced motion is on. -
Please add a short video of scrolling the home page from top to bottom. It is in "Done when" of #8.
Also please fix the first line of the description: #7 is not done yet, so this PR does not continue its pattern. Using the existing RevealOnScroll is fine.
|
@TheSeydiCharyyev Addressed all feedback:
Video: scroll.mp4 |
- Move .reveal styles to app/globals.css (single copy for whole site) - Use body .reveal selector (specificity 11) so /projects/ cards keep their fade-in animation - Remove duplicate .reveal from home.css - Remove .project.reveal from projects.css - Remove unnecessary !important in reduced-motion block (RevealOnScroll does not add .pending when reduced motion is on)
TheSeydiCharyyev
left a comment
There was a problem hiding this comment.
Checked a1d8b41 locally in Chromium. /, /ru/, /projects/ and phone width: nothing on the first screen is hidden, and after scrolling to the bottom every element is fully visible. Project cards still fade in (opacity, transform 0.7s). With reduced motion nothing is hidden. Full-page screenshots match production.
One small thing for later, not blocking: the prefers-reduced-motion block in globals.css uses .reveal, but the main rules use body .reveal, which has higher specificity, so this block never wins. It does no harm today because RevealOnScroll does not add pending with reduced motion. Either use body .reveal inside the block too, or remove the block.
Reuses the existing
RevealOnScrollcomponent for the home page sections below the hero.Chosen option (from issue #8): reuse
RevealOnScrollon the home page.This keeps a single animation mechanism across the site and adds no new dependencies.
What's animated
Scroll-triggered fade-in + slide-up with staggered cascade for:
MissionsectionPrinciples(label + principle cards)Projectsintro sectionPeople(label, text, member cards)Contributing(label, steps, promise block, CTAs)CSS consolidation
Moved
.revealstyles toapp/globals.css(single copy for the whole site), removed duplicates fromhome.cssandprojects.css. Usedbody .revealselector (specificity 11) so it wins over.project(10) and/projects/cards keep their fade-in.Rules respected
.pendingclass added only by JS)prefers-reduced-motion: reduce→ no motion, final state immediatelyopacity+transform)/,/ru/,/en/Resolves #8