# 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.

- **Space:** web-development-public (https://github.com/Tech-Realm/space-web-development-public/tree/main/text-ui-animations)
- **Level:** L1 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3, playwright-python, chromium
- **Routes:** static-local; checks: 1
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use web-development-public/text-ui-animations` or MCP `get_pack web-development-public/text-ui-animations`
- **Files:** CHANGELOG.md, code/_shots/shot-1280-rm.png, code/_shots/shot-1280.png, code/_shots/shot-390-rm.png, code/_shots/shot-390.png, code/anim.css, code/anim.js, code/demo.css, code/index.html, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/fixtures/steps.json, outcome/results.json, pack.yaml, refs/refs.yaml, spec/SPEC.md, spec/source.md

## Purpose (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
1. Copy `code/anim.css` and `code/anim.js` (demo.css is only the showcase).
2. Mark up elements:
   - `data-split` on 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-scramble` on short text (< 40 chars): glyphs resolve left to right on enter.
   - `data-marquee` wrapper with `.marquee-track` list: items are cloned once (clones `aria-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-magnetic` on a button: follows a fine pointer by 25-35%.
   - `.ul` on a link: underline draws in on hover/focus.
3. Use at most 2-3 effects per page; reserve split reveal for the hero or section titles.
4. Run the outcome checks.

## Edge cases
- Screen readers: split and scramble set `aria-label` with the real text; split pieces are `aria-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: none` avoids jitter.
- Touch devices: magnetic effect is skipped (`pointer: fine` only).

## 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.



---

Canonical URL: https://logicpacks.io/packs/web-development-public/text-ui-animations

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
