scroll-scrubbed-word-reveal — скилл для Claude Code: текст по мере
Скилл открывает слова в размеченном тексте по мере прокрутки страницы. Пригодится для заголовков, манифестов и онбординг-сообщений.
npx skills add MengTo/Skills --skill scroll-scrubbed-word-reveal -a claude-codeЧто делает scroll-scrubbed-word-reveal
Скилл берёт текст, который уже лежит в DOM, и разбивает его на слова-спаны. Дальше прогресс секции превращается в значение --word-progress для каждого слова, а из него интерполируются прозрачность, размытие и вертикальный сдвиг. Видимое состояние остаётся обычной типографикой, поэтому строка переносится свободно — под ширину контейнера, язык, зум и загрузку шрифтов.
Разметку скилл не ломает: ссылки, strong, em и акцентные спаны сохраняют семантику и стили. Обход идёт через TreeWalker, а не через textContent или innerHTML, так что вложенные элементы остаются на месте. Скрытые слова помечаются aria-hidden="true" только тогда, когда рядом есть целая доступная копия текста. Под prefers-reduced-motion: reduce все слова показываются сразу, без размытия, трансформаций и пиннинга.
Для точных старта, конца и общего таймлайна скилл советует GSAP ScrollTrigger с scrub; для отдельной секции хватит замера скролла и requestAnimationFrame. Скрытая прозрачность — от 0.12 до 0.3, размытие — от 4px до 10px. На размонтировании компонента нужно убить ScrollTrigger, снять слушатели скролла и resize, отменить кадры анимации и вернуть исходное поддерево — иначе после смены маршрута в DOM останутся чужие спаны.
Какие задачи решает
- раскрывать заголовок по мере прокрутки, не подменяя настоящий текст
- сохранить рабочие ссылки и курсив внутри анимированного абзаца
- учесть перенос строк при смене ширины и зума
- отключить анимацию для тех, кто просил уменьшить движение
- вернуть исходный DOM при размонтировании компонента
Примеры запросов агенту
- Сделай секцию с эффектом scroll-scrubbed-word-reveal для заголовка манифеста
- Разбей абзац на слова по мере скролла, ссылки и em не трогай
- Добавь prefers-reduced-motion: reduce — слова должны показываться сразу
Как установить scroll-scrubbed-word-reveal
1Через Skills CLI (Vercel)
npx skills add MengTo/Skills --skill scroll-scrubbed-word-reveal -a claude-code2Вручную: положить файлы
~/.claude/skills/scroll-scrubbed-word-reveal/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/scroll-scrubbed-word-reveal/
1Через Skills CLI (Vercel)
npx skills add MengTo/Skills --skill scroll-scrubbed-word-reveal -a codex2Вручную: положить файлы
.agents/skills/scroll-scrubbed-word-reveal/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add MengTo/Skills --skill scroll-scrubbed-word-reveal -a cursor2Вручную: положить файлы
.cursor/skills/scroll-scrubbed-word-reveal/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install MengTo/Skills scroll-scrubbed-word-reveal2Вручную: положить файлы
.github/skills/scroll-scrubbed-word-reveal/SKILL.md1Через Skills CLI (Vercel)
npx skills add MengTo/Skills --skill scroll-scrubbed-word-reveal -a gemini-cli2Командой платформы
gemini skills install https://github.com/MengTo/Skills --path agent-skills/web-design/scroll-scrubbed-word-revealВручную: положить файлы
.devin/skills/scroll-scrubbed-word-reveal/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add MengTo/Skills --skill scroll-scrubbed-word-reveal -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора144
Похожие
Рядом в теме «Фронтенд и UI»
Всё по теме «Фронтенд и UI» →Вопросы о scroll-scrubbed-word-reveal
Как установить scroll-scrubbed-word-reveal в Claude?
Выполните npx skills add MengTo/Skills --skill scroll-scrubbed-word-reveal -a claude-code. После этого файл скилла окажется в ~/.claude/skills/scroll-scrubbed-word-reveal/SKILL.md.
Что делает scroll-scrubbed-word-reveal?
Открывает слова в размеченном тексте по мере прокрутки: прогресс секции задаёт --word-progress, из которого считаются прозрачность, размытие и сдвиг. Ссылки, strong и em при этом сохраняют семантику.
Нужен ли GSAP для этого скилла?
Нет. GSAP ScrollTrigger с scrub советуют, когда нужны точные старт, конец и общий таймлайн. Для отдельной секции хватает замера скролла и requestAnimationFrame.
Исходный текст
SKILL.md · MIT
---
name: scroll-scrubbed-word-reveal
description: Reveal marked-up text word by word as scroll progress advances, while preserving semantic inline links, emphasis, responsive line wrapping, and reduced-motion readability. Use for headlines, quotes, manifestos, product statements, onboarding messages, or editorial passages where scrolling should pace comprehension rather than simulate typing.
---
# Scroll-Scrubbed Word Reveal
Make reading progress visible without replacing real text, breaking inline markup, or depending on a fixed line count.
## Prepare the text
1. Keep one untouched accessible text source in the DOM.
2. Walk text nodes with `TreeWalker`; do not flatten the container with `textContent` or `innerHTML`.
3. Skip `script`, `style`, form controls, and elements marked with `[data-no-split]`.
4. Replace only non-whitespace tokens with spans and preserve whitespace nodes exactly.
5. Mark generated spans `aria-hidden="true"` only when an equivalent unsplit accessible copy remains available.
Preferred structure:
```html
<p class="reveal" data-reveal>
Motion should <em>explain</em> the next state, not decorate it.
</p>
```
Avoid line-based splitting. Browser line wraps must remain free to change with container width, language, zoom, and font loading.
## Map scroll to words
Use section progress as the single source of truth:
```js
const reveal = Math.min(1, Math.max(0, progress));
const local = Math.min(1, Math.max(0, reveal * wordCount - index));
word.style.setProperty("--word-progress", local);
```
Interpolate hidden opacity, blur, and vertical offset from `--word-progress`. Keep the visible state identical to normal typography.
Use GSAP ScrollTrigger with `scrub` when precise starts, ends, refresh, or a shared timeline is needed. Use a dependency-free scroll measurement plus `requestAnimationFrame` for a standalone section.
## Set useful defaults
- Hidden opacity: `0.12–0.3`
- Blur: `4–10px`
- Vertical offset: `0.08–0.22em`
- Reveal span: `120–220%` of the viewport for a paragraph
- Direct word overlap: `10–30%`
- Easing: none for the scroll mapping; ease only the visual interpolation when needed
Expose the values as CSS custom properties. Scale the scroll span from text length rather than assuming one duration fits every passage.
## Preserve emphasis
- Let links, `strong`, `em`, marks, and accent spans keep their semantics and styling.
- Use inherited color by default; style accents on the original element, not on token indexes.
- Do not reveal essential links only on hover or after the reader has passed them.
- Re-split only when the source text changes. Responsive wrapping does not require rebuilding tokens.
- Store enough state to restore the original DOM during cleanup.
## Keep it readable
- Use real document flow; pin only when the copy and evidence justify a short deliberate reading beat.
- Do not use a typewriter cursor, random delays, or autoplay unless explicitly requested.
- Under `prefers-reduced-motion: reduce`, show every word immediately, remove blur and transforms, and remove any pinning.
- Keep screen-reader output natural and avoid announcing each word.
- Verify contrast in both the hidden and final states; hidden words may be quiet but the final text must meet the normal reading contract.
## Clean up
Kill ScrollTriggers, remove scroll and resize listeners, cancel animation frames, and restore the original marked-up subtree on route change or component unmount. Refresh measurements after fonts load if start or end positions depend on text geometry.
## Verify
Test inline links and emphasis, punctuation, repeated spaces, long words, 200% zoom, 390/768/1440 widths, content changes, forward and reverse scrolling, reduced motion, keyboard focus, screen-reader reading order, and teardown. The final DOM must still communicate the complete sentence with JavaScript disabled.
Use [demo/index.html](demo/index.html) as the working reference and [demo/PROMPT.md](demo/PROMPT.md) to recreate or remix it. Keep [REFERENCES.md](REFERENCES.md) as the links-only implementation source list.
© MengTo · MIT · MengTo/Skills