@jaimevalasek/aioson 1.3.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.
- package/CHANGELOG.md +456 -0
- package/CODE_OF_CONDUCT.md +12 -0
- package/CONTRIBUTING.md +13 -0
- package/LICENSE +21 -0
- package/README.md +254 -0
- package/bin/aioson.js +4 -0
- package/docs/en/cli-reference.md +398 -0
- package/docs/en/i18n.md +52 -0
- package/docs/en/json-schemas.md +41 -0
- package/docs/en/mcp.md +56 -0
- package/docs/en/parallel.md +82 -0
- package/docs/en/qa-browser.md +339 -0
- package/docs/en/release-flow.md +22 -0
- package/docs/en/release-notes-template.md +41 -0
- package/docs/en/release.md +28 -0
- package/docs/en/schemas/agent-prompt.schema.json +17 -0
- package/docs/en/schemas/agents.schema.json +32 -0
- package/docs/en/schemas/context-validate.schema.json +36 -0
- package/docs/en/schemas/doctor.schema.json +89 -0
- package/docs/en/schemas/error.schema.json +24 -0
- package/docs/en/schemas/i18n-add.schema.json +15 -0
- package/docs/en/schemas/index.json +116 -0
- package/docs/en/schemas/info.schema.json +39 -0
- package/docs/en/schemas/init.schema.json +48 -0
- package/docs/en/schemas/install.schema.json +60 -0
- package/docs/en/schemas/locale-apply.schema.json +30 -0
- package/docs/en/schemas/mcp-doctor.schema.json +95 -0
- package/docs/en/schemas/mcp-init.schema.json +122 -0
- package/docs/en/schemas/package-test.schema.json +24 -0
- package/docs/en/schemas/parallel-assign.schema.json +57 -0
- package/docs/en/schemas/parallel-doctor.schema.json +86 -0
- package/docs/en/schemas/parallel-init.schema.json +53 -0
- package/docs/en/schemas/parallel-status.schema.json +94 -0
- package/docs/en/schemas/setup-context.schema.json +39 -0
- package/docs/en/schemas/smoke.schema.json +23 -0
- package/docs/en/schemas/update.schema.json +48 -0
- package/docs/en/schemas/workflow-plan.schema.json +30 -0
- package/docs/en/web3.md +54 -0
- package/docs/pt/README.md +46 -0
- package/docs/pt/advisor-spec.md +335 -0
- package/docs/pt/agentes.md +453 -0
- package/docs/pt/cenarios.md +1230 -0
- package/docs/pt/clientes-ai.md +224 -0
- package/docs/pt/comandos-cli.md +511 -0
- package/docs/pt/genome-3.0-spec.md +296 -0
- package/docs/pt/guia-engineer.md +226 -0
- package/docs/pt/inicio-rapido.md +138 -0
- package/docs/pt/profiler-system.md +214 -0
- package/docs/pt/runtime-observability.md +72 -0
- package/docs/pt/squad-genoma.md +777 -0
- package/docs/pt/web3.md +797 -0
- package/docs/testing/genome-2.0-manual-regression.md +23 -0
- package/docs/testing/genome-2.0-matrix.md +36 -0
- package/docs/testing/genome-2.0-rollout.md +184 -0
- package/package.json +50 -0
- package/src/agents.js +56 -0
- package/src/cli.js +497 -0
- package/src/commands/agents.js +142 -0
- package/src/commands/cloud.js +1767 -0
- package/src/commands/config.js +90 -0
- package/src/commands/context-validate.js +91 -0
- package/src/commands/doctor.js +123 -0
- package/src/commands/genome-doctor.js +41 -0
- package/src/commands/genome-migrate.js +49 -0
- package/src/commands/i18n-add.js +56 -0
- package/src/commands/info.js +41 -0
- package/src/commands/init.js +75 -0
- package/src/commands/install.js +68 -0
- package/src/commands/locale-apply.js +51 -0
- package/src/commands/locale-diff.js +126 -0
- package/src/commands/mcp-doctor.js +406 -0
- package/src/commands/mcp-init.js +379 -0
- package/src/commands/package-e2e.js +273 -0
- package/src/commands/parallel-assign.js +403 -0
- package/src/commands/parallel-doctor.js +437 -0
- package/src/commands/parallel-init.js +249 -0
- package/src/commands/parallel-status.js +290 -0
- package/src/commands/qa-doctor.js +185 -0
- package/src/commands/qa-init.js +161 -0
- package/src/commands/qa-report.js +58 -0
- package/src/commands/qa-run.js +873 -0
- package/src/commands/qa-scan.js +337 -0
- package/src/commands/runtime.js +948 -0
- package/src/commands/scan-project.js +1107 -0
- package/src/commands/setup-context.js +650 -0
- package/src/commands/smoke.js +426 -0
- package/src/commands/squad-doctor.js +358 -0
- package/src/commands/squad-export.js +46 -0
- package/src/commands/squad-pipeline.js +97 -0
- package/src/commands/squad-repair-genomes.js +39 -0
- package/src/commands/squad-status.js +424 -0
- package/src/commands/squad-validate.js +230 -0
- package/src/commands/test-agents.js +194 -0
- package/src/commands/update.js +55 -0
- package/src/commands/workflow-next.js +594 -0
- package/src/commands/workflow-plan.js +108 -0
- package/src/constants.js +314 -0
- package/src/context-parse-reason.js +22 -0
- package/src/context-writer.js +150 -0
- package/src/context.js +217 -0
- package/src/detector.js +261 -0
- package/src/doctor.js +289 -0
- package/src/execution-gateway.js +461 -0
- package/src/genome-files.js +198 -0
- package/src/genome-format.js +442 -0
- package/src/genome-schema.js +215 -0
- package/src/genomes/bindings.js +281 -0
- package/src/genomes.js +467 -0
- package/src/i18n/index.js +103 -0
- package/src/i18n/messages/en.js +784 -0
- package/src/i18n/messages/es.js +718 -0
- package/src/i18n/messages/fr.js +725 -0
- package/src/i18n/messages/pt-BR.js +818 -0
- package/src/i18n/scaffold.js +64 -0
- package/src/installer.js +232 -0
- package/src/lib/genomes/compat.js +206 -0
- package/src/lib/genomes/migrate.js +90 -0
- package/src/lib/squads/genome-repair.js +49 -0
- package/src/locales.js +84 -0
- package/src/onboarding.js +305 -0
- package/src/parser.js +53 -0
- package/src/prompt-tool.js +20 -0
- package/src/qa-html-report.js +472 -0
- package/src/runtime-store.js +1527 -0
- package/src/squads/apply-genome.js +21 -0
- package/src/squads/genome-binding-service.js +154 -0
- package/src/updater.js +32 -0
- package/src/utils.js +46 -0
- package/src/version.js +50 -0
- package/template/.aioson/advisors/.gitkeep +1 -0
- package/template/.aioson/agents/analyst.md +225 -0
- package/template/.aioson/agents/architect.md +221 -0
- package/template/.aioson/agents/dev.md +201 -0
- package/template/.aioson/agents/discovery-design-doc.md +196 -0
- package/template/.aioson/agents/genoma.md +300 -0
- package/template/.aioson/agents/orchestrator.md +107 -0
- package/template/.aioson/agents/pm.md +89 -0
- package/template/.aioson/agents/product.md +361 -0
- package/template/.aioson/agents/profiler-enricher.md +266 -0
- package/template/.aioson/agents/profiler-forge.md +188 -0
- package/template/.aioson/agents/profiler-researcher.md +245 -0
- package/template/.aioson/agents/qa.md +344 -0
- package/template/.aioson/agents/setup.md +381 -0
- package/template/.aioson/agents/squad.md +837 -0
- package/template/.aioson/agents/ux-ui.md +416 -0
- package/template/.aioson/config.md +56 -0
- package/template/.aioson/context/.gitkeep +0 -0
- package/template/.aioson/context/parallel/.gitkeep +0 -0
- package/template/.aioson/context/spec.md.template +37 -0
- package/template/.aioson/genomas/.gitkeep +0 -0
- package/template/.aioson/locales/en/agents/analyst.md +214 -0
- package/template/.aioson/locales/en/agents/architect.md +210 -0
- package/template/.aioson/locales/en/agents/dev.md +187 -0
- package/template/.aioson/locales/en/agents/discovery-design-doc.md +27 -0
- package/template/.aioson/locales/en/agents/genoma.md +212 -0
- package/template/.aioson/locales/en/agents/orchestrator.md +105 -0
- package/template/.aioson/locales/en/agents/pm.md +77 -0
- package/template/.aioson/locales/en/agents/product.md +310 -0
- package/template/.aioson/locales/en/agents/profiler-enricher.md +5 -0
- package/template/.aioson/locales/en/agents/profiler-forge.md +5 -0
- package/template/.aioson/locales/en/agents/profiler-researcher.md +5 -0
- package/template/.aioson/locales/en/agents/qa.md +214 -0
- package/template/.aioson/locales/en/agents/setup.md +342 -0
- package/template/.aioson/locales/en/agents/squad.md +247 -0
- package/template/.aioson/locales/en/agents/ux-ui.md +320 -0
- package/template/.aioson/locales/es/agents/analyst.md +203 -0
- package/template/.aioson/locales/es/agents/architect.md +208 -0
- package/template/.aioson/locales/es/agents/dev.md +183 -0
- package/template/.aioson/locales/es/agents/discovery-design-doc.md +19 -0
- package/template/.aioson/locales/es/agents/genoma.md +102 -0
- package/template/.aioson/locales/es/agents/orchestrator.md +108 -0
- package/template/.aioson/locales/es/agents/pm.md +81 -0
- package/template/.aioson/locales/es/agents/product.md +310 -0
- package/template/.aioson/locales/es/agents/profiler-enricher.md +5 -0
- package/template/.aioson/locales/es/agents/profiler-forge.md +5 -0
- package/template/.aioson/locales/es/agents/profiler-researcher.md +5 -0
- package/template/.aioson/locales/es/agents/qa.md +163 -0
- package/template/.aioson/locales/es/agents/setup.md +347 -0
- package/template/.aioson/locales/es/agents/squad.md +247 -0
- package/template/.aioson/locales/es/agents/ux-ui.md +201 -0
- package/template/.aioson/locales/fr/agents/analyst.md +203 -0
- package/template/.aioson/locales/fr/agents/architect.md +208 -0
- package/template/.aioson/locales/fr/agents/dev.md +183 -0
- package/template/.aioson/locales/fr/agents/discovery-design-doc.md +19 -0
- package/template/.aioson/locales/fr/agents/genoma.md +102 -0
- package/template/.aioson/locales/fr/agents/orchestrator.md +108 -0
- package/template/.aioson/locales/fr/agents/pm.md +81 -0
- package/template/.aioson/locales/fr/agents/product.md +310 -0
- package/template/.aioson/locales/fr/agents/profiler-enricher.md +5 -0
- package/template/.aioson/locales/fr/agents/profiler-forge.md +5 -0
- package/template/.aioson/locales/fr/agents/profiler-researcher.md +5 -0
- package/template/.aioson/locales/fr/agents/qa.md +163 -0
- package/template/.aioson/locales/fr/agents/setup.md +347 -0
- package/template/.aioson/locales/fr/agents/squad.md +247 -0
- package/template/.aioson/locales/fr/agents/ux-ui.md +201 -0
- package/template/.aioson/locales/pt-BR/agents/analyst.md +217 -0
- package/template/.aioson/locales/pt-BR/agents/architect.md +213 -0
- package/template/.aioson/locales/pt-BR/agents/dev.md +198 -0
- package/template/.aioson/locales/pt-BR/agents/discovery-design-doc.md +198 -0
- package/template/.aioson/locales/pt-BR/agents/genoma.md +297 -0
- package/template/.aioson/locales/pt-BR/agents/orchestrator.md +108 -0
- package/template/.aioson/locales/pt-BR/agents/pm.md +81 -0
- package/template/.aioson/locales/pt-BR/agents/product.md +316 -0
- package/template/.aioson/locales/pt-BR/agents/profiler-enricher.md +5 -0
- package/template/.aioson/locales/pt-BR/agents/profiler-forge.md +5 -0
- package/template/.aioson/locales/pt-BR/agents/profiler-researcher.md +5 -0
- package/template/.aioson/locales/pt-BR/agents/qa.md +217 -0
- package/template/.aioson/locales/pt-BR/agents/setup.md +371 -0
- package/template/.aioson/locales/pt-BR/agents/squad.md +772 -0
- package/template/.aioson/locales/pt-BR/agents/ux-ui.md +322 -0
- package/template/.aioson/mcp/servers.md +24 -0
- package/template/.aioson/profiler-reports/.gitkeep +1 -0
- package/template/.aioson/schemas/content-blueprint.schema.json +30 -0
- package/template/.aioson/schemas/genome-meta.schema.json +150 -0
- package/template/.aioson/schemas/genome.schema.json +115 -0
- package/template/.aioson/schemas/readiness.schema.json +27 -0
- package/template/.aioson/schemas/squad-blueprint.schema.json +172 -0
- package/template/.aioson/schemas/squad-manifest.schema.json +276 -0
- package/template/.aioson/skills/dynamic/README.md +30 -0
- package/template/.aioson/skills/dynamic/cardano-docs.md +16 -0
- package/template/.aioson/skills/dynamic/ethereum-docs.md +17 -0
- package/template/.aioson/skills/dynamic/flux-ui-docs.md +13 -0
- package/template/.aioson/skills/dynamic/laravel-docs.md +41 -0
- package/template/.aioson/skills/dynamic/npm-packages.md +16 -0
- package/template/.aioson/skills/dynamic/solana-docs.md +16 -0
- package/template/.aioson/skills/references/premium-command-center-ui/master-application-prompt.md +79 -0
- package/template/.aioson/skills/references/premium-command-center-ui/operational-ux-playbook.md +253 -0
- package/template/.aioson/skills/references/premium-command-center-ui/quality-validation-checklist.md +82 -0
- package/template/.aioson/skills/references/premium-command-center-ui/visual-system-and-component-patterns.md +270 -0
- package/template/.aioson/skills/static/django-patterns.md +342 -0
- package/template/.aioson/skills/static/fastapi-patterns.md +344 -0
- package/template/.aioson/skills/static/filament-patterns.md +267 -0
- package/template/.aioson/skills/static/flux-ui-components.md +262 -0
- package/template/.aioson/skills/static/git-conventions.md +227 -0
- package/template/.aioson/skills/static/interface-design.md +372 -0
- package/template/.aioson/skills/static/jetstream-setup.md +200 -0
- package/template/.aioson/skills/static/laravel-conventions.md +491 -0
- package/template/.aioson/skills/static/nextjs-patterns.md +321 -0
- package/template/.aioson/skills/static/node-express-patterns.md +317 -0
- package/template/.aioson/skills/static/node-typescript-patterns.md +282 -0
- package/template/.aioson/skills/static/premium-command-center-ui.md +190 -0
- package/template/.aioson/skills/static/rails-conventions.md +307 -0
- package/template/.aioson/skills/static/react-motion-patterns.md +577 -0
- package/template/.aioson/skills/static/static-html-patterns.md +1935 -0
- package/template/.aioson/skills/static/tall-stack-patterns.md +286 -0
- package/template/.aioson/skills/static/ui-ux-modern.md +75 -0
- package/template/.aioson/skills/static/web3-cardano-patterns.md +337 -0
- package/template/.aioson/skills/static/web3-ethereum-patterns.md +310 -0
- package/template/.aioson/skills/static/web3-security-checklist.md +284 -0
- package/template/.aioson/skills/static/web3-solana-patterns.md +324 -0
- package/template/.aioson/squads/.artisan/.gitkeep +0 -0
- package/template/.aioson/squads/.gitkeep +0 -0
- package/template/.aioson/squads/memory.md +5 -0
- package/template/.aioson/tasks/squad-analyze.md +83 -0
- package/template/.aioson/tasks/squad-create.md +99 -0
- package/template/.aioson/tasks/squad-design.md +100 -0
- package/template/.aioson/tasks/squad-export.md +20 -0
- package/template/.aioson/tasks/squad-extend.md +68 -0
- package/template/.aioson/tasks/squad-pipeline.md +122 -0
- package/template/.aioson/tasks/squad-repair.md +85 -0
- package/template/.aioson/tasks/squad-validate.md +58 -0
- package/template/.aioson/templates/squads/content-basic/template.json +21 -0
- package/template/.aioson/templates/squads/media-channel/template.json +24 -0
- package/template/.aioson/templates/squads/research-analysis/template.json +22 -0
- package/template/.aioson/templates/squads/software-delivery/template.json +21 -0
- package/template/.claude/commands/aioson/analyst.md +5 -0
- package/template/.claude/commands/aioson/architect.md +5 -0
- package/template/.claude/commands/aioson/dev.md +5 -0
- package/template/.claude/commands/aioson/orchestrator.md +5 -0
- package/template/.claude/commands/aioson/pm.md +5 -0
- package/template/.claude/commands/aioson/qa.md +5 -0
- package/template/.claude/commands/aioson/setup.md +5 -0
- package/template/.claude/commands/aioson/ux-ui.md +5 -0
- package/template/.gemini/GEMINI.md +10 -0
- package/template/.gemini/commands/aios-analyst.toml +4 -0
- package/template/.gemini/commands/aios-architect.toml +7 -0
- package/template/.gemini/commands/aios-dev.toml +8 -0
- package/template/.gemini/commands/aios-discovery-design-doc.toml +4 -0
- package/template/.gemini/commands/aios-orchestrator.toml +8 -0
- package/template/.gemini/commands/aios-pm.toml +8 -0
- package/template/.gemini/commands/aios-product.toml +4 -0
- package/template/.gemini/commands/aios-qa.toml +6 -0
- package/template/.gemini/commands/aios-setup.toml +3 -0
- package/template/.gemini/commands/aios-ux-ui.toml +8 -0
- package/template/AGENTS.md +67 -0
- package/template/CLAUDE.md +31 -0
- package/template/OPENCODE.md +24 -0
- package/template/aioson-models.json +40 -0
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
# React Motion Patterns
|
|
2
|
+
|
|
3
|
+
> React equivalents of the wow effects from static-html-patterns.md.
|
|
4
|
+
> Use Framer Motion as the primary animation library. Plain CSS animations as fallback when Framer Motion is not installed.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## When to apply this skill
|
|
9
|
+
|
|
10
|
+
Read this skill when:
|
|
11
|
+
- `framework=React` or `framework=Next.js`
|
|
12
|
+
- The project has visual/marketing pages, landing sections, or dashboards that need motion
|
|
13
|
+
- The user asks for "wow", "animado", "animação", "efeito", "moderno"
|
|
14
|
+
- `ui_style=Bold & Cinematic` in `project.context.md`
|
|
15
|
+
|
|
16
|
+
Do NOT apply heavy motion to pure admin/CRUD interfaces — motion must serve the user, not decorate data.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Dependencies
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Primary — install when any motion pattern is needed
|
|
24
|
+
npm install framer-motion
|
|
25
|
+
|
|
26
|
+
# For scroll-driven animations without Framer Motion
|
|
27
|
+
# Use Intersection Observer (built-in browser API — no install needed)
|
|
28
|
+
|
|
29
|
+
# For sliders
|
|
30
|
+
npm install swiper
|
|
31
|
+
|
|
32
|
+
# For tilt (lightweight, no Framer Motion dependency)
|
|
33
|
+
npm install vanilla-tilt
|
|
34
|
+
# or use the custom hook below (zero dependencies)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 1. Animated mesh background (hero section)
|
|
40
|
+
|
|
41
|
+
CSS-only. Works in React, Next.js, Vue — no JS library needed.
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
// components/ui/MeshBackground.tsx
|
|
45
|
+
export function MeshBackground() {
|
|
46
|
+
return (
|
|
47
|
+
<div className="mesh-bg" aria-hidden="true" />
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```css
|
|
53
|
+
/* styles/mesh.css — or inside CSS Module / Tailwind @layer */
|
|
54
|
+
.mesh-bg {
|
|
55
|
+
position: absolute;
|
|
56
|
+
inset: 0;
|
|
57
|
+
background:
|
|
58
|
+
radial-gradient(ellipse 120% 80% at -15% -10%, hsla(265, 70%, 55%, 0.28), transparent 60%),
|
|
59
|
+
radial-gradient(ellipse 80% 60% at 110% 20%, hsla(190, 80%, 55%, 0.22), transparent 55%),
|
|
60
|
+
radial-gradient(ellipse 60% 50% at 50% 110%, hsla(310, 75%, 65%, 0.18), transparent 60%),
|
|
61
|
+
hsl(240, 15%, 6%);
|
|
62
|
+
background-size: 200% 200%;
|
|
63
|
+
animation: meshDrift 20s ease infinite alternate;
|
|
64
|
+
z-index: 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@keyframes meshDrift {
|
|
68
|
+
0% { background-position: 0% 0%; }
|
|
69
|
+
33% { background-position: 60% 40%; }
|
|
70
|
+
66% { background-position: 40% 80%; }
|
|
71
|
+
100% { background-position: 100% 100%; }
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@media (prefers-reduced-motion: reduce) {
|
|
75
|
+
.mesh-bg { animation: none; }
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 2. Animated gradient text
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
// components/ui/GradientText.tsx
|
|
85
|
+
interface GradientTextProps {
|
|
86
|
+
children: React.ReactNode
|
|
87
|
+
className?: string
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function GradientText({ children, className }: GradientTextProps) {
|
|
91
|
+
return (
|
|
92
|
+
<span className={`gradient-text ${className ?? ''}`}>
|
|
93
|
+
{children}
|
|
94
|
+
</span>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
```css
|
|
100
|
+
.gradient-text {
|
|
101
|
+
background: linear-gradient(
|
|
102
|
+
135deg,
|
|
103
|
+
hsl(265, 80%, 65%),
|
|
104
|
+
hsl(190, 80%, 55%),
|
|
105
|
+
hsl(310, 75%, 65%),
|
|
106
|
+
hsl(265, 80%, 65%)
|
|
107
|
+
);
|
|
108
|
+
background-size: 300% 300%;
|
|
109
|
+
-webkit-background-clip: text;
|
|
110
|
+
background-clip: text;
|
|
111
|
+
-webkit-text-fill-color: transparent;
|
|
112
|
+
animation: textGradient 8s ease infinite;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@keyframes textGradient {
|
|
116
|
+
0%, 100% { background-position: 0% 50%; }
|
|
117
|
+
50% { background-position: 100% 50%; }
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@media (prefers-reduced-motion: reduce) {
|
|
121
|
+
.gradient-text {
|
|
122
|
+
animation: none;
|
|
123
|
+
background-position: 0% 50%;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Usage:
|
|
129
|
+
```tsx
|
|
130
|
+
<h1>The future of <GradientText>everything</GradientText></h1>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## 3. Scroll reveal (Framer Motion)
|
|
136
|
+
|
|
137
|
+
```tsx
|
|
138
|
+
// components/ui/Reveal.tsx
|
|
139
|
+
'use client' // Next.js only
|
|
140
|
+
import { motion } from 'framer-motion'
|
|
141
|
+
import { useInView } from 'framer-motion'
|
|
142
|
+
import { useRef } from 'react'
|
|
143
|
+
|
|
144
|
+
interface RevealProps {
|
|
145
|
+
children: React.ReactNode
|
|
146
|
+
delay?: number
|
|
147
|
+
className?: string
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export function Reveal({ children, delay = 0, className }: RevealProps) {
|
|
151
|
+
const ref = useRef(null)
|
|
152
|
+
const isInView = useInView(ref, { once: true, margin: '-80px' })
|
|
153
|
+
|
|
154
|
+
return (
|
|
155
|
+
<motion.div
|
|
156
|
+
ref={ref}
|
|
157
|
+
className={className}
|
|
158
|
+
initial={{ opacity: 0, y: 40 }}
|
|
159
|
+
animate={isInView ? { opacity: 1, y: 0 } : {}}
|
|
160
|
+
transition={{ duration: 0.6, delay, ease: [0.16, 1, 0.3, 1] }}
|
|
161
|
+
>
|
|
162
|
+
{children}
|
|
163
|
+
</motion.div>
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Usage — staggered reveal:
|
|
169
|
+
```tsx
|
|
170
|
+
<Reveal><SectionLabel>Features</SectionLabel></Reveal>
|
|
171
|
+
<Reveal delay={0.1}><h2>Everything you need</h2></Reveal>
|
|
172
|
+
<Reveal delay={0.2}><p>Supporting text here.</p></Reveal>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Without Framer Motion** — Intersection Observer hook:
|
|
176
|
+
```tsx
|
|
177
|
+
// hooks/useReveal.ts
|
|
178
|
+
import { useEffect, useRef, useState } from 'react'
|
|
179
|
+
|
|
180
|
+
export function useReveal(margin = '-80px') {
|
|
181
|
+
const ref = useRef<HTMLDivElement>(null)
|
|
182
|
+
const [visible, setVisible] = useState(false)
|
|
183
|
+
|
|
184
|
+
useEffect(() => {
|
|
185
|
+
const el = ref.current
|
|
186
|
+
if (!el) return
|
|
187
|
+
const observer = new IntersectionObserver(
|
|
188
|
+
([entry]) => { if (entry.isIntersecting) { setVisible(true); observer.disconnect() } },
|
|
189
|
+
{ rootMargin: margin }
|
|
190
|
+
)
|
|
191
|
+
observer.observe(el)
|
|
192
|
+
return () => observer.disconnect()
|
|
193
|
+
}, [margin])
|
|
194
|
+
|
|
195
|
+
return { ref, visible }
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Usage
|
|
199
|
+
function FeatureCard() {
|
|
200
|
+
const { ref, visible } = useReveal()
|
|
201
|
+
return (
|
|
202
|
+
<div
|
|
203
|
+
ref={ref}
|
|
204
|
+
style={{
|
|
205
|
+
opacity: visible ? 1 : 0,
|
|
206
|
+
transform: visible ? 'none' : 'translateY(40px)',
|
|
207
|
+
transition: 'opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1)',
|
|
208
|
+
}}
|
|
209
|
+
>
|
|
210
|
+
...
|
|
211
|
+
</div>
|
|
212
|
+
)
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## 4. 3D card tilt on hover
|
|
219
|
+
|
|
220
|
+
```tsx
|
|
221
|
+
// hooks/useTilt.ts
|
|
222
|
+
import { useRef } from 'react'
|
|
223
|
+
|
|
224
|
+
export function useTilt(intensity = 14) {
|
|
225
|
+
const ref = useRef<HTMLDivElement>(null)
|
|
226
|
+
|
|
227
|
+
function onMouseMove(e: React.MouseEvent<HTMLDivElement>) {
|
|
228
|
+
const card = ref.current
|
|
229
|
+
if (!card) return
|
|
230
|
+
const r = card.getBoundingClientRect()
|
|
231
|
+
const x = (e.clientX - r.left) / r.width - 0.5
|
|
232
|
+
const y = (e.clientY - r.top) / r.height - 0.5
|
|
233
|
+
card.style.transform = `perspective(700px) rotateY(${x * intensity}deg) rotateX(${-y * intensity}deg) translateZ(10px)`
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function onMouseLeave() {
|
|
237
|
+
if (ref.current) ref.current.style.transform = ''
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return { ref, onMouseMove, onMouseLeave }
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
```tsx
|
|
245
|
+
// components/ui/TiltCard.tsx
|
|
246
|
+
import { useTilt } from '@/hooks/useTilt'
|
|
247
|
+
|
|
248
|
+
interface TiltCardProps {
|
|
249
|
+
children: React.ReactNode
|
|
250
|
+
className?: string
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export function TiltCard({ children, className }: TiltCardProps) {
|
|
254
|
+
const { ref, onMouseMove, onMouseLeave } = useTilt()
|
|
255
|
+
|
|
256
|
+
return (
|
|
257
|
+
<div
|
|
258
|
+
ref={ref}
|
|
259
|
+
className={className}
|
|
260
|
+
onMouseMove={onMouseMove}
|
|
261
|
+
onMouseLeave={onMouseLeave}
|
|
262
|
+
style={{ transition: 'transform 0.15s ease', willChange: 'transform' }}
|
|
263
|
+
>
|
|
264
|
+
{children}
|
|
265
|
+
</div>
|
|
266
|
+
)
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Usage:
|
|
271
|
+
```tsx
|
|
272
|
+
<div className="features-grid">
|
|
273
|
+
{features.map(f => (
|
|
274
|
+
<TiltCard key={f.id} className="feature-card">
|
|
275
|
+
<span className="feature-icon">{f.icon}</span>
|
|
276
|
+
<h3>{f.title}</h3>
|
|
277
|
+
<p>{f.description}</p>
|
|
278
|
+
</TiltCard>
|
|
279
|
+
))}
|
|
280
|
+
</div>
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
> Disable on touch devices and `prefers-reduced-motion`:
|
|
284
|
+
```tsx
|
|
285
|
+
// In useTilt.ts — add guard at top of onMouseMove:
|
|
286
|
+
if (window.matchMedia('(hover: none)').matches) return
|
|
287
|
+
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## 5. Hero intro — staggered entrance (Framer Motion)
|
|
293
|
+
|
|
294
|
+
```tsx
|
|
295
|
+
// components/sections/Hero.tsx
|
|
296
|
+
'use client'
|
|
297
|
+
import { motion } from 'framer-motion'
|
|
298
|
+
|
|
299
|
+
const item = {
|
|
300
|
+
hidden: { opacity: 0, y: 30 },
|
|
301
|
+
show: { opacity: 1, y: 0, transition: { duration: 0.6, ease: [0.16, 1, 0.3, 1] } },
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
const container = {
|
|
305
|
+
hidden: {},
|
|
306
|
+
show: { transition: { staggerChildren: 0.12, delayChildren: 0.1 } },
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export function Hero() {
|
|
310
|
+
return (
|
|
311
|
+
<section className="hero">
|
|
312
|
+
<MeshBackground />
|
|
313
|
+
<motion.div
|
|
314
|
+
className="hero__content"
|
|
315
|
+
variants={container}
|
|
316
|
+
initial="hidden"
|
|
317
|
+
animate="show"
|
|
318
|
+
>
|
|
319
|
+
<motion.span variants={item} className="hero__label">
|
|
320
|
+
Category / Tagline
|
|
321
|
+
</motion.span>
|
|
322
|
+
<motion.h1 variants={item} className="hero__title">
|
|
323
|
+
Bold headline that <GradientText>changes everything</GradientText>
|
|
324
|
+
</motion.h1>
|
|
325
|
+
<motion.p variants={item} className="hero__subtitle">
|
|
326
|
+
Supporting text with real context — who benefits, how, what outcome.
|
|
327
|
+
</motion.p>
|
|
328
|
+
<motion.div variants={item} className="hero__actions">
|
|
329
|
+
<a href="#signup" className="btn btn--primary">Get started</a>
|
|
330
|
+
<a href="#demo" className="btn btn--ghost">Watch demo</a>
|
|
331
|
+
</motion.div>
|
|
332
|
+
</motion.div>
|
|
333
|
+
</section>
|
|
334
|
+
)
|
|
335
|
+
}
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## 6. Infinite logo marquee (CSS only)
|
|
341
|
+
|
|
342
|
+
```tsx
|
|
343
|
+
// components/ui/Marquee.tsx
|
|
344
|
+
interface MarqueeProps {
|
|
345
|
+
items: React.ReactNode[]
|
|
346
|
+
speed?: number // seconds for one full loop
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export function Marquee({ items, speed = 24 }: MarqueeProps) {
|
|
350
|
+
// Duplicate items to create seamless loop
|
|
351
|
+
const doubled = [...items, ...items]
|
|
352
|
+
|
|
353
|
+
return (
|
|
354
|
+
<div className="marquee" aria-hidden="true">
|
|
355
|
+
<div
|
|
356
|
+
className="marquee__track"
|
|
357
|
+
style={{ animationDuration: `${speed}s` }}
|
|
358
|
+
>
|
|
359
|
+
{doubled.map((item, i) => (
|
|
360
|
+
<div key={i} className="marquee__item">{item}</div>
|
|
361
|
+
))}
|
|
362
|
+
</div>
|
|
363
|
+
</div>
|
|
364
|
+
)
|
|
365
|
+
}
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
```css
|
|
369
|
+
.marquee {
|
|
370
|
+
overflow: hidden;
|
|
371
|
+
mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.marquee__track {
|
|
375
|
+
display: flex;
|
|
376
|
+
gap: 3rem;
|
|
377
|
+
width: max-content;
|
|
378
|
+
animation: infiniteSlide linear infinite;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.marquee:hover .marquee__track {
|
|
382
|
+
animation-play-state: paused;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
@keyframes infiniteSlide {
|
|
386
|
+
from { transform: translateX(0); }
|
|
387
|
+
to { transform: translateX(-50%); }
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
@media (prefers-reduced-motion: reduce) {
|
|
391
|
+
.marquee__track { animation: none; }
|
|
392
|
+
}
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
---
|
|
396
|
+
|
|
397
|
+
## 7. Scroll progress bar
|
|
398
|
+
|
|
399
|
+
```tsx
|
|
400
|
+
// components/ui/ScrollProgress.tsx
|
|
401
|
+
'use client'
|
|
402
|
+
import { useScroll, useSpring, motion } from 'framer-motion'
|
|
403
|
+
|
|
404
|
+
export function ScrollProgress() {
|
|
405
|
+
const { scrollYProgress } = useScroll()
|
|
406
|
+
const scaleX = useSpring(scrollYProgress, { stiffness: 100, damping: 30 })
|
|
407
|
+
|
|
408
|
+
return (
|
|
409
|
+
<motion.div
|
|
410
|
+
className="scroll-progress"
|
|
411
|
+
style={{ scaleX, transformOrigin: 'left' }}
|
|
412
|
+
/>
|
|
413
|
+
)
|
|
414
|
+
}
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
```css
|
|
418
|
+
.scroll-progress {
|
|
419
|
+
position: fixed;
|
|
420
|
+
top: 0;
|
|
421
|
+
left: 0;
|
|
422
|
+
right: 0;
|
|
423
|
+
height: 3px;
|
|
424
|
+
background: linear-gradient(to right, hsl(265, 80%, 65%), hsl(190, 80%, 55%));
|
|
425
|
+
z-index: 1000;
|
|
426
|
+
}
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
---
|
|
430
|
+
|
|
431
|
+
## 8. Glassmorphism card
|
|
432
|
+
|
|
433
|
+
```tsx
|
|
434
|
+
// components/ui/GlassCard.tsx
|
|
435
|
+
export function GlassCard({ children, className }: { children: React.ReactNode; className?: string }) {
|
|
436
|
+
return (
|
|
437
|
+
<div className={`glass-card ${className ?? ''}`}>
|
|
438
|
+
{children}
|
|
439
|
+
</div>
|
|
440
|
+
)
|
|
441
|
+
}
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
```css
|
|
445
|
+
.glass-card {
|
|
446
|
+
background: hsla(240, 20%, 100%, 0.04);
|
|
447
|
+
border: 1px solid hsla(240, 20%, 100%, 0.08);
|
|
448
|
+
backdrop-filter: blur(12px);
|
|
449
|
+
-webkit-backdrop-filter: blur(12px);
|
|
450
|
+
border-radius: 16px;
|
|
451
|
+
padding: 1.5rem;
|
|
452
|
+
/* Subtle inner glow */
|
|
453
|
+
box-shadow:
|
|
454
|
+
0 0 0 1px hsla(265, 70%, 65%, 0.08),
|
|
455
|
+
inset 0 1px 0 hsla(240, 100%, 100%, 0.05);
|
|
456
|
+
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.glass-card:hover {
|
|
460
|
+
border-color: hsla(265, 70%, 65%, 0.25);
|
|
461
|
+
box-shadow:
|
|
462
|
+
0 0 0 1px hsla(265, 70%, 65%, 0.15),
|
|
463
|
+
0 8px 32px hsla(265, 70%, 55%, 0.12),
|
|
464
|
+
inset 0 1px 0 hsla(240, 100%, 100%, 0.08);
|
|
465
|
+
}
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
---
|
|
469
|
+
|
|
470
|
+
## 9. Floating orbs (decorative)
|
|
471
|
+
|
|
472
|
+
```tsx
|
|
473
|
+
// components/ui/FloatingOrbs.tsx
|
|
474
|
+
export function FloatingOrbs() {
|
|
475
|
+
return (
|
|
476
|
+
<div className="orbs" aria-hidden="true">
|
|
477
|
+
<div className="orb orb--1" />
|
|
478
|
+
<div className="orb orb--2" />
|
|
479
|
+
<div className="orb orb--3" />
|
|
480
|
+
</div>
|
|
481
|
+
)
|
|
482
|
+
}
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
```css
|
|
486
|
+
.orbs {
|
|
487
|
+
position: absolute;
|
|
488
|
+
inset: 0;
|
|
489
|
+
overflow: hidden;
|
|
490
|
+
pointer-events: none;
|
|
491
|
+
z-index: 0;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.orb {
|
|
495
|
+
position: absolute;
|
|
496
|
+
border-radius: 50%;
|
|
497
|
+
filter: blur(60px);
|
|
498
|
+
opacity: 0.35;
|
|
499
|
+
animation: orbFloat 12s ease-in-out infinite;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.orb--1 {
|
|
503
|
+
width: 500px; height: 500px;
|
|
504
|
+
top: -200px; left: -100px;
|
|
505
|
+
background: radial-gradient(circle, hsl(265, 80%, 60%), transparent 70%);
|
|
506
|
+
animation-delay: 0s;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.orb--2 {
|
|
510
|
+
width: 400px; height: 400px;
|
|
511
|
+
top: 30%; right: -150px;
|
|
512
|
+
background: radial-gradient(circle, hsl(190, 80%, 55%), transparent 70%);
|
|
513
|
+
animation-delay: -4s;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
.orb--3 {
|
|
517
|
+
width: 350px; height: 350px;
|
|
518
|
+
bottom: -100px; left: 40%;
|
|
519
|
+
background: radial-gradient(circle, hsl(310, 75%, 60%), transparent 70%);
|
|
520
|
+
animation-delay: -8s;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
@keyframes orbFloat {
|
|
524
|
+
0%, 100% { transform: translate(0, 0) scale(1); }
|
|
525
|
+
33% { transform: translate(30px, -40px) scale(1.05); }
|
|
526
|
+
66% { transform: translate(-20px, 20px) scale(0.95); }
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
@media (prefers-reduced-motion: reduce) {
|
|
530
|
+
.orb { animation: none; }
|
|
531
|
+
}
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
---
|
|
535
|
+
|
|
536
|
+
## 10. Page transition (Next.js App Router)
|
|
537
|
+
|
|
538
|
+
```tsx
|
|
539
|
+
// components/ui/PageTransition.tsx
|
|
540
|
+
'use client'
|
|
541
|
+
import { motion, AnimatePresence } from 'framer-motion'
|
|
542
|
+
import { usePathname } from 'next/navigation'
|
|
543
|
+
|
|
544
|
+
export function PageTransition({ children }: { children: React.ReactNode }) {
|
|
545
|
+
const pathname = usePathname()
|
|
546
|
+
|
|
547
|
+
return (
|
|
548
|
+
<AnimatePresence mode="wait">
|
|
549
|
+
<motion.div
|
|
550
|
+
key={pathname}
|
|
551
|
+
initial={{ opacity: 0, y: 8 }}
|
|
552
|
+
animate={{ opacity: 1, y: 0 }}
|
|
553
|
+
exit={{ opacity: 0, y: -8 }}
|
|
554
|
+
transition={{ duration: 0.25, ease: 'easeInOut' }}
|
|
555
|
+
>
|
|
556
|
+
{children}
|
|
557
|
+
</motion.div>
|
|
558
|
+
</AnimatePresence>
|
|
559
|
+
)
|
|
560
|
+
}
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
Add to `app/layout.tsx`:
|
|
564
|
+
```tsx
|
|
565
|
+
<PageTransition>{children}</PageTransition>
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
---
|
|
569
|
+
|
|
570
|
+
## Hard rules
|
|
571
|
+
|
|
572
|
+
- Always include `prefers-reduced-motion` fallback for every animation
|
|
573
|
+
- Never animate layout properties (width, height, top, left) — animate `transform` and `opacity` only
|
|
574
|
+
- Keep animation durations short for UI (150–300ms), longer for hero/decorative (600ms–20s)
|
|
575
|
+
- Tilt and 3D effects must be disabled on touch devices (`hover: none` media query)
|
|
576
|
+
- Do not install Framer Motion just for one CSS animation — use plain CSS keyframes instead
|
|
577
|
+
- Keep decorative elements (`orbs`, `mesh`, `marquee`) `aria-hidden="true"` and `pointer-events: none`
|