@jaimevalasek/aioson 1.6.0 → 1.7.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 +49 -0
- package/README.md +729 -232
- package/docs/design-previews/pt.squarespace.com-homepage.html +889 -0
- package/docs/integrations/sdlc-genius-boundary.md +76 -0
- package/docs/integrations/sdlc-genius-eval-matrix.md +75 -0
- package/docs/integrations/sdlc-genius-install-checklist.md +93 -0
- package/docs/integrations/sdlc-genius-review-samples.md +86 -0
- package/docs/pt/README.md +3 -0
- package/docs/pt/agentes.md +1 -0
- package/docs/pt/comandos-cli.md +888 -2
- package/docs/pt/design-hybrid-forge.md +255 -6
- package/docs/pt/devlog-pipeline.md +270 -0
- package/docs/pt/fluxo-artefatos.md +178 -0
- package/docs/pt/hooks-session-guard.md +454 -0
- package/docs/pt/monitor-de-contexto.md +59 -5
- package/docs/pt/sdd-automation-scripts.md +557 -0
- package/docs/pt/site-forge.md +309 -0
- package/docs/pt/spec-learnings-pipeline.md +265 -0
- package/package.json +1 -1
- package/src/a2a/client.js +165 -0
- package/src/a2a/server.js +223 -0
- package/src/cli.js +235 -1
- package/src/commands/agent-audit.js +397 -0
- package/src/commands/agent-export-skill.js +229 -0
- package/src/commands/artifact-validate.js +189 -0
- package/src/commands/brief-gen.js +405 -0
- package/src/commands/brief-validate.js +65 -0
- package/src/commands/classify.js +256 -0
- package/src/commands/context-compact.js +49 -0
- package/src/commands/context-health.js +175 -0
- package/src/commands/context-monitor.js +71 -0
- package/src/commands/context-trim.js +177 -0
- package/src/commands/detect-test-runner.js +55 -0
- package/src/commands/devlog-export-brains.js +27 -0
- package/src/commands/devlog-process.js +292 -0
- package/src/commands/devlog-watch.js +131 -0
- package/src/commands/feature-close.js +165 -0
- package/src/commands/gate-check.js +228 -0
- package/src/commands/hooks-emit.js +253 -0
- package/src/commands/hooks-install.js +347 -0
- package/src/commands/learning-auto-promote.js +195 -0
- package/src/commands/learning-evolve.js +18 -9
- package/src/commands/learning-export.js +103 -0
- package/src/commands/learning-rollback.js +164 -0
- package/src/commands/live.js +25 -1
- package/src/commands/pattern-detect.js +33 -0
- package/src/commands/preflight-context.js +30 -0
- package/src/commands/preflight.js +208 -0
- package/src/commands/pulse-update.js +130 -0
- package/src/commands/runner-daemon.js +274 -0
- package/src/commands/runner-plan.js +70 -0
- package/src/commands/runner-queue-from-plan.js +166 -0
- package/src/commands/runner-queue.js +189 -0
- package/src/commands/runner-run.js +129 -0
- package/src/commands/runtime.js +47 -1
- package/src/commands/self-implement-loop.js +256 -0
- package/src/commands/session-guard.js +218 -0
- package/src/commands/sizing.js +165 -0
- package/src/commands/skill.js +65 -0
- package/src/commands/spec-checkpoint.js +177 -0
- package/src/commands/spec-status.js +79 -0
- package/src/commands/spec-sync.js +190 -0
- package/src/commands/spec-tasks.js +288 -0
- package/src/commands/squad-autorun.js +1220 -0
- package/src/commands/squad-bus.js +217 -0
- package/src/commands/squad-card.js +149 -0
- package/src/commands/squad-daemon.js +134 -0
- package/src/commands/squad-dependency-graph.js +164 -0
- package/src/commands/squad-review.js +106 -0
- package/src/commands/squad-scaffold.js +55 -0
- package/src/commands/squad-tool-register.js +157 -0
- package/src/commands/state-save.js +122 -0
- package/src/commands/update.js +2 -0
- package/src/commands/verify-gate.js +572 -0
- package/src/commands/workflow-execute.js +241 -0
- package/src/constants.js +9 -0
- package/src/install-profile.js +2 -2
- package/src/install-wizard.js +3 -2
- package/src/installer.js +6 -0
- package/src/lib/health-check.js +158 -0
- package/src/lib/hook-protocol.js +76 -0
- package/src/mcp/apps/squad-dashboard/app.js +163 -0
- package/src/mcp/apps/squad-dashboard/index.html +261 -0
- package/src/mcp/apps/squad-dashboard/mcp-manifest.json +23 -0
- package/src/mcp/resources/squad-state.js +130 -0
- package/src/preflight-engine.js +443 -0
- package/src/runner/cascade.js +97 -0
- package/src/runner/cli-launcher.js +109 -0
- package/src/runner/plan-importer.js +63 -0
- package/src/runner/queue-store.js +159 -0
- package/src/runtime-store.js +61 -3
- package/src/squad/agent-teams-adapter.js +264 -0
- package/src/squad/brief-validator.js +350 -0
- package/src/squad/bus-bridge.js +140 -0
- package/src/squad/context-compactor.js +265 -0
- package/src/squad/cross-ai-synthesizer.js +250 -0
- package/src/squad/hooks-generator.js +196 -0
- package/src/squad/inter-squad-events.js +175 -0
- package/src/squad/intra-bus.js +345 -0
- package/src/squad/learning-extractor.js +213 -0
- package/src/squad/pattern-detector.js +365 -0
- package/src/squad/preflight-context.js +296 -0
- package/src/squad/recovery-context.js +242 -71
- package/src/squad/reflection.js +365 -0
- package/src/squad/squad-scaffold.js +177 -0
- package/src/squad/state-manager.js +310 -0
- package/src/squad/task-decomposer.js +652 -0
- package/src/squad/verify-gate.js +303 -0
- package/src/updater.js +4 -5
- package/src/worker-runner.js +186 -1
- package/template/.aioson/agents/analyst.md +62 -1
- package/template/.aioson/agents/architect.md +61 -1
- package/template/.aioson/agents/design-hybrid-forge.md +14 -0
- package/template/.aioson/agents/dev.md +242 -24
- package/template/.aioson/agents/deyvin.md +66 -8
- package/template/.aioson/agents/discovery-design-doc.md +44 -0
- package/template/.aioson/agents/genome.md +14 -0
- package/template/.aioson/agents/neo.md +78 -1
- package/template/.aioson/agents/orache.md +50 -4
- package/template/.aioson/agents/orchestrator.md +197 -1
- package/template/.aioson/agents/pm.md +35 -0
- package/template/.aioson/agents/product.md +50 -5
- package/template/.aioson/agents/profiler-enricher.md +14 -0
- package/template/.aioson/agents/profiler-forge.md +14 -0
- package/template/.aioson/agents/profiler-researcher.md +14 -0
- package/template/.aioson/agents/qa.md +172 -21
- package/template/.aioson/agents/setup.md +79 -9
- package/template/.aioson/agents/sheldon.md +131 -6
- package/template/.aioson/agents/site-forge.md +1753 -0
- package/template/.aioson/agents/squad.md +162 -0
- package/template/.aioson/agents/tester.md +53 -0
- package/template/.aioson/agents/ux-ui.md +34 -1
- package/template/.aioson/brains/README.md +128 -0
- package/template/.aioson/brains/_index.json +16 -0
- package/template/.aioson/brains/scripts/query.js +103 -0
- package/template/.aioson/brains/site-forge/visual-patterns.brain.json +205 -0
- package/template/.aioson/config.md +143 -13
- package/template/.aioson/constitution.md +33 -0
- package/template/.aioson/context/project-pulse.md +34 -0
- package/template/.aioson/docs/LAYERS.md +79 -0
- package/template/.aioson/docs/README.md +76 -0
- package/template/.aioson/docs/example-external-api-context.md +72 -0
- package/template/.aioson/locales/en/agents/architect.md +17 -0
- package/template/.aioson/locales/en/agents/dev.md +79 -13
- package/template/.aioson/locales/en/agents/orache.md +6 -0
- package/template/.aioson/locales/en/agents/orchestrator.md +24 -0
- package/template/.aioson/locales/en/agents/product.md +50 -0
- package/template/.aioson/locales/en/agents/sheldon.md +115 -0
- package/template/.aioson/locales/en/agents/squad.md +14 -0
- package/template/.aioson/locales/en/agents/tester.md +6 -0
- package/template/.aioson/locales/es/agents/analyst.md +2 -0
- package/template/.aioson/locales/es/agents/architect.md +19 -0
- package/template/.aioson/locales/es/agents/dev.md +64 -4
- package/template/.aioson/locales/es/agents/deyvin.md +2 -0
- package/template/.aioson/locales/es/agents/discovery-design-doc.md +2 -0
- package/template/.aioson/locales/es/agents/genome.md +2 -0
- package/template/.aioson/locales/es/agents/neo.md +2 -0
- package/template/.aioson/locales/es/agents/orache.md +2 -0
- package/template/.aioson/locales/es/agents/orchestrator.md +26 -0
- package/template/.aioson/locales/es/agents/pair.md +2 -0
- package/template/.aioson/locales/es/agents/pm.md +2 -0
- package/template/.aioson/locales/es/agents/product.md +52 -0
- package/template/.aioson/locales/es/agents/profiler-enricher.md +2 -0
- package/template/.aioson/locales/es/agents/profiler-forge.md +2 -0
- package/template/.aioson/locales/es/agents/profiler-researcher.md +2 -0
- package/template/.aioson/locales/es/agents/qa.md +2 -0
- package/template/.aioson/locales/es/agents/setup.md +2 -0
- package/template/.aioson/locales/es/agents/sheldon.md +117 -0
- package/template/.aioson/locales/es/agents/squad.md +16 -0
- package/template/.aioson/locales/es/agents/tester.md +9 -0
- package/template/.aioson/locales/es/agents/ux-ui.md +2 -0
- package/template/.aioson/locales/fr/agents/analyst.md +2 -0
- package/template/.aioson/locales/fr/agents/architect.md +19 -0
- package/template/.aioson/locales/fr/agents/dev.md +64 -4
- package/template/.aioson/locales/fr/agents/deyvin.md +2 -0
- package/template/.aioson/locales/fr/agents/discovery-design-doc.md +2 -0
- package/template/.aioson/locales/fr/agents/genome.md +2 -0
- package/template/.aioson/locales/fr/agents/neo.md +2 -0
- package/template/.aioson/locales/fr/agents/orache.md +2 -0
- package/template/.aioson/locales/fr/agents/orchestrator.md +26 -0
- package/template/.aioson/locales/fr/agents/pair.md +2 -0
- package/template/.aioson/locales/fr/agents/pm.md +2 -0
- package/template/.aioson/locales/fr/agents/product.md +52 -0
- package/template/.aioson/locales/fr/agents/profiler-enricher.md +2 -0
- package/template/.aioson/locales/fr/agents/profiler-forge.md +2 -0
- package/template/.aioson/locales/fr/agents/profiler-researcher.md +2 -0
- package/template/.aioson/locales/fr/agents/qa.md +2 -0
- package/template/.aioson/locales/fr/agents/setup.md +2 -0
- package/template/.aioson/locales/fr/agents/sheldon.md +117 -0
- package/template/.aioson/locales/fr/agents/squad.md +16 -0
- package/template/.aioson/locales/fr/agents/tester.md +9 -0
- package/template/.aioson/locales/fr/agents/ux-ui.md +2 -0
- package/template/.aioson/locales/pt-BR/agents/analyst.md +64 -3
- package/template/.aioson/locales/pt-BR/agents/architect.md +42 -0
- package/template/.aioson/locales/pt-BR/agents/dev.md +147 -14
- package/template/.aioson/locales/pt-BR/agents/deyvin.md +47 -0
- package/template/.aioson/locales/pt-BR/agents/neo.md +62 -1
- package/template/.aioson/locales/pt-BR/agents/orchestrator.md +158 -2
- package/template/.aioson/locales/pt-BR/agents/pm.md +95 -1
- package/template/.aioson/locales/pt-BR/agents/product.md +145 -18
- package/template/.aioson/locales/pt-BR/agents/qa.md +16 -0
- package/template/.aioson/locales/pt-BR/agents/setup.md +101 -18
- package/template/.aioson/locales/pt-BR/agents/sheldon.md +132 -1
- package/template/.aioson/locales/pt-BR/agents/squad.md +14 -0
- package/template/.aioson/locales/pt-BR/agents/tester.md +449 -0
- package/template/.aioson/rules/README.md +69 -0
- package/template/.aioson/rules/data-format-convention.md +136 -0
- package/template/.aioson/rules/example-monetary-values.md +30 -0
- package/template/.aioson/schemas/squad-manifest.schema.json +124 -3
- package/template/.aioson/skills/design/pt.squarespace.com/.skill-meta.json +31 -0
- package/template/.aioson/skills/design/pt.squarespace.com/SKILL.md +66 -0
- package/template/.aioson/skills/design/pt.squarespace.com/references/components.md +368 -0
- package/template/.aioson/skills/design/pt.squarespace.com/references/design-tokens.md +150 -0
- package/template/.aioson/skills/design/pt.squarespace.com/references/motion.md +270 -0
- package/template/.aioson/skills/design/pt.squarespace.com/references/patterns.md +189 -0
- package/template/.aioson/skills/design/pt.squarespace.com/references/websites.md +165 -0
- package/template/.aioson/skills/process/aioson-spec-driven/SKILL.md +1 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/analyst.md +30 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/architect.md +23 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/dev.md +47 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/deyvin.md +27 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/maintenance-and-state.md +35 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/product.md +25 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/qa.md +30 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/sheldon.md +25 -0
- package/template/.aioson/skills/process/design-hybrid-forge/SKILL.md +4 -1
- package/template/.aioson/skills/process/design-hybrid-forge/references/output-contract.md +15 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/pair-compatibility.md +32 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/quality-gates.md +20 -0
- package/template/.aioson/skills/process/simplify/SKILL.md +173 -0
- package/template/.aioson/skills/static/context-budget-guide.md +46 -0
- package/template/.aioson/skills/static/harness-sensors.md +74 -0
- package/template/.aioson/skills/static/multi-agent-patterns.md +43 -0
- package/template/.aioson/skills/static/react-motion-patterns.md +22 -0
- package/template/.aioson/skills/static/static-html-patterns/checklists.md +43 -0
- package/template/.aioson/skills/static/static-html-patterns/css-tokens.md +609 -0
- package/template/.aioson/skills/static/static-html-patterns/motion.md +193 -0
- package/template/.aioson/skills/static/static-html-patterns/premium.md +711 -0
- package/template/.aioson/skills/static/static-html-patterns/structure.md +209 -0
- package/template/.aioson/skills/static/static-html-patterns/utilities.md +190 -0
- package/template/.aioson/skills/static/static-html-patterns.md +58 -1913
- package/template/.aioson/skills/static/threejs-patterns.md +929 -0
- package/template/.aioson/skills/static/web-research-cache.md +112 -0
- package/template/.aioson/tasks/implementation-plan.md +21 -1
- package/template/.claude/commands/aioson/agent/design-hybrid-forge.md +5 -0
- package/template/.claude/commands/aioson/agent/orache.md +5 -0
- package/template/.claude/commands/aioson/agent/sheldon.md +5 -0
- package/template/.claude/commands/aioson/agent/site-forge.md +5 -0
- package/template/AGENTS.md +55 -3
- package/template/CLAUDE.md +30 -0
- package/template/OPENCODE.md +4 -0
- package/template/researchs/.gitkeep +0 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# Motion — GSAP Animations & Swiper Sliders
|
|
2
|
+
|
|
3
|
+
> Load when implementing scroll animations, entrance effects, hero timelines,
|
|
4
|
+
> counter animations, or any carousel/slider component.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 9. GSAP Animations — Production Patterns (AI Agency / SaaS style)
|
|
9
|
+
|
|
10
|
+
Source: Aigocy / GSAP ScrollTrigger — gsap.com/docs/v3/Plugins/ScrollTrigger
|
|
11
|
+
|
|
12
|
+
### Setup
|
|
13
|
+
|
|
14
|
+
```html
|
|
15
|
+
<script src="https://cdn.jsdelivr.net/npm/gsap@3/dist/gsap.min.js" defer></script>
|
|
16
|
+
<script src="https://cdn.jsdelivr.net/npm/gsap@3/dist/ScrollTrigger.min.js" defer></script>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
// Register plugin once
|
|
21
|
+
gsap.registerPlugin(ScrollTrigger);
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Reusable animation helpers (add to main.js)
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
// 1. Reveal elements on scroll (fade + translateY)
|
|
28
|
+
function revealOnScroll(selector, options = {}) {
|
|
29
|
+
const els = document.querySelectorAll(selector);
|
|
30
|
+
if (!els.length) return;
|
|
31
|
+
gsap.fromTo(els,
|
|
32
|
+
{ opacity: 0, y: options.y ?? 40 },
|
|
33
|
+
{
|
|
34
|
+
opacity: 1, y: 0,
|
|
35
|
+
duration: options.duration ?? 0.7,
|
|
36
|
+
ease: 'power3.out',
|
|
37
|
+
stagger: options.stagger ?? 0.1,
|
|
38
|
+
scrollTrigger: {
|
|
39
|
+
trigger: els[0].closest('section') ?? els[0],
|
|
40
|
+
start: 'top 80%',
|
|
41
|
+
once: true,
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// 2. Hero intro sequence (run on load, not scroll)
|
|
48
|
+
function heroIntroTimeline() {
|
|
49
|
+
return gsap.timeline({ delay: 0.2 })
|
|
50
|
+
.from('.hero__label', { opacity: 0, y: 20, duration: 0.5, ease: 'power2.out' })
|
|
51
|
+
.from('.hero__title', { opacity: 0, y: 30, duration: 0.7, ease: 'power3.out' }, '-=0.2')
|
|
52
|
+
.from('.hero__subtitle', { opacity: 0, y: 20, duration: 0.6, ease: 'power2.out' }, '-=0.4')
|
|
53
|
+
.from('.hero__actions', { opacity: 0, y: 20, duration: 0.5, ease: 'power2.out' }, '-=0.3')
|
|
54
|
+
.from('.hero__social-proof', { opacity: 0, duration: 0.4 }, '-=0.2');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// 3. Card grid stagger (features, services, team)
|
|
58
|
+
function cardsStaggerIn(sectionSelector) {
|
|
59
|
+
const section = document.querySelector(sectionSelector);
|
|
60
|
+
if (!section) return;
|
|
61
|
+
gsap.fromTo(section.querySelectorAll('.card, .feature-card, .service-card'),
|
|
62
|
+
{ opacity: 0, y: 50, scale: 0.97 },
|
|
63
|
+
{
|
|
64
|
+
opacity: 1, y: 0, scale: 1,
|
|
65
|
+
duration: 0.6, ease: 'power3.out', stagger: 0.1,
|
|
66
|
+
scrollTrigger: { trigger: section, start: 'top 75%', once: true }
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// 4. Light parallax on hero background
|
|
72
|
+
function parallaxLight(selector) {
|
|
73
|
+
gsap.to(selector, {
|
|
74
|
+
yPercent: 30,
|
|
75
|
+
ease: 'none',
|
|
76
|
+
scrollTrigger: { trigger: selector, start: 'top top', end: 'bottom top', scrub: true }
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// 5. Counter animation (stats section)
|
|
81
|
+
function animateCounters() {
|
|
82
|
+
document.querySelectorAll('[data-counter]').forEach(el => {
|
|
83
|
+
const target = +el.dataset.counter;
|
|
84
|
+
ScrollTrigger.create({
|
|
85
|
+
trigger: el, start: 'top 85%', once: true,
|
|
86
|
+
onEnter: () => {
|
|
87
|
+
gsap.fromTo(el,
|
|
88
|
+
{ textContent: 0 },
|
|
89
|
+
{
|
|
90
|
+
textContent: target, duration: 1.5, ease: 'power2.out',
|
|
91
|
+
snap: { textContent: 1 },
|
|
92
|
+
onUpdate() { el.textContent = Math.round(+el.textContent).toLocaleString(); }
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// 6. Animated gradient border on hover (section highlight)
|
|
101
|
+
function initGlowCards() {
|
|
102
|
+
document.querySelectorAll('.card--glow-border').forEach(card => {
|
|
103
|
+
card.addEventListener('mousemove', (e) => {
|
|
104
|
+
const rect = card.getBoundingClientRect();
|
|
105
|
+
const x = ((e.clientX - rect.left) / rect.width * 100).toFixed(1);
|
|
106
|
+
const y = ((e.clientY - rect.top) / rect.height * 100).toFixed(1);
|
|
107
|
+
card.style.setProperty('--mouse-x', `${x}%`);
|
|
108
|
+
card.style.setProperty('--mouse-y', `${y}%`);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Initialize on DOM ready
|
|
114
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
115
|
+
heroIntroTimeline();
|
|
116
|
+
revealOnScroll('.section-header', { y: 30 });
|
|
117
|
+
revealOnScroll('.step', { stagger: 0.15 });
|
|
118
|
+
revealOnScroll('.testimonial-card', { stagger: 0.1 });
|
|
119
|
+
revealOnScroll('.cta-final__title', { y: 20 });
|
|
120
|
+
cardsStaggerIn('.features');
|
|
121
|
+
cardsStaggerIn('.services');
|
|
122
|
+
parallaxLight('.hero__bg img');
|
|
123
|
+
animateCounters();
|
|
124
|
+
initGlowCards();
|
|
125
|
+
});
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Anti-patterns to avoid
|
|
129
|
+
- Do NOT put all scroll animations in one giant master timeline
|
|
130
|
+
- Do NOT animate `width`, `height`, or `padding` — only `transform` and `opacity`
|
|
131
|
+
- Do NOT run heavy GSAP work in `scroll` event — always use ScrollTrigger
|
|
132
|
+
- Always `once: true` for entrance animations (don't re-trigger on scroll up)
|
|
133
|
+
- Disable GSAP on `prefers-reduced-motion`:
|
|
134
|
+
|
|
135
|
+
```js
|
|
136
|
+
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
|
|
137
|
+
gsap.globalTimeline.timeScale(0); // or skip init entirely
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 10. Swiper Sliders — Production Patterns
|
|
144
|
+
|
|
145
|
+
Source: swiperjs.com/swiper-api
|
|
146
|
+
|
|
147
|
+
### CDN
|
|
148
|
+
|
|
149
|
+
```html
|
|
150
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css">
|
|
151
|
+
<script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js" defer></script>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### HTML Structure
|
|
155
|
+
|
|
156
|
+
```html
|
|
157
|
+
<div class="swiper testimonials-swiper" data-swiper-options='{"slidesPerView":1,"spaceBetween":24}'>
|
|
158
|
+
<div class="swiper-wrapper">
|
|
159
|
+
<div class="swiper-slide"><!-- content --></div>
|
|
160
|
+
<div class="swiper-slide"><!-- content --></div>
|
|
161
|
+
</div>
|
|
162
|
+
<div class="swiper-pagination" aria-hidden="true"></div>
|
|
163
|
+
<button class="swiper-button-prev" aria-label="Previous slide"></button>
|
|
164
|
+
<button class="swiper-button-next" aria-label="Next slide"></button>
|
|
165
|
+
</div>
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Universal Init (handles multiple sliders via data-attribute)
|
|
169
|
+
|
|
170
|
+
```js
|
|
171
|
+
document.querySelectorAll('.swiper').forEach(el => {
|
|
172
|
+
const options = el.dataset.swiperOptions ? JSON.parse(el.dataset.swiperOptions) : {};
|
|
173
|
+
new Swiper(el, {
|
|
174
|
+
loop: true,
|
|
175
|
+
navigation: { nextEl: el.querySelector('.swiper-button-next'), prevEl: el.querySelector('.swiper-button-prev') },
|
|
176
|
+
pagination: { el: el.querySelector('.swiper-pagination'), clickable: true },
|
|
177
|
+
a11y: { prevSlideMessage: 'Previous slide', nextSlideMessage: 'Next slide' },
|
|
178
|
+
breakpoints: {
|
|
179
|
+
768: { slidesPerView: 2, spaceBetween: 24 },
|
|
180
|
+
1024: { slidesPerView: 3, spaceBetween: 32 },
|
|
181
|
+
},
|
|
182
|
+
...options, // data-attribute options override defaults
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### CSS: fix slider CLS (layout shift)
|
|
188
|
+
|
|
189
|
+
```css
|
|
190
|
+
.swiper { overflow: hidden; }
|
|
191
|
+
.swiper-wrapper { display: flex; align-items: stretch; }
|
|
192
|
+
.swiper-slide { height: auto; } /* equal height cards */
|
|
193
|
+
```
|