@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,47 @@
1
+ /**
2
+ * Minimal GSAP Vue 3 example — follows gsap-frameworks skill: gsap.context, scope, cleanup.
3
+ * Scoped selectors via context; automatic revert on unmount.
4
+ */
5
+ <script setup>
6
+ import { ref, onMounted, onUnmounted } from "vue";
7
+ import { gsap } from "gsap";
8
+
9
+ const container = ref(null);
10
+ let ctx;
11
+
12
+ onMounted(() => {
13
+ ctx = gsap.context(() => {
14
+ // Simple tween — moves the box right and fades it in
15
+ gsap.to(".box", { x: 100, autoAlpha: 1, duration: 0.6, ease: "power2" });
16
+
17
+ // Stagger animation on .item elements (scoped to container)
18
+ gsap.from(".item", { autoAlpha: 0, y: 20, stagger: 0.1 });
19
+
20
+ // ScrollTrigger timeline on the tall section
21
+ gsap.timeline({
22
+ scrollTrigger: { trigger: ".scroll-section", start: "top center", end: "bottom center", scrub: true },
23
+ }).to(".scroll-box", { x: 200, rotation: 360 });
24
+ }, container.value); // scope — all selectors resolve inside container
25
+ });
26
+
27
+ onUnmounted(() => {
28
+ ctx?.revert(); // cleanup: reverts all GSAP animations created in this context
29
+ });
30
+ </script>
31
+
32
+ <template>
33
+ <div ref="container" :style="{ padding: '2rem' }">
34
+ <h1>GSAP Vue 3 — gsap.context + scope + cleanup</h1>
35
+
36
+ <div class="box" :style="{ width: '80px', height: '80px', background: '#0fa', borderRadius: '8px', marginBottom: '1rem', visibility: 'hidden' }" />
37
+
38
+ <div class="item" :style="{ margin: '0.5rem 0' }">Item 1</div>
39
+ <div class="item" :style="{ margin: '0.5rem 0' }">Item 2</div>
40
+ <div class="item" :style="{ margin: '0.5rem 0' }">Item 3</div>
41
+
42
+ <div class="scroll-section" :style="{ height: '150vh', marginTop: '2rem', background: '#f0f0f0', padding: '1rem' }">
43
+ <p>Scroll down to trigger the timeline</p>
44
+ <div class="scroll-box" :style="{ width: '60px', height: '60px', background: '#f0a', borderRadius: '8px', marginTop: '1rem' }" />
45
+ </div>
46
+ </div>
47
+ </template>
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>GSAP Vue 3 — gsap.context + scope + cleanup</title>
8
+ </head>
9
+
10
+ <body>
11
+ <div id="app"></div>
12
+ <script type="module" src="/main.js"></script>
13
+ </body>
14
+
15
+ </html>
@@ -0,0 +1,9 @@
1
+ import { createApp } from "vue";
2
+ import { gsap } from "gsap";
3
+ import { ScrollTrigger } from "gsap/ScrollTrigger";
4
+ import App from "./App.vue";
5
+
6
+ // Register all the GSAP Plugins you want only once at this top level file
7
+ gsap.registerPlugin(ScrollTrigger);
8
+
9
+ createApp(App).mount("#app");
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "gsap-vue-example",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "vite build",
9
+ "preview": "vite preview"
10
+ },
11
+ "dependencies": {
12
+ "gsap": "^3.15.0",
13
+ "vue": "^3.5.32"
14
+ },
15
+ "devDependencies": {
16
+ "@vitejs/plugin-vue": "^6.0.5",
17
+ "vite": "^8.0.4"
18
+ }
19
+ }
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from 'vite';
2
+ import vue from '@vitejs/plugin-vue';
3
+
4
+ // https://vite.dev/config/
5
+ export default defineConfig({
6
+ plugins: [vue()],
7
+ });
@@ -0,0 +1,262 @@
1
+ # Zenix Multi-Framework Animation Rules
2
+
3
+ # GSAP with Vue, Svelte, and Other Frameworks
4
+
5
+ ## When to Use This Skill
6
+
7
+ Apply when writing or reviewing GSAP code in Vue (or Nuxt), Svelte (or SvelteKit), or other component frameworks that use a lifecycle (mounted/unmounted). For **React** specifically, use **gsap-react** (useGSAP hook, gsap.context()).
8
+
9
+ **Related skills:** For tweens and timelines use **gsap-core** and **gsap-timeline**; for scroll-based animation use **gsap-scrolltrigger**; for React use **gsap-react**.
10
+
11
+ ## Principles (All Frameworks)
12
+
13
+ - **Create** tweens and ScrollTriggers **after** the component’s DOM is available (e.g. onMounted, onMount).
14
+ - **Kill or revert** them in the **unmount** (or equivalent) cleanup so nothing runs on detached nodes and there are no leaks.
15
+ - **Scope selectors** to the component root so `.box` and similar only match elements inside that component, not the rest of the page.
16
+
17
+ ## Vue 3 (Composition API)
18
+
19
+ See `examples/vue/` for a runnable Vite + Vue 3 project demonstrating these patterns.
20
+
21
+ Use **onMounted** to run GSAP after the component is in the DOM. Use **onUnmounted** to clean up.
22
+
23
+ ```javascript
24
+ import { onMounted, onUnmounted, ref } from "vue";
25
+ import { gsap } from "gsap";
26
+ import { ScrollTrigger } from "gsap/ScrollTrigger";
27
+ gsap.registerPlugin(ScrollTrigger); // once per app, e.g. in main.js
28
+
29
+ export default {
30
+ setup() {
31
+ const container = ref(null);
32
+ let ctx;
33
+
34
+ onMounted(() => {
35
+ if (!container.value) return;
36
+ ctx = gsap.context(() => {
37
+ gsap.to(".box", { x: 100, duration: 0.6 });
38
+ gsap.from(".item", { autoAlpha: 0, y: 20, stagger: 0.1 });
39
+ }, container.value);
40
+ });
41
+
42
+ onUnmounted(() => {
43
+ ctx?.revert();
44
+ });
45
+
46
+ return { container };
47
+ },
48
+ };
49
+ ```
50
+
51
+ - ✅ **gsap.context(scope)** — pass the container ref (e.g. `container.value`) as the second argument so selectors like `.item` are scoped to that root. All animations and ScrollTriggers created inside the callback are tracked and reverted when **ctx.revert()** is called.
52
+ - ✅ **onUnmounted** — always call **ctx.revert()** so tweens and ScrollTriggers are killed and inline styles reverted.
53
+
54
+ ## Vue 3 (script setup)
55
+
56
+ Same idea with `<script setup>` and refs:
57
+
58
+ ```javascript
59
+ <script setup>
60
+ import { onMounted, onUnmounted, ref } from "vue";
61
+ import { gsap } from "gsap";
62
+ import { ScrollTrigger } from "gsap/ScrollTrigger";
63
+
64
+ const container = ref(null);
65
+ let ctx;
66
+
67
+ onMounted(() => {
68
+ if (!container.value) return;
69
+ ctx = gsap.context(() => {
70
+ gsap.to(".box", { x: 100 });
71
+ gsap.from(".item", { autoAlpha: 0, stagger: 0.1 });
72
+ }, container.value);
73
+ });
74
+
75
+ onUnmounted(() => {
76
+ ctx?.revert();
77
+ });
78
+ </script>
79
+
80
+ <template>
81
+ <div ref="container">
82
+ <div class="box">Box</div>
83
+ <div class="item">Item</div>
84
+ </div>
85
+ </template>
86
+ ```
87
+
88
+ ## Nuxt 4
89
+
90
+ > See `examples/nuxt/` for a runnable Nuxt 4 project with plugin registration, lazy loading, and SSR-safe patterns.
91
+
92
+ Use a **reusable composable** to register GSAP Plugins and also to lazy load Plugins that are not extensively used in your application:
93
+
94
+ ```typescript
95
+ // composables/useGSAP.ts
96
+ import { gsap } from "gsap";
97
+ import { ScrollTrigger } from "gsap/ScrollTrigger";
98
+
99
+ const PLUGINS = [
100
+ "CSSRulePlugin",
101
+ "CustomBounce",
102
+ "CustomEase",
103
+ "CustomWiggle",
104
+ "Draggable",
105
+ "DrawSVGPlugin",
106
+ "EaselPlugin",
107
+ "EasePack",
108
+ "Flip",
109
+ "GSDevTools",
110
+ "InertiaPlugin",
111
+ "MorphSVGPlugin",
112
+ "MotionPathHelper",
113
+ "MotionPathPlugin",
114
+ "Observer",
115
+ "Physics2DPlugin",
116
+ "PhysicsPropsPlugin",
117
+ "PixiPlugin",
118
+ "ScrambleTextPlugin",
119
+ "ScrollSmoother",
120
+ "ScrollToPlugin",
121
+ "ScrollTrigger",
122
+ "SplitText",
123
+ "TextPlugin",
124
+ ] as const;
125
+
126
+ type Plugins = (typeof PLUGINS)[number];
127
+
128
+ // In order to dynamically load all the GSAP plugins
129
+ const pluginMap = {
130
+ CustomEase: () => import("gsap/CustomEase"),
131
+ Draggable: () => import("gsap/Draggable"),
132
+ CSSRulePlugin: () => import("gsap/CSSRulePlugin"),
133
+ EaselPlugin: () => import("gsap/EaselPlugin"),
134
+ EasePack: () => import("gsap/EasePack"),
135
+ Flip: () => import("gsap/Flip"),
136
+ MotionPathPlugin: () => import("gsap/MotionPathPlugin"),
137
+ Observer: () => import("gsap/Observer"),
138
+ PixiPlugin: () => import("gsap/PixiPlugin"),
139
+ ScrollToPlugin: () => import("gsap/ScrollToPlugin"),
140
+ ScrollTrigger: () => import("gsap/ScrollTrigger"),
141
+ TextPlugin: () => import("gsap/TextPlugin"),
142
+ DrawSVGPlugin: () => import("gsap/DrawSVGPlugin"),
143
+ Physics2DPlugin: () => import("gsap/Physics2DPlugin"),
144
+ PhysicsPropsPlugin: () => import("gsap/PhysicsPropsPlugin"),
145
+ ScrambleTextPlugin: () => import("gsap/ScrambleTextPlugin"),
146
+ CustomBounce: () => import("gsap/CustomBounce"),
147
+ CustomWiggle: () => import("gsap/CustomWiggle"),
148
+ GSDevTools: () => import("gsap/GSDevTools"),
149
+ InertiaPlugin: () => import("gsap/InertiaPlugin"),
150
+ MorphSVGPlugin: () => import("gsap/MorphSVGPlugin"),
151
+ MotionPathHelper: () => import("gsap/MotionPathHelper"),
152
+ ScrollSmoother: () => import("gsap/ScrollSmoother"),
153
+ SplitText: () => import("gsap/SplitText"),
154
+ } as const;
155
+
156
+ type PluginMap = typeof pluginMap;
157
+ type Plugins = keyof PluginMap;
158
+
159
+ // Resolves the module type for a given key, then picks the named export matching the key
160
+ // this allows to have the type definitions for autocomplete in your code editor
161
+ type PluginModule<K extends Plugins> = Awaited<ReturnType<PluginMap[K]>>;
162
+ type PluginExport<K extends Plugins> = PluginModule<K>[K & keyof PluginModule<K>];
163
+
164
+ export default function () {
165
+ // Register all the GSAP Plugins you want at this point
166
+ gsap.registerPlugin(ScrollTrigger);
167
+
168
+ /*
169
+ If you want to lazy load some of the plugins that are
170
+ not widely used in your app (for example in just a couple
171
+ of components or a single route), you can use this method
172
+ */
173
+ async function lazyLoadPlugin<K extends Plugins>(plugin: K): Promise<PluginExport<K>> {
174
+ const loader = pluginMap[plugin];
175
+ const m = await loader();
176
+ const p = (m as any)[plugin];
177
+ gsap.registerPlugin(p);
178
+ return p;
179
+ }
180
+
181
+ return {
182
+ gsap,
183
+ ScrollTrigger,
184
+ lazyLoadPlugin,
185
+ };
186
+ }
187
+ ```
188
+
189
+ Access in components via `useGSAP()`:
190
+
191
+ ```javascript
192
+ const { gsap, ScrollTrigger, lazyLoadPlugin } = useGSAP();
193
+ ```
194
+
195
+ - ✅ **`useGSAP()`** provides typed access to the gsap instance and lazy load method.
196
+ - ✅ **Lazy-load any plugin** (SplitText, MorphSVG, etc.) that is not widely used in your app to reduce initial bundle size.
197
+ - ✅ Use **gsap.context(scope)** and **onUnmounted → ctx.revert()** in components, same as Vue 3.
198
+
199
+ ## Svelte
200
+
201
+ Use **onMount** to run GSAP after the DOM is ready. Use the **returned cleanup function** from onMount (or track the context and clean up in a reactive block / component destroy) to revert. Svelte 5 uses a different lifecycle; the same principle applies: create in “mounted” and revert in “destroyed.”
202
+
203
+ ```javascript
204
+ <script>
205
+ import { onMount } from "svelte";
206
+ import { gsap } from "gsap";
207
+ import { ScrollTrigger } from "gsap/ScrollTrigger";
208
+
209
+ let container;
210
+
211
+ onMount(() => {
212
+ if (!container) return;
213
+ const ctx = gsap.context(() => {
214
+ gsap.to(".box", { x: 100 });
215
+ gsap.from(".item", { autoAlpha: 0, stagger: 0.1 });
216
+ }, container);
217
+ return () => ctx.revert();
218
+ });
219
+ </script>
220
+
221
+ <div bind:this={container}>
222
+ <div class="box">Box</div>
223
+ <div class="item">Item</div>
224
+ </div>
225
+ ```
226
+
227
+ - ✅ **bind:this={container}** — get a reference to the root element so you can pass it to **gsap.context(scope)**.
228
+ - ✅ **return () => ctx.revert()** — Svelte’s onMount can return a cleanup function; call **ctx.revert()** there so cleanup runs when the component is destroyed.
229
+
230
+ ## Scoping Selectors
231
+
232
+ Do not use global selectors that can match elements outside the current component. Always pass the **scope** (container element or ref) as the second argument to **gsap.context(callback, scope)** so that any selector run inside the callback is limited to that subtree.
233
+
234
+ - ✅ **gsap.context(() => { gsap.to(".box", ...) }, containerRef)** — `.box` is only searched inside `containerRef`.
235
+ - ❌ Running **gsap.to(".box", ...)** without a context scope in a component can affect other instances or the rest of the page.
236
+
237
+ ## ScrollTrigger Cleanup
238
+
239
+ ScrollTrigger instances are created when you use the `scrollTrigger` config on a tween/timeline or **ScrollTrigger.create()**. They are **included** in **gsap.context()** and reverted when you call **ctx.revert()**. So:
240
+
241
+ - Create ScrollTriggers inside the same **gsap.context()** callback you use for tweens.
242
+ - Call **ScrollTrigger.refresh()** after layout changes (e.g. after data loads) that affect trigger positions; in Vue/Svelte that often means after the DOM updates (e.g. nextTick in Vue, tick in Svelte, or after async content load).
243
+
244
+ ## When to Create vs Kill
245
+
246
+ | Lifecycle | Action |
247
+ | --------------------- | ----------------------------------------------------------------------------------------------------------------- |
248
+ | **Mounted** | Create tweens and ScrollTriggers inside **gsap.context(scope)**. |
249
+ | **Unmount / Destroy** | Call **ctx.revert()** so all animations and ScrollTriggers in that context are killed and inline styles reverted. |
250
+
251
+ Do not create GSAP animations in the component’s setup or in a synchronous top-level script that runs before the root element exists. Wait for **onMounted** / **onMount** (or equivalent) so the container ref is in the DOM.
252
+
253
+ ## Do Not
254
+
255
+ - ❌ Create tweens or ScrollTriggers before the component is mounted (e.g. in setup without onMounted); the DOM nodes may not exist yet.
256
+ - ❌ Use selector strings without a **scope** (pass the container to gsap.context() as the second argument) so selectors don’t match elements outside the component.
257
+ - ❌ Skip cleanup; always call **ctx.revert()** in onUnmounted / onMount’s return so animations and ScrollTriggers are killed when the component is destroyed.
258
+ - ❌ Register plugins inside a component body that runs every render (it doesn't hurt anything, it's just wasteful); register once at app level.
259
+
260
+ ### Learn More
261
+
262
+ - **gsap-react** skill for React-specific patterns (useGSAP, contextSafe).
@@ -0,0 +1,17 @@
1
+ No,Category,Intensity Tier,Keywords,Trigger,Duration,Easing,GSAP Snippet,Framework Notes,Do,Don't,Performance Notes
2
+ 1,Hover Micro-interaction,Subtle,"hover, button, opacity, lift, press feedback",hover,150-200ms,power1.out,"gsap.to(el, { y: -1, opacity: 0.9, duration: 0.15, ease: 'power1.out' });",Bind on mouseenter/mouseleave; in React wrap in a ref + useEffect (or onMouseEnter/onMouseLeave props directly calling gsap.to),Keep displacement under 2px so it reads as feedback not motion,Don't animate layout-affecting props (width/height/margin) on hover,Runs on transform/opacity only so it stays on the compositor thread
3
+ 2,Hover Micro-interaction,Standard,"hover, card, scale, tilt, cursor feedback",hover,200-300ms,power2.out,"gsap.to(el, { y: -4, scale: 1.02, boxShadow: '0 12px 24px rgba(0,0,0,0.12)', duration: 0.25, ease: 'power2.out' });","Use gsap.quickTo(el, 'y') for cards with many hover targets to avoid re-creating tweens every event",Pair with a matching mouseleave tween that reverses the same properties,Don't leave the hover state stuck if the pointer leaves fast; always attach the reverse tween,quickTo() avoids GC churn on lists with 20+ hoverable cards
4
+ 3,Hover Micro-interaction,Complex,"hover, magnetic, cursor follow, 3d tilt",hover + mousemove,300-500ms,"elastic.out(1,0.4)","const xTo = gsap.quickTo(el, 'x', { duration: 0.4, ease: 'elastic.out(1,0.4)' }); const yTo = gsap.quickTo(el, 'y', { duration: 0.4, ease: 'elastic.out(1,0.4)' }); el.addEventListener('mousemove', (e) => { const r = el.getBoundingClientRect(); xTo((e.clientX - r.left - r.width/2) * 0.3); yTo((e.clientY - r.top - r.height/2) * 0.3); });",Debounce is not needed since quickTo interpolates; remove listeners on component unmount in React/Vue to avoid leaks,Clamp the pull strength (e.g. * 0.3) so the element never fully leaves its hit box,Don't apply magnetic effect to more than 1-2 focal elements per screen; it becomes noisy,Use will-change: transform on the target element for smoother compositing
5
+ 4,Scroll Reveal,Subtle,"scroll, fade in, reveal, on view",scroll (viewport enter),300-400ms,power1.out,"gsap.from(el, { opacity: 0, y: 12, duration: 0.35, ease: 'power1.out', scrollTrigger: { trigger: el, start: 'top 90%', toggleActions: 'play none none reverse' } });",Requires the ScrollTrigger plugin registered once via gsap.registerPlugin(ScrollTrigger),"Keep the y offset small (8-16px) so it reads as a fade, not a slide",Don't reveal below-the-fold content needed for SEO/crawlers as invisible-by-default without a no-JS fallback,toggleActions 'play none none reverse' avoids re-triggering on every scroll direction change
6
+ 5,Scroll Reveal,Standard,"scroll, slide up, staggered section, reveal",scroll (viewport enter),400-600ms,power2.out,"gsap.from(el.children, { opacity: 0, y: 24, duration: 0.5, stagger: 0.08, ease: 'power2.out', scrollTrigger: { trigger: el, start: 'top 85%' } });","In React use useGSAP(() => {...}, { scope: containerRef }) from @gsap/react to auto-cleanup on unmount",Scope the ScrollTrigger to the section container so it doesn't re-scan the whole page,Don't stagger more than ~8 children; beyond that the last items feel laggy,Set scroller/markers: false in production; markers is dev-only
7
+ 6,Scroll Reveal,Complex,"scroll, pin, scrub, storytelling, scrollytelling",scroll (continuous scrub),tied to scroll position,none (scrub-driven),"gsap.timeline({ scrollTrigger: { trigger: section, start: 'top top', end: '+=150%', scrub: 1, pin: true } }).from('.headline', { opacity: 0, y: 40 }).to('.bg-layer', { yPercent: -20 }, '<');",Pinning needs the section to have deterministic height; recalc ScrollTrigger.refresh() after images/fonts load,Use scrub: true or a small number (0.5-1.5) instead of instant jumps so it feels tied to the scrollbar,Don't pin more than 1-2 sections per page; excessive pinning fights native scroll feel and hurts mobile UX,"Pinning forces layout reflow; test on mid-tier mobile devices, not just desktop"
8
+ 7,Stagger List,Subtle,"list, stagger, cards, grid entrance",load or scroll,250-350ms,power1.out,"gsap.from('.list-item', { opacity: 0, y: 8, duration: 0.3, stagger: 0.03 });",Select items with a stable class/data-attribute (not array index) so re-renders in React don't break targeting,Keep per-item stagger delay small (0.02-0.04s) for lists longer than 10 items,Don't stagger by more than 0.1s per item on long lists; total reveal time becomes sluggish,"For virtualized lists, only animate items currently mounted in the DOM"
9
+ 8,Stagger List,Standard,"grid, bento, cards, staggered scale",load or scroll,300-450ms,back.out(1.4),"gsap.from('.grid-item', { opacity: 0, scale: 0.92, y: 16, duration: 0.4, stagger: { each: 0.06, from: 'start', grid: 'auto' }, ease: 'back.out(1.4)' });",grid: 'auto' lets GSAP infer rows/columns from a CSS grid layout for a natural wave stagger,Combine with from: 'center' for a bento-grid layout to draw the eye inward first,Don't use back.out on dense data tables; the overshoot reads as sloppy on informational UI,Group DOM writes; avoid interleaving layout reads (getBoundingClientRect) between staggered tweens
10
+ 9,Stagger List,Complex,"stagger, wave, text reveal, split text",load or scroll,400-700ms,expo.out,"const split = new SplitText(headline, { type: 'chars' }); gsap.from(split.chars, { opacity: 0, y: 20, rotateX: -40, duration: 0.6, stagger: 0.015, ease: 'expo.out' });",SplitText is a GSAP Club/paid plugin; confirm license before shipping and provide a plain fade fallback if unavailable,Revert SplitText on unmount/cleanup (split.revert()) to restore original text nodes for accessibility tools,Don't split-animate long paragraphs; reserve for short headlines (under ~8 words),Splitting text creates one element per character; keep it to headline-length copy only for DOM size
11
+ 10,Page Transition,Subtle,"route change, fade, page transition",route change,200-300ms,power1.inOut,"gsap.to(main, { opacity: 0, duration: 0.2, onComplete: () => { navigate(); gsap.fromTo(main, { opacity: 0 }, { opacity: 1, duration: 0.2 }); } });","Pair with the router's transition hooks (Next.js App Router transitions, React Router's useNavigate, Vue Router's beforeEach/afterEach)",Preload the destination route's critical assets before the exit tween finishes,Don't block navigation on animation; cap exit duration at ~250ms so the app never feels unresponsive,Exit animation should always resolve faster than entrance (asymmetric timing) so back/forward feels snappy
12
+ 11,Page Transition,Standard,"route change, slide, overlay wipe",route change,400-600ms,power2.inOut,"const tl = gsap.timeline(); tl.to('.transition-overlay', { yPercent: 0, duration: 0.4, ease: 'power2.inOut' }).call(navigate).to('.transition-overlay', { yPercent: -100, duration: 0.4, ease: 'power2.inOut', delay: 0.1 });",Keep the overlay element mounted at the layout root (outside the page component) so it survives the route swap,Show a lightweight loading indicator if the destination route's data fetch outlasts the overlay,Don't tie the overlay's reveal directly to data-fetch completion without a max-wait timeout; a slow API stalls the whole transition,Prefer CSS transform (yPercent) over top/left to keep the overlay animation on the compositor thread
13
+ 12,Page Transition,Complex,"shared element, morph, hero transition",route change,500-800ms,expo.inOut,"const state = Flip.getState('.hero-image'); navigate(); Flip.from(state, { duration: 0.6, ease: 'expo.inOut', absolute: true, zIndex: 100 });",Requires the GSAP Flip plugin; the 'from' and 'to' route must render the same element with a shared data-flip-id,Verify the shared element exists in both DOM states before calling Flip.from to avoid a silent no-op,Don't use shared-element transitions across more than one element pair per navigation; compounding Flips are hard to time correctly,Flip recalculates layout (FLIP technique) so test on low-end devices for jank
14
+ 13,Parallax Scroll,Subtle,"parallax, background, depth, scroll speed",scroll (continuous),tied to scroll position,linear (scrub),"gsap.to('.bg-layer', { yPercent: 10, ease: 'none', scrollTrigger: { trigger: section, scrub: true } });","Apply parallax to background/decorative layers only, never to text or interactive controls",Keep the yPercent delta small (5-15) so foreground and background never desync distractingly,Don't parallax body copy; it hurts reading comfort and can trigger motion sickness,will-change: transform on the parallax layer only; remove it after scroll settles to free GPU memory
15
+ 14,Parallax Scroll,Standard,"multi-layer parallax, depth, hero background",scroll (continuous),tied to scroll position,linear (scrub),"gsap.utils.toArray('.parallax-layer').forEach((layer, i) => { gsap.to(layer, { yPercent: (i + 1) * -8, ease: 'none', scrollTrigger: { trigger: layer.parentElement, scrub: 0.5 } }); });",Layer count beyond 3-4 has diminishing visual return and multiplies scroll-listener cost,"Vary speed per layer (background slowest, foreground fastest) to sell the depth illusion",Don't let parallax layers overflow their container; clip with overflow: hidden on the wrapper,Batch all layers under one ScrollTrigger container where possible instead of one per layer
16
+ 15,Loading / Skeleton,Subtle,"loading, skeleton, shimmer, pulse",on mount / async wait,1200-1600ms loop,sine.inOut,"gsap.to('.skeleton', { backgroundPosition: '200% 0', duration: 1.4, ease: 'sine.inOut', repeat: -1 });",Kill the loop tween (tween.kill()) as soon as real content mounts to avoid orphaned repeating animations,Use a CSS gradient background-position sweep rather than opacity pulsing; reads as 'loading' more clearly,Don't run more than one shimmer loop per skeleton group; sync them under one timeline so the wave reads as a single unit,repeat: -1 tweens are cheap but must be explicitly killed on unmount or they leak in SPA route changes
17
+ 16,Loading / Skeleton,Standard,"progress, spinner, morphing loader",on mount / async wait,800-1200ms loop,power1.inOut,"gsap.timeline({ repeat: -1 }).to('.loader-dot', { y: -8, duration: 0.4, stagger: { each: 0.15, yoyo: true, repeat: 1 } });",Wrap the whole loop timeline in useGSAP with { revertOnUpdate: false } in React so it isn't rebuilt every render,Cap total loop duration under ~1.5s so long waits don't feel like the UI froze on a single beat,Don't use elaborate loaders for sub-300ms waits; they flash and feel worse than no indicator,Pause the timeline (tl.pause()) when the loading tab/view is not visible to save CPU on background tabs
@@ -0,0 +1,11 @@
1
+ # GSAP Motion Preset: motion
2
+
3
+ ## Motion Details
4
+ - **Trigger**: `scroll`
5
+ - **Intensity**: `medium`
6
+ - **Ease**: `power2.out`
7
+
8
+ ## Code Skeleton
9
+ ```javascript
10
+ // gsap.to(element, { opacity: 1, duration: 0.8 })
11
+ ```
@@ -0,0 +1,226 @@
1
+ [
2
+ {
3
+ "No": "1",
4
+ "Category": "Hover Micro-interaction",
5
+ "Intensity Tier": "Subtle",
6
+ "Keywords": "hover, button, opacity, lift, press feedback",
7
+ "Trigger": "hover",
8
+ "Duration": "150-200ms",
9
+ "Easing": "power1.out",
10
+ "GSAP Snippet": "gsap.to(el, { y: -1, opacity: 0.9, duration: 0.15, ease: 'power1.out' });",
11
+ "Framework Notes": "Bind on mouseenter/mouseleave; in React wrap in a ref + useEffect (or onMouseEnter/onMouseLeave props directly calling gsap.to)",
12
+ "Do": "Keep displacement under 2px so it reads as feedback not motion",
13
+ "Don't": "Don't animate layout-affecting props (width/height/margin) on hover",
14
+ "Performance Notes": "Runs on transform/opacity only so it stays on the compositor thread"
15
+ },
16
+ {
17
+ "No": "2",
18
+ "Category": "Hover Micro-interaction",
19
+ "Intensity Tier": "Standard",
20
+ "Keywords": "hover, card, scale, tilt, cursor feedback",
21
+ "Trigger": "hover",
22
+ "Duration": "200-300ms",
23
+ "Easing": "power2.out",
24
+ "GSAP Snippet": "gsap.to(el, { y: -4, scale: 1.02, boxShadow: '0 12px 24px rgba(0,0,0,0.12)', duration: 0.25, ease: 'power2.out' });",
25
+ "Framework Notes": "Use gsap.quickTo(el, 'y') for cards with many hover targets to avoid re-creating tweens every event",
26
+ "Do": "Pair with a matching mouseleave tween that reverses the same properties",
27
+ "Don't": "Don't leave the hover state stuck if the pointer leaves fast; always attach the reverse tween",
28
+ "Performance Notes": "quickTo() avoids GC churn on lists with 20+ hoverable cards"
29
+ },
30
+ {
31
+ "No": "3",
32
+ "Category": "Hover Micro-interaction",
33
+ "Intensity Tier": "Complex",
34
+ "Keywords": "hover, magnetic, cursor follow, 3d tilt",
35
+ "Trigger": "hover + mousemove",
36
+ "Duration": "300-500ms",
37
+ "Easing": "elastic.out(1,0.4)",
38
+ "GSAP Snippet": "const xTo = gsap.quickTo(el, 'x', { duration: 0.4, ease: 'elastic.out(1,0.4)' }); const yTo = gsap.quickTo(el, 'y', { duration: 0.4, ease: 'elastic.out(1,0.4)' }); el.addEventListener('mousemove', (e) => { const r = el.getBoundingClientRect(); xTo((e.clientX - r.left - r.width/2) * 0.3); yTo((e.clientY - r.top - r.height/2) * 0.3); });",
39
+ "Framework Notes": "Debounce is not needed since quickTo interpolates; remove listeners on component unmount in React/Vue to avoid leaks",
40
+ "Do": "Clamp the pull strength (e.g. * 0.3) so the element never fully leaves its hit box",
41
+ "Don't": "Don't apply magnetic effect to more than 1-2 focal elements per screen; it becomes noisy",
42
+ "Performance Notes": "Use will-change: transform on the target element for smoother compositing"
43
+ },
44
+ {
45
+ "No": "4",
46
+ "Category": "Scroll Reveal",
47
+ "Intensity Tier": "Subtle",
48
+ "Keywords": "scroll, fade in, reveal, on view",
49
+ "Trigger": "scroll (viewport enter)",
50
+ "Duration": "300-400ms",
51
+ "Easing": "power1.out",
52
+ "GSAP Snippet": "gsap.from(el, { opacity: 0, y: 12, duration: 0.35, ease: 'power1.out', scrollTrigger: { trigger: el, start: 'top 90%', toggleActions: 'play none none reverse' } });",
53
+ "Framework Notes": "Requires the ScrollTrigger plugin registered once via gsap.registerPlugin(ScrollTrigger)",
54
+ "Do": "Keep the y offset small (8-16px) so it reads as a fade, not a slide",
55
+ "Don't": "Don't reveal below-the-fold content needed for SEO/crawlers as invisible-by-default without a no-JS fallback",
56
+ "Performance Notes": "toggleActions 'play none none reverse' avoids re-triggering on every scroll direction change"
57
+ },
58
+ {
59
+ "No": "5",
60
+ "Category": "Scroll Reveal",
61
+ "Intensity Tier": "Standard",
62
+ "Keywords": "scroll, slide up, staggered section, reveal",
63
+ "Trigger": "scroll (viewport enter)",
64
+ "Duration": "400-600ms",
65
+ "Easing": "power2.out",
66
+ "GSAP Snippet": "gsap.from(el.children, { opacity: 0, y: 24, duration: 0.5, stagger: 0.08, ease: 'power2.out', scrollTrigger: { trigger: el, start: 'top 85%' } });",
67
+ "Framework Notes": "In React use useGSAP(() => {...}, { scope: containerRef }) from @gsap/react to auto-cleanup on unmount",
68
+ "Do": "Scope the ScrollTrigger to the section container so it doesn't re-scan the whole page",
69
+ "Don't": "Don't stagger more than ~8 children; beyond that the last items feel laggy",
70
+ "Performance Notes": "Set scroller/markers: false in production; markers is dev-only"
71
+ },
72
+ {
73
+ "No": "6",
74
+ "Category": "Scroll Reveal",
75
+ "Intensity Tier": "Complex",
76
+ "Keywords": "scroll, pin, scrub, storytelling, scrollytelling",
77
+ "Trigger": "scroll (continuous scrub)",
78
+ "Duration": "tied to scroll position",
79
+ "Easing": "none (scrub-driven)",
80
+ "GSAP Snippet": "gsap.timeline({ scrollTrigger: { trigger: section, start: 'top top', end: '+=150%', scrub: 1, pin: true } }).from('.headline', { opacity: 0, y: 40 }).to('.bg-layer', { yPercent: -20 }, '<');",
81
+ "Framework Notes": "Pinning needs the section to have deterministic height; recalc ScrollTrigger.refresh() after images/fonts load",
82
+ "Do": "Use scrub: true or a small number (0.5-1.5) instead of instant jumps so it feels tied to the scrollbar",
83
+ "Don't": "Don't pin more than 1-2 sections per page; excessive pinning fights native scroll feel and hurts mobile UX",
84
+ "Performance Notes": "Pinning forces layout reflow; test on mid-tier mobile devices, not just desktop"
85
+ },
86
+ {
87
+ "No": "7",
88
+ "Category": "Stagger List",
89
+ "Intensity Tier": "Subtle",
90
+ "Keywords": "list, stagger, cards, grid entrance",
91
+ "Trigger": "load or scroll",
92
+ "Duration": "250-350ms",
93
+ "Easing": "power1.out",
94
+ "GSAP Snippet": "gsap.from('.list-item', { opacity: 0, y: 8, duration: 0.3, stagger: 0.03 });",
95
+ "Framework Notes": "Select items with a stable class/data-attribute (not array index) so re-renders in React don't break targeting",
96
+ "Do": "Keep per-item stagger delay small (0.02-0.04s) for lists longer than 10 items",
97
+ "Don't": "Don't stagger by more than 0.1s per item on long lists; total reveal time becomes sluggish",
98
+ "Performance Notes": "For virtualized lists, only animate items currently mounted in the DOM"
99
+ },
100
+ {
101
+ "No": "8",
102
+ "Category": "Stagger List",
103
+ "Intensity Tier": "Standard",
104
+ "Keywords": "grid, bento, cards, staggered scale",
105
+ "Trigger": "load or scroll",
106
+ "Duration": "300-450ms",
107
+ "Easing": "back.out(1.4)",
108
+ "GSAP Snippet": "gsap.from('.grid-item', { opacity: 0, scale: 0.92, y: 16, duration: 0.4, stagger: { each: 0.06, from: 'start', grid: 'auto' }, ease: 'back.out(1.4)' });",
109
+ "Framework Notes": "grid: 'auto' lets GSAP infer rows/columns from a CSS grid layout for a natural wave stagger",
110
+ "Do": "Combine with from: 'center' for a bento-grid layout to draw the eye inward first",
111
+ "Don't": "Don't use back.out on dense data tables; the overshoot reads as sloppy on informational UI",
112
+ "Performance Notes": "Group DOM writes; avoid interleaving layout reads (getBoundingClientRect) between staggered tweens"
113
+ },
114
+ {
115
+ "No": "9",
116
+ "Category": "Stagger List",
117
+ "Intensity Tier": "Complex",
118
+ "Keywords": "stagger, wave, text reveal, split text",
119
+ "Trigger": "load or scroll",
120
+ "Duration": "400-700ms",
121
+ "Easing": "expo.out",
122
+ "GSAP Snippet": "const split = new SplitText(headline, { type: 'chars' }); gsap.from(split.chars, { opacity: 0, y: 20, rotateX: -40, duration: 0.6, stagger: 0.015, ease: 'expo.out' });",
123
+ "Framework Notes": "SplitText is a GSAP Club/paid plugin; confirm license before shipping and provide a plain fade fallback if unavailable",
124
+ "Do": "Revert SplitText on unmount/cleanup (split.revert()) to restore original text nodes for accessibility tools",
125
+ "Don't": "Don't split-animate long paragraphs; reserve for short headlines (under ~8 words)",
126
+ "Performance Notes": "Splitting text creates one element per character; keep it to headline-length copy only for DOM size"
127
+ },
128
+ {
129
+ "No": "10",
130
+ "Category": "Page Transition",
131
+ "Intensity Tier": "Subtle",
132
+ "Keywords": "route change, fade, page transition",
133
+ "Trigger": "route change",
134
+ "Duration": "200-300ms",
135
+ "Easing": "power1.inOut",
136
+ "GSAP Snippet": "gsap.to(main, { opacity: 0, duration: 0.2, onComplete: () => { navigate(); gsap.fromTo(main, { opacity: 0 }, { opacity: 1, duration: 0.2 }); } });",
137
+ "Framework Notes": "Pair with the router's transition hooks (Next.js App Router transitions, React Router's useNavigate, Vue Router's beforeEach/afterEach)",
138
+ "Do": "Preload the destination route's critical assets before the exit tween finishes",
139
+ "Don't": "Don't block navigation on animation; cap exit duration at ~250ms so the app never feels unresponsive",
140
+ "Performance Notes": "Exit animation should always resolve faster than entrance (asymmetric timing) so back/forward feels snappy"
141
+ },
142
+ {
143
+ "No": "11",
144
+ "Category": "Page Transition",
145
+ "Intensity Tier": "Standard",
146
+ "Keywords": "route change, slide, overlay wipe",
147
+ "Trigger": "route change",
148
+ "Duration": "400-600ms",
149
+ "Easing": "power2.inOut",
150
+ "GSAP Snippet": "const tl = gsap.timeline(); tl.to('.transition-overlay', { yPercent: 0, duration: 0.4, ease: 'power2.inOut' }).call(navigate).to('.transition-overlay', { yPercent: -100, duration: 0.4, ease: 'power2.inOut', delay: 0.1 });",
151
+ "Framework Notes": "Keep the overlay element mounted at the layout root (outside the page component) so it survives the route swap",
152
+ "Do": "Show a lightweight loading indicator if the destination route's data fetch outlasts the overlay",
153
+ "Don't": "Don't tie the overlay's reveal directly to data-fetch completion without a max-wait timeout; a slow API stalls the whole transition",
154
+ "Performance Notes": "Prefer CSS transform (yPercent) over top/left to keep the overlay animation on the compositor thread"
155
+ },
156
+ {
157
+ "No": "12",
158
+ "Category": "Page Transition",
159
+ "Intensity Tier": "Complex",
160
+ "Keywords": "shared element, morph, hero transition",
161
+ "Trigger": "route change",
162
+ "Duration": "500-800ms",
163
+ "Easing": "expo.inOut",
164
+ "GSAP Snippet": "const state = Flip.getState('.hero-image'); navigate(); Flip.from(state, { duration: 0.6, ease: 'expo.inOut', absolute: true, zIndex: 100 });",
165
+ "Framework Notes": "Requires the GSAP Flip plugin; the 'from' and 'to' route must render the same element with a shared data-flip-id",
166
+ "Do": "Verify the shared element exists in both DOM states before calling Flip.from to avoid a silent no-op",
167
+ "Don't": "Don't use shared-element transitions across more than one element pair per navigation; compounding Flips are hard to time correctly",
168
+ "Performance Notes": "Flip recalculates layout (FLIP technique) so test on low-end devices for jank"
169
+ },
170
+ {
171
+ "No": "13",
172
+ "Category": "Parallax Scroll",
173
+ "Intensity Tier": "Subtle",
174
+ "Keywords": "parallax, background, depth, scroll speed",
175
+ "Trigger": "scroll (continuous)",
176
+ "Duration": "tied to scroll position",
177
+ "Easing": "linear (scrub)",
178
+ "GSAP Snippet": "gsap.to('.bg-layer', { yPercent: 10, ease: 'none', scrollTrigger: { trigger: section, scrub: true } });",
179
+ "Framework Notes": "Apply parallax to background/decorative layers only, never to text or interactive controls",
180
+ "Do": "Keep the yPercent delta small (5-15) so foreground and background never desync distractingly",
181
+ "Don't": "Don't parallax body copy; it hurts reading comfort and can trigger motion sickness",
182
+ "Performance Notes": "will-change: transform on the parallax layer only; remove it after scroll settles to free GPU memory"
183
+ },
184
+ {
185
+ "No": "14",
186
+ "Category": "Parallax Scroll",
187
+ "Intensity Tier": "Standard",
188
+ "Keywords": "multi-layer parallax, depth, hero background",
189
+ "Trigger": "scroll (continuous)",
190
+ "Duration": "tied to scroll position",
191
+ "Easing": "linear (scrub)",
192
+ "GSAP Snippet": "gsap.utils.toArray('.parallax-layer').forEach((layer, i) => { gsap.to(layer, { yPercent: (i + 1) * -8, ease: 'none', scrollTrigger: { trigger: layer.parentElement, scrub: 0.5 } }); });",
193
+ "Framework Notes": "Layer count beyond 3-4 has diminishing visual return and multiplies scroll-listener cost",
194
+ "Do": "Vary speed per layer (background slowest, foreground fastest) to sell the depth illusion",
195
+ "Don't": "Don't let parallax layers overflow their container; clip with overflow: hidden on the wrapper",
196
+ "Performance Notes": "Batch all layers under one ScrollTrigger container where possible instead of one per layer"
197
+ },
198
+ {
199
+ "No": "15",
200
+ "Category": "Loading / Skeleton",
201
+ "Intensity Tier": "Subtle",
202
+ "Keywords": "loading, skeleton, shimmer, pulse",
203
+ "Trigger": "on mount / async wait",
204
+ "Duration": "1200-1600ms loop",
205
+ "Easing": "sine.inOut",
206
+ "GSAP Snippet": "gsap.to('.skeleton', { backgroundPosition: '200% 0', duration: 1.4, ease: 'sine.inOut', repeat: -1 });",
207
+ "Framework Notes": "Kill the loop tween (tween.kill()) as soon as real content mounts to avoid orphaned repeating animations",
208
+ "Do": "Use a CSS gradient background-position sweep rather than opacity pulsing; reads as 'loading' more clearly",
209
+ "Don't": "Don't run more than one shimmer loop per skeleton group; sync them under one timeline so the wave reads as a single unit",
210
+ "Performance Notes": "repeat: -1 tweens are cheap but must be explicitly killed on unmount or they leak in SPA route changes"
211
+ },
212
+ {
213
+ "No": "16",
214
+ "Category": "Loading / Skeleton",
215
+ "Intensity Tier": "Standard",
216
+ "Keywords": "progress, spinner, morphing loader",
217
+ "Trigger": "on mount / async wait",
218
+ "Duration": "800-1200ms loop",
219
+ "Easing": "power1.inOut",
220
+ "GSAP Snippet": "gsap.timeline({ repeat: -1 }).to('.loader-dot', { y: -8, duration: 0.4, stagger: { each: 0.15, yoyo: true, repeat: 1 } });",
221
+ "Framework Notes": "Wrap the whole loop timeline in useGSAP with { revertOnUpdate: false } in React so it isn't rebuilt every render",
222
+ "Do": "Cap total loop duration under ~1.5s so long waits don't feel like the UI froze on a single beat",
223
+ "Don't": "Don't use elaborate loaders for sub-300ms waits; they flash and feel worse than no indicator",
224
+ "Performance Notes": "Pause the timeline (tl.pause()) when the loading tab/view is not visible to save CPU on background tabs"
225
+ }
226
+ ]