@istmx/skills 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/README.md +49 -0
  2. package/bin/cli.js +251 -0
  3. package/istm/SKILL.md +65 -0
  4. package/istm-animate/SKILL.md +87 -0
  5. package/istm-animate/animations/animation_utils.md +280 -0
  6. package/istm-animate/animations/animations.md +220 -0
  7. package/istm-animate/animations/core_motion.md +250 -0
  8. package/istm-animate/animations/examples/README.md +29 -0
  9. package/istm-animate/animations/examples/nuxt/app/app.vue +3 -0
  10. package/istm-animate/animations/examples/nuxt/app/composables/useGSAP.ts +91 -0
  11. package/istm-animate/animations/examples/nuxt/app/pages/index.vue +55 -0
  12. package/istm-animate/animations/examples/nuxt/nuxt.config.ts +4 -0
  13. package/istm-animate/animations/examples/nuxt/package.json +18 -0
  14. package/istm-animate/animations/examples/react/App.jsx +46 -0
  15. package/istm-animate/animations/examples/react/index.html +12 -0
  16. package/istm-animate/animations/examples/react/main.jsx +9 -0
  17. package/istm-animate/animations/examples/react/package.json +21 -0
  18. package/istm-animate/animations/examples/react/vite.config.js +7 -0
  19. package/istm-animate/animations/examples/vanilla/index.html +33 -0
  20. package/istm-animate/animations/examples/vanilla/main.js +36 -0
  21. package/istm-animate/animations/examples/vue/app.vue +47 -0
  22. package/istm-animate/animations/examples/vue/index.html +15 -0
  23. package/istm-animate/animations/examples/vue/main.js +9 -0
  24. package/istm-animate/animations/examples/vue/package.json +19 -0
  25. package/istm-animate/animations/examples/vue/vite.config.js +7 -0
  26. package/istm-animate/animations/framework_motion.md +262 -0
  27. package/istm-animate/animations/motion.csv +17 -0
  28. package/istm-animate/animations/motion.md +11 -0
  29. package/istm-animate/animations/motion_catalog.json +226 -0
  30. package/istm-animate/animations/motion_performance.md +75 -0
  31. package/istm-animate/animations/motion_plugins.md +429 -0
  32. package/istm-animate/animations/react_animations.md +132 -0
  33. package/istm-animate/animations/scroll_trigger_effects.md +291 -0
  34. package/istm-animate/animations/timeline_sequencing.md +103 -0
  35. package/istm-architecture/SKILL.md +109 -0
  36. package/istm-architecture/frameworks/angular.csv +51 -0
  37. package/istm-architecture/frameworks/astro.csv +54 -0
  38. package/istm-architecture/frameworks/avalonia.csv +57 -0
  39. package/istm-architecture/frameworks/flutter.csv +53 -0
  40. package/istm-architecture/frameworks/javafx.csv +76 -0
  41. package/istm-architecture/frameworks/jetpack-compose.csv +53 -0
  42. package/istm-architecture/frameworks/laravel.csv +51 -0
  43. package/istm-architecture/frameworks/nextjs.csv +53 -0
  44. package/istm-architecture/frameworks/nuxtjs.csv +59 -0
  45. package/istm-architecture/frameworks/react-native.csv +52 -0
  46. package/istm-architecture/frameworks/react.csv +54 -0
  47. package/istm-architecture/frameworks/svelte.csv +54 -0
  48. package/istm-architecture/frameworks/swiftui.csv +51 -0
  49. package/istm-architecture/frameworks/uwp.csv +56 -0
  50. package/istm-architecture/frameworks/vue.csv +50 -0
  51. package/istm-architecture/frameworks/winui.csv +60 -0
  52. package/istm-architecture/frameworks/wpf.csv +57 -0
  53. package/istm-architecture/templates/agents.md +229 -0
  54. package/istm-architecture/templates/architecture.md +111 -0
  55. package/istm-architecture/templates/design.md +138 -0
  56. package/istm-architecture/templates/project-overview.md +215 -0
  57. package/istm-awwward-designer/SKILL.md +43 -0
  58. package/istm-awwward-designer/libraries/threejs.csv +54 -0
  59. package/istm-awwward-designer/references/accessibility.md +774 -0
  60. package/istm-awwward-designer/references/anim-anti-patterns.md +576 -0
  61. package/istm-awwward-designer/references/animation-map.md +166 -0
  62. package/istm-awwward-designer/references/animation-standards.md +86 -0
  63. package/istm-awwward-designer/references/anti-patterns.md +191 -0
  64. package/istm-awwward-designer/references/color-systems.md +604 -0
  65. package/istm-awwward-designer/references/css-performance.md +477 -0
  66. package/istm-awwward-designer/references/descender-safety.md +490 -0
  67. package/istm-awwward-designer/references/design-audit.md +93 -0
  68. package/istm-awwward-designer/references/font-loading.md +378 -0
  69. package/istm-awwward-designer/references/image-optimization.md +440 -0
  70. package/istm-awwward-designer/references/invention-gate.md +356 -0
  71. package/istm-awwward-designer/references/micro-interactions.md +825 -0
  72. package/istm-awwward-designer/references/page-transitions.md +365 -0
  73. package/istm-awwward-designer/references/performance-standards.md +79 -0
  74. package/istm-awwward-designer/references/quality-gate.md +103 -0
  75. package/istm-awwward-designer/references/responsive-design.md +778 -0
  76. package/istm-awwward-designer/references/scoring-guide.md +201 -0
  77. package/istm-awwward-designer/references/scroll-patterns.md +668 -0
  78. package/istm-awwward-designer/references/stitch-brief.md +124 -0
  79. package/istm-awwward-designer/references/tech-stack.md +204 -0
  80. package/istm-awwward-designer/references/technical-audit.md +133 -0
  81. package/istm-awwward-designer/references/technique-families.md +293 -0
  82. package/istm-awwward-designer/references/testing.md +535 -0
  83. package/istm-awwward-designer/references/text-animation.md +585 -0
  84. package/istm-awwward-designer/references/typography.md +504 -0
  85. package/istm-awwward-designer/references/usability-audit.md +108 -0
  86. package/istm-awwward-designer/references/visual-standards.md +97 -0
  87. package/istm-design/SKILL.md +98 -0
  88. package/istm-design/colors/color_theory.md +293 -0
  89. package/istm-design/colors/colors.csv +193 -0
  90. package/istm-design/colors/colors_catalog.json +4034 -0
  91. package/istm-design/colors/palette.json +21 -0
  92. package/istm-design/styles/design_system.md +288 -0
  93. package/istm-design/styles/html-tailwind.csv +56 -0
  94. package/istm-design/styles/nuxt-ui.csv +71 -0
  95. package/istm-design/styles/product_design.md +55 -0
  96. package/istm-design/styles/shadcn.csv +61 -0
  97. package/istm-design/styles/style.md +12 -0
  98. package/istm-design/styles/styles.csv +85 -0
  99. package/istm-design/styles/styles_catalog.json +2018 -0
  100. package/istm-design/styles/ui-reasoning.csv +162 -0
  101. package/istm-design/styles/uno.csv +60 -0
  102. package/istm-design/typography/font_and_font.md +10 -0
  103. package/istm-design/typography/google-fonts.csv +1924 -0
  104. package/istm-design/typography/sans_serif_fonts.md +112 -0
  105. package/istm-design/typography/typography.csv +75 -0
  106. package/istm-design/typography/typography_catalog.json +964 -0
  107. package/istm-design/ux/app-interface.csv +31 -0
  108. package/istm-design/ux/charts.csv +26 -0
  109. package/istm-design/ux/icons.csv +106 -0
  110. package/istm-design/ux/landing.csv +35 -0
  111. package/istm-design/ux/products.csv +193 -0
  112. package/istm-design/ux/react-performance.csv +45 -0
  113. package/istm-design/ux/responsive_rules.md +62 -0
  114. package/istm-design/ux/storytelling.md +47 -0
  115. package/istm-design/ux/ux-guidelines.csv +100 -0
  116. package/istm-design/ux/ux_guidelines.json +1190 -0
  117. package/istm-system-design/SKILL.md +88 -0
  118. package/istm-system-design/principles/01-architecture-patterns.md +24 -0
  119. package/istm-system-design/principles/02-database-selection.md +32 -0
  120. package/istm-system-design/principles/03-api-design.md +25 -0
  121. package/istm-system-design/principles/04-authentication-security.md +23 -0
  122. package/istm-system-design/principles/05-caching-performance.md +21 -0
  123. package/istm-system-design/principles/06-asynchronous-processing.md +17 -0
  124. package/istm-system-design/principles/07-infrastructure-deployment.md +22 -0
  125. package/istm-system-design/principles/08-low-level-design.md +35 -0
  126. package/istm-system-design/principles/09-state-management.md +14 -0
  127. package/istm-system-design/principles/10-error-handling-and-logging.md +26 -0
  128. package/istm-system-design/principles/11-testing-strategy.md +18 -0
  129. package/istm-system-design/principles/12-seo-and-web-vitals.md +18 -0
  130. package/istm-system-design/stacks/SETUP.md +82 -0
  131. package/istm-system-design/stacks/STACK.md +67 -0
  132. package/istm-system-design/stacks/WORKFLOW.md +84 -0
  133. package/istm-system-design/templates/api-route.ts.template +32 -0
  134. package/istm-system-design/templates/migrations.md.template +30 -0
  135. package/istm-system-design/templates/schema.drizzle.ts.template +17 -0
  136. package/istm-system-design/templates/schema.prisma.template +28 -0
  137. package/istm-system-design/templates/trpc-router.ts.template +22 -0
  138. package/istm-system-design/templates/zod-validators.ts.template +14 -0
  139. package/istm-workflow/istm-audit/SKILL.md +108 -0
  140. package/istm-workflow/istm-audit/agent-prompt.md +393 -0
  141. package/istm-workflow/istm-audit/agents/openai.yaml +7 -0
  142. package/istm-workflow/istm-audit/modes/area.md +19 -0
  143. package/istm-workflow/istm-audit/modes/gapfill.md +12 -0
  144. package/istm-workflow/istm-audit/modes/greenfield.md +24 -0
  145. package/istm-workflow/istm-audit/modes/tool-skills.md +39 -0
  146. package/istm-workflow/istm-audit/modes/whole-repo.md +5 -0
  147. package/istm-workflow/istm-audit/patterns/clean-architecture.md +15 -0
  148. package/istm-workflow/istm-audit/patterns/domain-driven.md +16 -0
  149. package/istm-workflow/istm-audit/patterns/functional.md +16 -0
  150. package/istm-workflow/istm-audit/patterns/solid-oop.md +17 -0
  151. package/istm-workflow/istm-check/SKILL.md +52 -0
  152. package/istm-workflow/istm-check/agents/openai.yaml +7 -0
  153. package/istm-workflow/istm-check/modes/review.md +156 -0
  154. package/istm-workflow/istm-check/modes/verify.md +197 -0
  155. package/istm-workflow/istm-check/review-agent-prompt.md +57 -0
  156. package/istm-workflow/istm-check/review-guide.md +133 -0
  157. package/istm-workflow/istm-craft/SKILL.md +37 -0
  158. package/istm-workflow/istm-craft/agent-modes/architecture.md +73 -0
  159. package/istm-workflow/istm-craft/agent-modes/cross-cutting.md +65 -0
  160. package/istm-workflow/istm-craft/agent-modes/enhancement.md +45 -0
  161. package/istm-workflow/istm-craft/agent-modes/feature.md +85 -0
  162. package/istm-workflow/istm-craft/agent-prompt.md +249 -0
  163. package/istm-workflow/istm-craft/agents/openai.yaml +7 -0
  164. package/istm-workflow/istm-craft/internal/after-subagent.md +90 -0
  165. package/istm-workflow/istm-craft/internal/design-conversation.md +140 -0
  166. package/istm-workflow/istm-craft/internal/tool-discovery.md +58 -0
  167. package/istm-workflow/istm-craft/spec-template.md +278 -0
  168. package/istm-workflow/istm-debug/SKILL.md +102 -0
  169. package/istm-workflow/istm-debug/agents/openai.yaml +7 -0
  170. package/istm-workflow/istm-develop/SKILL.md +144 -0
  171. package/istm-workflow/istm-develop/agents/openai.yaml +7 -0
  172. package/istm-workflow/istm-develop/checklist.md +95 -0
  173. package/istm-workflow/istm-develop/flow/build.md +133 -0
  174. package/istm-workflow/istm-develop/flow/git.md +34 -0
  175. package/istm-workflow/istm-develop/logical-guide.md +99 -0
  176. package/istm-workflow/istm-develop/ui/existing.md +23 -0
  177. package/istm-workflow/istm-develop/ui/generate.md +131 -0
  178. package/istm-workflow/istm-develop/ui/image.md +41 -0
  179. package/istm-workflow/istm-develop/ui/implementation.md +281 -0
  180. package/istm-workflow/istm-develop/ui/mcp.md +11 -0
  181. package/istm-workflow/istm-develop/ui-guide.md +164 -0
  182. package/istm-workflow/istm-document/SKILL.md +123 -0
  183. package/istm-workflow/istm-document/agent-prompt.md +57 -0
  184. package/istm-workflow/istm-document/agents/openai.yaml +7 -0
  185. package/istm-workflow/istm-document/templates/changelog.md +54 -0
  186. package/istm-workflow/istm-document/templates/postmortem.md +58 -0
  187. package/istm-workflow/istm-document/templates/pr.md +43 -0
  188. package/istm-workflow/istm-document/templates/release-note.md +41 -0
  189. package/istm-workflow/istm-scope/SKILL.md +100 -0
  190. package/istm-workflow/istm-scope/agents/openai.yaml +7 -0
  191. package/istm-workflow/istm-scope/approaches/facade.md +33 -0
  192. package/istm-workflow/istm-scope/approaches/journey.md +31 -0
  193. package/istm-workflow/istm-scope/approaches/skateboard.md +33 -0
  194. package/istm-workflow/istm-scope/approaches/tracer-bullet.md +34 -0
  195. package/istm-workflow/istm-scope/modes/add.md +14 -0
  196. package/istm-workflow/istm-scope/modes/plan-brownfield.md +11 -0
  197. package/istm-workflow/istm-scope/modes/plan-greenfield.md +20 -0
  198. package/istm-workflow/istm-scope/modes/plan-monorepo.md +8 -0
  199. package/istm-workflow/istm-scope/modes/plan.md +120 -0
  200. package/istm-workflow/istm-scope/modes/replan.md +13 -0
  201. package/istm-workflow/istm-scope/scope-template.md +148 -0
  202. package/istm-workflow/istm-sync/SKILL.md +166 -0
  203. package/istm-workflow/istm-sync/agent-prompt.md +211 -0
  204. package/istm-workflow/istm-sync/agents/openai.yaml +7 -0
  205. package/istm-workflow/istm-test/SKILL.md +233 -0
  206. package/istm-workflow/istm-test/agent-prompt.md +62 -0
  207. package/istm-workflow/istm-test/agents/openai.yaml +7 -0
  208. package/istm-workflow/istm-test/modes/setup.md +97 -0
  209. package/istm-workflow/istm-test/writing-guide.md +196 -0
  210. package/package.json +35 -0
@@ -0,0 +1,585 @@
1
+ # Text Animation — Deep Dive
2
+
3
+ Complete reference for animating text with SplitType, variable fonts,
4
+ masked reveals, and distortion effects. Includes the critical DESCENDER
5
+ SAFETY PROTOCOL.
6
+
7
+ ---
8
+
9
+ ## SplitType Integration
10
+
11
+ SplitType splits text into `char`, `word`, and/or `line` elements that can
12
+ be animated individually. It's the foundation of all headline animations.
13
+
14
+ ### Installation & Setup
15
+
16
+ ```bash
17
+ bun add split-type
18
+ ```
19
+
20
+ ```js
21
+ import SplitType from 'split-type';
22
+
23
+ // Initialize — splits text into <span> elements
24
+ const title = new SplitType('.headline', {
25
+ types: 'chars, words, lines', // specify what to split
26
+ tagName: 'span',
27
+ });
28
+
29
+ // Results:
30
+ // <h1 class="headline" data-split="lines">
31
+ // <div class="split-line"> ← line wrapper
32
+ // <span class="split-word"> ← word wrapper
33
+ // <span class="split-char">H</span> ← individual chars
34
+ // <span class="split-char">e</span>
35
+ // ...
36
+ // </span>
37
+ // </div>
38
+ // ...
39
+ // </h1>
40
+ ```
41
+
42
+ ### Basic Char Reveal
43
+
44
+ ```js
45
+ // Fade-up reveal with stagger — the classic headline animation
46
+ const title = new SplitType('.hero-title', { types: 'chars, words' });
47
+
48
+ gsap.from(title.chars, {
49
+ y: 80,
50
+ opacity: 0,
51
+ rotateX: -90,
52
+ transformOrigin: '50% 100%',
53
+ duration: 0.8,
54
+ ease: 'power4.out',
55
+ stagger: 0.03, // 30ms between chars
56
+ scrollTrigger: {
57
+ trigger: '.hero-title',
58
+ start: 'top 80%',
59
+ },
60
+ });
61
+ ```
62
+
63
+ ### Word-by-Word Reveal
64
+
65
+ ```js
66
+ // Words reveal sequentially — more readable than chars for body headlines
67
+ const subhead = new SplitType('.section-title', { types: 'words' });
68
+
69
+ gsap.from(subhead.words, {
70
+ y: 40,
71
+ opacity: 0,
72
+ duration: 0.6,
73
+ ease: 'power4.out',
74
+ stagger: 0.1, // 100ms between words
75
+ scrollTrigger: {
76
+ trigger: '.section-title',
77
+ start: 'top 80%',
78
+ },
79
+ });
80
+ ```
81
+
82
+ ### Line-by-Line Reveal
83
+
84
+ ```js
85
+ // Lines reveal with clip-path — cinematic reveal effect
86
+ const hero = new SplitType('.hero-headline', { types: 'lines' });
87
+
88
+ gsap.from(hero.lines, {
89
+ clipPath: 'inset(0 0 100% 0)',
90
+ duration: 1.0,
91
+ ease: 'power4.out',
92
+ stagger: 0.15,
93
+ scrollTrigger: {
94
+ trigger: '.hero-headline',
95
+ start: 'top 80%',
96
+ },
97
+ });
98
+ ```
99
+
100
+ ### SplitType + GSAP Timeline (Choreographed)
101
+
102
+ ```js
103
+ // Three-phase reveal: chars → lines wipe → opacity settle
104
+ const headline = new SplitType('.reveal-headline', { types: 'chars, lines' });
105
+
106
+ const tl = gsap.timeline({
107
+ scrollTrigger: {
108
+ trigger: '.reveal-headline',
109
+ start: 'top 80%',
110
+ },
111
+ });
112
+
113
+ // Phase 1: Characters fade up
114
+ tl.from(headline.chars, {
115
+ y: 60,
116
+ opacity: 0,
117
+ rotateZ: 5,
118
+ duration: 0.6,
119
+ ease: 'power4.out',
120
+ stagger: 0.02,
121
+ });
122
+
123
+ // Phase 2: Lines "settle" with a slight scale
124
+ tl.from(headline.lines, {
125
+ scaleY: 1.1,
126
+ transformOrigin: 'bottom',
127
+ duration: 0.4,
128
+ ease: 'power2.out',
129
+ }, '-=0.2');
130
+
131
+ // Phase 3: Full opacity pass to clean up any artifacts
132
+ tl.to(headline.chars, {
133
+ opacity: 1,
134
+ y: 0,
135
+ rotateZ: 0,
136
+ duration: 0.3,
137
+ ease: 'power2.out',
138
+ }, '-=0.1');
139
+ ```
140
+
141
+ ### SplitType Cleanup (Required!)
142
+
143
+ ```js
144
+ // After page transition or component unmount
145
+ function destroySplit() {
146
+ document.querySelectorAll('.split-type').forEach(el => {
147
+ el.revert(); // SplitType method to restore original text
148
+ });
149
+ }
150
+
151
+ // Listen for page leave
152
+ document.addEventListener('pageLeave', destroySplit);
153
+ ```
154
+
155
+ ---
156
+
157
+ ## Variable Font Animation
158
+
159
+ Variable fonts expose axes (like `wght` for weight) that can be animated
160
+ smoothly between values. Powerful for display text, no need for multiple font files.
161
+
162
+ ### Weight Axis Animation (wght)
163
+
164
+ ```js
165
+ // Animate weight from thin to bold on scroll
166
+ const title = document.querySelector('.var-font-title');
167
+
168
+ // CSS variable font variation settings
169
+ title.style.fontVariationSettings = '"wght" 100';
170
+
171
+ gsap.to(title, {
172
+ fontVariationSettings: '"wght" 900',
173
+ ease: 'none',
174
+ scrollTrigger: {
175
+ trigger: title,
176
+ start: 'top center',
177
+ end: 'bottom center',
178
+ scrub: 1, // smooth interpolation tied to scroll
179
+ },
180
+ });
181
+ ```
182
+
183
+ ```css
184
+ /* CSS setup for variable font */
185
+ @font-face {
186
+ font-family: 'Inter';
187
+ src: url('/fonts/Inter-Variable.woff2') format('woff2-variations');
188
+ font-weight: 100 900; /* define the range */
189
+ }
190
+
191
+ .var-font-title {
192
+ font-family: 'Inter', sans-serif;
193
+ font-variation-settings: 'wght' 400;
194
+ font-weight: 400; /* also set font-weight as fallback */
195
+ }
196
+ ```
197
+
198
+ ### Width Axis Animation (wdth)
199
+
200
+ ```js
201
+ // Condensed ↔ expanded — great for dramatic headlines
202
+ gsap.to('.expanded-text', {
203
+ fontVariationSettings: '"wdth" 100', // condensed
204
+ duration: 1,
205
+ ease: 'power2.inOut',
206
+ scrollTrigger: {
207
+ trigger: '.expanded-text',
208
+ start: 'top 80%',
209
+ },
210
+ });
211
+ ```
212
+
213
+ ### Multiple Axes Combined
214
+
215
+ ```js
216
+ // Simultaneous weight + width animation
217
+ gsap.to('.morph-text', {
218
+ fontVariationSettings: '"wght" 900, "wdth" 75, "slnt" -10',
219
+ duration: 0.8,
220
+ ease: 'power4.out',
221
+ scrollTrigger: {
222
+ trigger: '.morph-text',
223
+ start: 'top 80%',
224
+ },
225
+ });
226
+ ```
227
+
228
+ ### Variable Font Cheat Sheet
229
+
230
+ | Axis Tag | Property | Common Range | Use |
231
+ |----------|----------|-------------|-----|
232
+ | `wght` | font-weight | 100–900 | Boldness, emphasis |
233
+ | `wdth` | font-stretch | 75–125 | Condensed/expanded |
234
+ | `ital` | font-style | 0–1 | Italic transition |
235
+ | `slnt` | font-style slant | -12–0 | Slant angle |
236
+ | `opsz` | optical sizing | 8–144 | Detail scaling |
237
+ | `GRAD` | grade | -50–150 | Weight without size change |
238
+
239
+ ---
240
+
241
+ ## Masked Text Reveals
242
+
243
+ Text masks create dramatic reveals where content appears through a clipping shape.
244
+ Two main techniques: `clip-path` (GPU-accelerated) and `mask-image` (CSS gradients).
245
+
246
+ ### Clip-Path Masked Reveal
247
+
248
+ ```js
249
+ // Text wipes in from below — the most common masked reveal
250
+ const title = document.querySelector('.masked-title');
251
+
252
+ gsap.from('.masked-title', {
253
+ clipPath: 'inset(0 0 100% 0)', // fully clipped from bottom
254
+ duration: 0.8,
255
+ ease: 'power4.out',
256
+ scrollTrigger: {
257
+ trigger: '.masked-title',
258
+ start: 'top 80%',
259
+ },
260
+ });
261
+ ```
262
+
263
+ ```css
264
+ /* With a parent container as the mask */
265
+ .masked-container {
266
+ overflow: hidden;
267
+ }
268
+
269
+ .masked-title {
270
+ /* No overflow clipping here — container handles it */
271
+ }
272
+ ```
273
+
274
+ ### Gradient Mask Reveal
275
+
276
+ ```css
277
+ /* Text fades in through a gradient mask */
278
+ .masked-text {
279
+ mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
280
+ mask-size: 100% 300%;
281
+ mask-position: 0 0;
282
+ animation: reveal-mask 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
283
+ }
284
+
285
+ @keyframes reveal-mask {
286
+ to {
287
+ mask-position: 0 100%;
288
+ }
289
+ }
290
+ ```
291
+
292
+ ### SVG Text Mask
293
+
294
+ ```html
295
+ <svg class="svg-mask" viewBox="0 0 400 100" preserveAspectRatio="none">
296
+ <defs>
297
+ <clipPath id="textClip">
298
+ <text x="0" y="80" font-size="80" font-family="sans-serif">
299
+ MASKED
300
+ </text>
301
+ </clipPath>
302
+ </defs>
303
+ <rect class="mask-rect" clip-path="url(#textClip)" fill="#000" />
304
+ </svg>
305
+ ```
306
+
307
+ ```js
308
+ // Animate the rect reveal
309
+ gsap.to('.mask-rect', {
310
+ scaleX: 0,
311
+ transformOrigin: 'right',
312
+ duration: 1.2,
313
+ ease: 'power4.out',
314
+ scrollTrigger: {
315
+ trigger: '.svg-mask',
316
+ start: 'top 80%',
317
+ },
318
+ });
319
+ ```
320
+
321
+ ---
322
+
323
+ ## Text Distortion Effects
324
+
325
+ High-impact effects for hero sections and key moments. Use sparingly —
326
+ they can be distracting in regular content.
327
+
328
+ ### Character Scramble
329
+
330
+ ```js
331
+ // Characters rapidly scramble through random chars before settling
332
+ function scrambleText(element, finalText, duration = 0.8) {
333
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
334
+ const finalChars = finalText.split('');
335
+ let iteration = 0;
336
+
337
+ const interval = setInterval(() => {
338
+ element.textContent = finalChars.map((char, index) => {
339
+ if (index < iteration) return finalChars[index];
340
+ return chars[Math.floor(Math.random() * chars.length)];
341
+ }).join('');
342
+
343
+ iteration += 1 / (duration * 30); // frames based on duration
344
+
345
+ if (iteration >= finalChars.length) {
346
+ element.textContent = finalText;
347
+ clearInterval(interval);
348
+ }
349
+ }, 1000 / 60); // 60fps
350
+ }
351
+
352
+ // Scramble on scroll
353
+ scrambleText(document.querySelector('.scramble'), 'SCRAMBLED TEXT', 1.2);
354
+
355
+ gsap.from('.scramble', {
356
+ opacity: 0,
357
+ duration: 0.3,
358
+ scrollTrigger: {
359
+ trigger: '.scramble',
360
+ start: 'top 80%',
361
+ onEnter: () => scrambleText(document.querySelector('.scramble'), 'SCRAMBLED TEXT', 1.0),
362
+ },
363
+ });
364
+ ```
365
+
366
+ ### Text Wave Effect
367
+
368
+ ```js
369
+ // Characters move in a wave pattern — great for hover or scroll
370
+ const title = new SplitType('.wave-text', { types: 'chars' });
371
+
372
+ gsap.to(title.chars, {
373
+ y: -20,
374
+ rotateZ: 5,
375
+ duration: 0.4,
376
+ ease: 'power2.out',
377
+ stagger: {
378
+ each: 0.03,
379
+ from: 'center', // start from center, ripple outward
380
+ },
381
+ scrollTrigger: {
382
+ trigger: '.wave-text',
383
+ start: 'top 80%',
384
+ },
385
+ });
386
+ ```
387
+
388
+ ### Glitch Effect
389
+
390
+ ```js
391
+ // Random offset + clip displacement — the classic digital glitch
392
+ function glitchText(element, iterations = 10) {
393
+ const tl = gsap.timeline({
394
+ onComplete: () => {
395
+ gsap.set(element, { x: 0, skewX: 0, clipPath: 'none' });
396
+ },
397
+ });
398
+
399
+ for (let i = 0; i < iterations; i++) {
400
+ tl.to(element, {
401
+ x: () => Math.random() * 20 - 10,
402
+ skewX: () => Math.random() * 10 - 5,
403
+ duration: 0.05,
404
+ ease: 'none',
405
+ })
406
+ .to(element, {
407
+ clipPath: `inset(${Math.random() * 20}% 0)`,
408
+ duration: 0.02,
409
+ }, '<')
410
+ .to(element, {
411
+ x: 0,
412
+ skewX: 0,
413
+ clipPath: 'none',
414
+ duration: 0.01,
415
+ });
416
+ }
417
+
418
+ return tl;
419
+ }
420
+
421
+ // Trigger on section enter
422
+ glitchText(document.querySelector('.glitch-text'));
423
+
424
+ gsap.from('.glitch-text', {
425
+ scrollTrigger: {
426
+ trigger: '.glitch-text',
427
+ start: 'top 80%',
428
+ onEnter: () => glitchText(document.querySelector('.glitch-text')),
429
+ },
430
+ });
431
+ ```
432
+
433
+ ### Per-word Fade + Scale
434
+
435
+ ```js
436
+ // Each word fades and scales independently — elegant, readable
437
+ const body = new SplitType('.body-reveal', { types: 'words' });
438
+
439
+ gsap.from(body.words, {
440
+ opacity: 0,
441
+ scale: 0.9,
442
+ duration: 0.5,
443
+ ease: 'power4.out',
444
+ stagger: 0.05,
445
+ scrollTrigger: {
446
+ trigger: '.body-reveal',
447
+ start: 'top 85%',
448
+ },
449
+ });
450
+ ```
451
+
452
+ ---
453
+
454
+ ## DESCENDER SAFETY PROTOCOL
455
+
456
+ **⚠️ CRITICAL — This is a hard stop. All violations are auto-fails.**
457
+
458
+ Display text (>48px font-size) with descenders (g, y, p, q, j) will visually
459
+ clip during clip-path animations. The fix is two-part and mandatory.
460
+
461
+ ### The Problem
462
+
463
+ ```
464
+ Font: Display text, 72px
465
+ Characters: "Amazing"
466
+ Problem: The 'g' in "Amazing" has a descender that extends below the baseline.
467
+ During clip-path animation (inset from bottom), the bottom of 'g'
468
+ gets clipped even though the container is tall enough.
469
+ ```
470
+
471
+ ### The Fix: Two-Part
472
+
473
+ **Part 1: CSS — overflow + padding**
474
+
475
+ ```css
476
+ /* MANDATORY for any display text >48px that uses scroll animations */
477
+ .display-text {
478
+ overflow: visible; /* Allow descenders to render outside bounds */
479
+ padding-bottom: 0.18em; /* Minimum clearance — measure actual descender per font via Canvas API */
480
+ will-change: transform; /* Hint GPU for transform animations */
481
+ }
482
+
483
+ /* Container also needs overflow visible */
484
+ .text-container {
485
+ overflow: visible;
486
+ position: relative; /* Establish stacking context */
487
+ }
488
+
489
+ /* For clip-path reveals: the parent must NOT clip */
490
+ .clip-parent {
491
+ overflow: visible; /* NOT hidden! */
492
+ }
493
+ ```
494
+
495
+ **Part 2: HTML — Structure**
496
+
497
+ ```html
498
+ <!-- WRONG: Clip will happen -->
499
+ <div style="overflow: hidden; height: 80px;">
500
+ <h1 class="headline">Amazing Logo</h1>
501
+ </div>
502
+
503
+ <!-- CORRECT: Descenders escape upward -->
504
+ <div class="text-container">
505
+ <h1 class="display-text headline">Amazing Logo</h1>
506
+ </div>
507
+ ```
508
+
509
+ ### Full Example: Descender-Safe Scroll Reveal
510
+
511
+ ```css
512
+ /* CSS */
513
+ .hero-title-wrap {
514
+ overflow: visible;
515
+ padding-bottom: 0.18em; /* Minimum clearance for descenders — measure per font */
516
+ }
517
+
518
+ .hero-title {
519
+ font-size: 80px; /* >48px — triggers descender safety */
520
+ overflow: visible;
521
+ font-family: 'Display Font', sans-serif;
522
+ }
523
+ ```
524
+
525
+ ```js
526
+ // JS — clip-path reveal on display text
527
+ gsap.from('.hero-title', {
528
+ y: 100,
529
+ opacity: 0,
530
+ duration: 1.0,
531
+ ease: 'power4.out',
532
+ scrollTrigger: {
533
+ trigger: '.hero-title-wrap',
534
+ start: 'top 80%',
535
+ },
536
+ });
537
+
538
+ // If using clip-path on the wrapper:
539
+ gsap.from('.hero-title-wrap', {
540
+ clipPath: 'inset(0 0 100% 0)', // Safe because of overflow:visible + padding
541
+ duration: 0.9,
542
+ ease: 'power4.out',
543
+ scrollTrigger: {
544
+ trigger: '.hero-title-wrap',
545
+ start: 'top 80%',
546
+ },
547
+ });
548
+ ```
549
+
550
+ ### Descender Character Reference
551
+
552
+ Characters that extend below baseline (need extra padding):
553
+ ```
554
+ Lowercase: g, y, p, q, j
555
+ Some fonts: f (at large sizes), comma, semicolon, etc.
556
+ ```
557
+
558
+ Characters safe from clipping:
559
+ ```
560
+ Uppercase: A-Z (most fonts)
561
+ Lowercase: a, b, c, d, e, h, i, k, l, m, n, o, r, s, t, u, v, w, x, z
562
+ Numbers: 0-9
563
+ Symbols: Most
564
+ ```
565
+
566
+ ### Descender Safety Checklist
567
+
568
+ - [ ] All text elements >48px have `overflow: visible`
569
+ - [ ] All text elements >48px have `padding-bottom: 0.18em` minimum (measure per font via Canvas API)
570
+ - [ ] Parent containers of animated text have `overflow: visible`
571
+ - [ ] SplitType wrapper elements have `overflow: visible`
572
+ - [ ] Line wrapper elements from SplitType have `overflow: visible`
573
+ - [ ] Clip-path reveals tested with descender-heavy text (e.g., "Typography")
574
+ - [ ] Tested at multiple viewport widths — descenders can shift with fluid type
575
+
576
+ ---
577
+
578
+ ## Text Animation Performance
579
+
580
+ - SplitType creates many `<span>` elements. For 100-char headlines, that's ~100 DOM nodes.
581
+ Use `will-change: transform` on char/word elements only during animation.
582
+ - Variable font animations are cheap — they're just CSS property changes.
583
+ - Avoid animating `font-size` directly. Use `transform: scale()` instead.
584
+ - For long-form text (>200 words), consider animating paragraphs as units, not words.
585
+ - Use `content-visibility: auto` on off-screen text sections to skip rendering.