agentleFS
Yahiasherif002Yahiasherif002/claude-skills/scroll-reveal-kit/SKILL.md

scroll-reveal-kit

Skill1 starsChanged 5 months agoMITView on GitHub

Add tasteful, RELIABLE scroll-triggered animations to a React site — a SectionHeading that types a "// label" kicker + draws an animated underline when it scrolls into view, a count-up number component for stats, and the correct framer-motion reveal patterns. Includes the fixes for the common framer-motion gotcha where parent→child variant propagation through whileInView silently leaves content stuck invisible. Use when the user wants scroll reveals, animated section headers, animated stat counters, or is fighting "my section is blank / animation didn't fire" bugs.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use one of these instead:

    line 30
  2. Very specific:

    Rule of thumb: never let visibility depend on a stagger that might not fire.

    line 50

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Scroll Reveal Kit

Polished scroll animations that don't break — plus the hard-won fixes for framer-motion's reveal footguns.

What it produces

  • SectionHeading.tsx — a heading that, the first time it scrolls into view, types a // label kicker and draws an animated underline. Pass label + heading children.
  • CountUp.tsx — animates a number 0→N when it enters the viewport (suffix/prefix/decimals).
  • Reveal patterns (below) — copy-paste motion snippets that are robust.

⚠️ The framer-motion gotcha (and the fix)

The most common "my whole section is invisible" bug comes from parent→child variant propagation through whileInView:

// ❌ FRAGILE — children can get stuck at opacity:0 if propagation doesn't fire
<motion.div initial="hidden" whileInView="show" variants={{ hidden:{}, show:{ transition:{ staggerChildren:0.1 }}}}>
  {items.map(i => <motion.div variants={fadeUp} key={i}>…</motion.div>)}
</motion.div>

Use one of these instead:

// ✅ ROBUST A — each child triggers its own whileInView (no propagation dependency)
{items.map((it, i) => (
  <motion.div key={i}
    initial={{ opacity: 0, y: 16 }}
    whileInView={{ opacity: 1, y: 0 }}
    viewport={{ once: true, amount: 0.2 }}
    transition={{ duration: 0.5, delay: i * 0.08 }}>
    {…}
  </motion.div>
))}

// ✅ ROBUST B — for above-the-fold groups, use animate (mount) not whileInView
<motion.div initial="hidden" animate="show" variants={{ hidden:{}, show:{ transition:{ staggerChildren:0.1 }}}}>
  {items.map(i => <motion.div variants={fadeUp} key={i}>…</motion.div>)}
</motion.div>

Rule of thumb: never let visibility depend on a stagger that might not fire. If content must be visible, prefer per-item whileInView or mount animate.

Scroll containers: framer's whileInView observes the viewport by default. If your page scrolls inside an inner overflow-y-auto element, pass viewport={{ root: scrollRef }}.

How to use it

  1. Copy references/SectionHeading.tsx and references/CountUp.tsx into components.
  2. <SectionHeading label="projects">My Projects</SectionHeading> and <CountUp end={500} suffix="+" />.
  3. Deps: framer-motion. Styling uses --primary / --muted-foreground tokens + a .caret blink (include the small CSS in references/caret.css).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.