Skip to content

fix: show hero text on mobile by overriding scroll-driven opacity#3

Merged
simonheimlicher merged 3 commits intomainfrom
fix/mobile-hero-invisible-text
Feb 26, 2026
Merged

fix: show hero text on mobile by overriding scroll-driven opacity#3
simonheimlicher merged 3 commits intomainfrom
fix/mobile-hero-invisible-text

Conversation

@simonheimlicher
Copy link
Copy Markdown
Contributor

Summary

  • On mobile (< 768px), the hero scroll container has height: auto (shorter than viewport)
  • Framer Motion's scrollYProgress reports ~1 since the container fits within the viewport
  • This causes textFade = 0, making eyebrow, description, Roots/Branches/Leaves, and CTA invisible
  • Fix: opacity: 1 !important on .hero-text-col > * in the mobile media query, since mobile doesn't use the scroll animation anyway

Test plan

  • 400x690 — all hero content now visible (eyebrow, headline, description, features, CTA)
  • 375x812 — same, all content visible
  • Desktop 768px+ — scroll animation still works (CSS rule scoped to max-width: 767px)

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
outcomeengineering Ready Ready Preview, Comment Feb 26, 2026 2:23am

Request Review

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @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

  • Mobile Hero Text Visibility Fix: Resolved an issue where hero text content (eyebrow, description, features, CTA) was invisible on mobile devices (< 768px) due to an incorrect opacity calculation by Framer Motion's scrollYProgress.
  • CSS Opacity Override: Implemented a targeted CSS rule opacity: 1 !important for .hero-text-col > * within a mobile media query to ensure hero content is always visible on smaller screens, without affecting desktop scroll animations.
Changelog
  • src/app/globals.css
    • Added a CSS rule to override Framer Motion's inline opacity for hero text elements on mobile.
Activity
  • No specific activity has been recorded for this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

Comment on lines +703 to +707
/* 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;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

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;
    }
  }

simonheimlicher added a commit that referenced this pull request Feb 25, 2026
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.
@simonheimlicher simonheimlicher force-pushed the fix/mobile-hero-invisible-text branch from 44f19a1 to b39e107 Compare February 26, 2026 02:23
@simonheimlicher simonheimlicher merged commit 477ead8 into main Feb 26, 2026
2 of 3 checks passed
@simonheimlicher simonheimlicher deleted the fix/mobile-hero-invisible-text branch February 26, 2026 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant