fix: show hero text on mobile by overriding scroll-driven opacity#3
fix: show hero text on mobile by overriding scroll-driven opacity#3simonheimlicher merged 3 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello @simonheimlicher, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical display bug on mobile devices where the hero section's text content was not visible. The problem stemmed from an interaction with Framer Motion's scroll-driven opacity animation, which incorrectly calculated opacity as zero on mobile due to the shorter scroll container. The fix ensures that the hero text is always visible on mobile by applying a targeted CSS override, while preserving the scroll animation functionality on desktop. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request aims to fix an issue on mobile where hero text is invisible due to a scroll-driven animation. While the approach of overriding the opacity is correct, the current implementation applies this change globally, which would break the animation on desktop. I've added a critical review comment with a code suggestion to scope the CSS rule to mobile viewports using a media query, aligning the code with the intent described in the pull request.
src/app/globals.css
Outdated
| /* Override Framer Motion inline opacity — on mobile the scroll container is | ||
| shorter than the viewport so scrollYProgress≈1 and textFade=0 */ | ||
| .hero-text-col > * { | ||
| opacity: 1 !important; | ||
| } |
There was a problem hiding this comment.
The PR description mentions that this override should only apply on mobile (e.g., max-width: 767px), but the CSS is currently being applied globally. This will break the scroll-driven opacity animation on desktop. To fix this, the rule should be wrapped in a media query.
/* Override Framer Motion inline opacity — on mobile the scroll container is
shorter than the viewport so scrollYProgress≈1 and textFade=0 */
@media (max-width: 767px) {
.hero-text-col > * {
opacity: 1 !important;
}
}Add CLAUDE.md rule #3 requiring /spx:committing-changes skill for all commits. Remove PLAN.md which tracked the initial site transformation and is no longer needed.
On mobile the hero scroll container is shorter than the viewport, so Framer Motion's scrollYProgress reports ~1 and textFade becomes 0, making all supporting text invisible. Override with opacity: 1 via CSS since mobile doesn't use the scroll animation.
Remove Framer Motion from hero section entirely. The scroll-driven animation was janky on desktop and caused invisible text on mobile. - Rewrite HeroSection as a server component (no client JS) - Remove HeroSpecTree overlay, ground line, scroll hint - Responsive two-column grid at >=768px, stacked on mobile - Tree visible at all breakpoints (was hidden on mobile) - Tighten SVG viewBox to eliminate whitespace around tree - Use clamp() for fluid h1 sizing across viewports
Shorten directory and file names in all example spec trees across the landing page, blog, docs, and concept variation assets.
44f19a1 to
b39e107
Compare
Summary
height: auto(shorter than viewport)scrollYProgressreports ~1 since the container fits within the viewporttextFade = 0, making eyebrow, description, Roots/Branches/Leaves, and CTA invisibleopacity: 1 !importanton.hero-text-col > *in the mobile media query, since mobile doesn't use the scroll animation anywayTest plan