Packs / web-development-public
text-ui-animations
Dependency-free text and UI animation kit driven by data attributes: split-word reveal on scroll, typewriter, scramble, seamless marquee, eased counters, magnetic button, draw-in underline. Accessible labels kept, everything static under reduced motion.
Install
logicpacks pack use web-development-public/text-ui-animationsget_pack web-development-public/text-ui-animationsThe second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.
Keys it needs (names only)
None.
Playbooks included
- Spec:
spec/SPEC.md(goal, steps, edge cases, don’ts) - Routes:
static-local - Checks: 1 in
outcome/checks.yaml - Code:
_shots/shot-1280-rm.png_shots/shot-1280.png_shots/shot-390-rm.png_shots/shot-390.pnganim.cssanim.jsdemo.cssindex.html - Tools: python3, playwright-python, chromium
Usage, last 8 weeks
New: no recorded use yet.
Purpose (from spec/SPEC.md)
Goal
Small, reusable motion that makes a page feel alive without a library: each effect is one data attribute, uses only transform/opacity (or text content), keeps the real text accessible, and turns off under prefers-reduced-motion.
Steps
- Copy
code/anim.cssandcode/anim.js(demo.css is only the showcase). - Mark up elements:
data-spliton a heading: words rise in when 30% visible (stagger 45 ms per word).data-type='["a","b"]'on a span: types and deletes words in a loop.data-scrambleon short text (< 40 chars): glyphs resolve left to right on enter.data-marqueewrapper with.marquee-tracklist: items are cloned once (clonesaria-hidden), loop at--speed, pause on hover/focus.data-count="1280"(+data-decimals,data-prefix,data-suffix): eased count-up on enter, ends on the exact value.data-magneticon a button: follows a fine pointer by 25-35%..ulon a link: underline draws in on hover/focus.
- Use at most 2-3 effects per page; reserve split reveal for the hero or section titles.
- Run the outcome checks.
Edge cases
- Screen readers: split and scramble set
aria-labelwith the real text; split pieces arearia-hidden. - SEO: the initial HTML contains the final text (counters render the final value under reduced motion; set the final value in HTML if you need it without JS).
- Marquee with few items on wide screens: add items until one copy is wider than the viewport.
- Fonts with ligatures in scramble:
font-variant-ligatures: noneavoids jitter. - Touch devices: magnetic effect is skipped (
pointer: fineonly).
Don'ts
- No animation on body paragraphs or long text.
- Do not animate letter-by-letter on headings longer than ~10 words (too slow, hurts LCP perception).
- Never loop the typewriter on critical copy (the CTA or the value proposition).
- Do not use the annnimate or prompt-motion code; they are reference only.