@struq/skill 0.0.0-stage → 0.2.1
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/LICENSE +21 -0
- package/README.md +133 -2
- package/bin/struq.mjs +132 -0
- package/package.json +41 -4
- package/skills/struq/SKILL.md +237 -0
- package/skills/struq/cinematic/README.md +409 -0
- package/skills/struq/cinematic/checklists/01-preproduction.md +15 -0
- package/skills/struq/cinematic/checklists/02-implementation.md +17 -0
- package/skills/struq/cinematic/checklists/03-polish.md +17 -0
- package/skills/struq/cinematic/examples/code/nextjs/README.md +13 -0
- package/skills/struq/cinematic/examples/code/nextjs/app/cinematic-experience.tsx +13 -0
- package/skills/struq/cinematic/examples/code/nextjs/app/components/LenisRoot.tsx +42 -0
- package/skills/struq/cinematic/examples/code/nextjs/app/page.tsx +6 -0
- package/skills/struq/cinematic/examples/code/shared/CameraRig.tsx +65 -0
- package/skills/struq/cinematic/examples/code/shared/ExperienceCanvas.tsx +20 -0
- package/skills/struq/cinematic/examples/code/shared/ExperienceDirector.tsx +57 -0
- package/skills/struq/cinematic/examples/code/shared/ExperienceOverlay.tsx +37 -0
- package/skills/struq/cinematic/examples/code/shared/ExperiencePage.tsx +52 -0
- package/skills/struq/cinematic/examples/code/shared/GsapFrameLoop.tsx +32 -0
- package/skills/struq/cinematic/examples/code/shared/InteriorRoot.tsx +30 -0
- package/skills/struq/cinematic/examples/code/shared/README.md +20 -0
- package/skills/struq/cinematic/examples/code/shared/SubjectRig.tsx +58 -0
- package/skills/struq/cinematic/examples/code/shared/build-experience-timeline.ts +237 -0
- package/skills/struq/cinematic/examples/code/shared/direction.ts +52 -0
- package/skills/struq/cinematic/examples/code/shared/gsap-client.ts +32 -0
- package/skills/struq/cinematic/examples/code/shared/math.ts +12 -0
- package/skills/struq/cinematic/examples/code/shared/registry.ts +58 -0
- package/skills/struq/cinematic/examples/code/shared/runtime.ts +52 -0
- package/skills/struq/cinematic/examples/code/shared/styles.css +127 -0
- package/skills/struq/cinematic/examples/code/shared/useExperienceInput.ts +42 -0
- package/skills/struq/cinematic/examples/code/vite/README.md +14 -0
- package/skills/struq/cinematic/examples/code/vite/src/App.tsx +11 -0
- package/skills/struq/cinematic/examples/code/vite/src/LenisRoot.tsx +37 -0
- package/skills/struq/cinematic/examples/code/vite/src/main.tsx +9 -0
- package/skills/struq/cinematic/examples/concise/01-chapter-spec-example.md +42 -0
- package/skills/struq/cinematic/examples/concise/02-handoff-example.md +25 -0
- package/skills/struq/cinematic/examples/concise/03-audit-finding-example.md +13 -0
- package/skills/struq/cinematic/examples/verbose/01-full-experience-direction.md +687 -0
- package/skills/struq/cinematic/examples/verbose/02-full-audit-example.md +362 -0
- package/skills/struq/cinematic/references/01-core-mental-model.md +221 -0
- package/skills/struq/cinematic/references/02-vocabulary.md +384 -0
- package/skills/struq/cinematic/references/03-experience-architecture.md +302 -0
- package/skills/struq/cinematic/references/04-timeline-choreography.md +264 -0
- package/skills/struq/cinematic/references/05-handoff-contracts.md +241 -0
- package/skills/struq/cinematic/references/06-three-rig-architecture.md +286 -0
- package/skills/struq/cinematic/references/07-stack-integration.md +228 -0
- package/skills/struq/cinematic/references/08-gsap-plugin-patterns.md +218 -0
- package/skills/struq/cinematic/references/09-tuning-harness.md +202 -0
- package/skills/struq/cinematic/references/10-quality-systems.md +206 -0
- package/skills/struq/cinematic/references/11-agent-workflows.md +246 -0
- package/skills/struq/cinematic/references/12-audit-rubric.md +176 -0
- package/skills/struq/cinematic/references/13-official-docs.md +53 -0
- package/skills/struq/cinematic/templates/01-experience-brief.md +105 -0
- package/skills/struq/cinematic/templates/02-experience-contract.md +80 -0
- package/skills/struq/cinematic/templates/03-chapter-spec.md +103 -0
- package/skills/struq/cinematic/templates/04-handoff-contract.md +102 -0
- package/skills/struq/cinematic/templates/05-ownership-matrix.md +29 -0
- package/skills/struq/cinematic/templates/06-shot-presets.md +59 -0
- package/skills/struq/cinematic/templates/07-implementation-slice.md +66 -0
- package/skills/struq/cinematic/templates/08-tuning-register.md +36 -0
- package/skills/struq/cinematic/templates/09-acceptance-tests.md +57 -0
- package/skills/struq/references/anti-patterns.md +265 -0
- package/skills/struq/references/baseline-prompt.md +118 -0
- package/skills/struq/references/brand.md +143 -0
- package/skills/struq/references/brief-router.md +219 -0
- package/skills/struq/references/composition.md +191 -0
- package/skills/struq/references/depth-parallax.md +235 -0
- package/skills/struq/references/direction.md +188 -0
- package/skills/struq/references/feel-layer.md +107 -0
- package/skills/struq/references/gsap-api.md +293 -0
- package/skills/struq/references/iconography.md +255 -0
- package/skills/struq/references/imagery.md +144 -0
- package/skills/struq/references/loaders.md +287 -0
- package/skills/struq/references/micro-interactions.md +270 -0
- package/skills/struq/references/mobile-composition.md +70 -0
- package/skills/struq/references/nav-header.md +296 -0
- package/skills/struq/references/page-architecture.md +134 -0
- package/skills/struq/references/page-entrances.md +198 -0
- package/skills/struq/references/performance.md +235 -0
- package/skills/struq/references/pinning-scrub.md +341 -0
- package/skills/struq/references/pitfalls.md +290 -0
- package/skills/struq/references/route-transitions.md +281 -0
- package/skills/struq/references/scaling.md +151 -0
- package/skills/struq/references/scroll-reveals.md +280 -0
- package/skills/struq/references/seo.md +219 -0
- package/skills/struq/references/setup.md +397 -0
- package/skills/struq/references/showcase.md +87 -0
- package/skills/struq/references/stack-targets.md +78 -0
- package/skills/struq/references/struq-imagery.md +107 -0
- package/skills/struq/references/svg-motion.md +390 -0
- package/skills/struq/references/transitions.md +160 -0
- package/skills/struq/references/triage.md +71 -0
- package/skills/struq/references/typography.md +720 -0
- package/skills/struq/references/vibe-presets.md +287 -0
- package/skills/struq/references/webgl-r3f.md +274 -0
- package/skills/struq/references/webgl-scenes.md +593 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# GSAP Plugin Patterns
|
|
2
|
+
|
|
3
|
+
This reference assigns each plugin a clear role inside a cinematic experience. Use plugins because they solve a transition or direction problem, not because they are available.
|
|
4
|
+
|
|
5
|
+
## ScrollTrigger
|
|
6
|
+
|
|
7
|
+
Use for:
|
|
8
|
+
|
|
9
|
+
- chapter progress mapping,
|
|
10
|
+
- persistent-stage pin ranges,
|
|
11
|
+
- activation and deactivation,
|
|
12
|
+
- velocity and direction signals,
|
|
13
|
+
- scroll labels and debug markers,
|
|
14
|
+
- optional snapping.
|
|
15
|
+
|
|
16
|
+
Direction questions:
|
|
17
|
+
|
|
18
|
+
- What is the scroll-distance budget?
|
|
19
|
+
- Is the stage pinned once or per chapter?
|
|
20
|
+
- What happens before and after the range?
|
|
21
|
+
- Is the timeline fully scrubbed or partly state-based?
|
|
22
|
+
- What must happen in reverse?
|
|
23
|
+
- When are measurements refreshed?
|
|
24
|
+
|
|
25
|
+
Avoid creating one trigger for every small element when a chapter timeline can coordinate them.
|
|
26
|
+
|
|
27
|
+
## SplitText
|
|
28
|
+
|
|
29
|
+
Use for:
|
|
30
|
+
|
|
31
|
+
- line, word, and character choreography,
|
|
32
|
+
- masked editorial reveals,
|
|
33
|
+
- directional reading order,
|
|
34
|
+
- typographic bridges,
|
|
35
|
+
- reflow-aware text sequences.
|
|
36
|
+
|
|
37
|
+
Direction schema:
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
split unit: lines
|
|
41
|
+
mask: overflow hidden per line
|
|
42
|
+
origin: bottom
|
|
43
|
+
order: document order
|
|
44
|
+
stagger: 70 ms
|
|
45
|
+
relationship: begins when camera move reaches 65%
|
|
46
|
+
resolve: final line settles 120 ms after key light
|
|
47
|
+
responsive: mobile splits by words, not lines
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Keep accessible original text available and revert split markup during cleanup.
|
|
51
|
+
|
|
52
|
+
## DrawSVGPlugin
|
|
53
|
+
|
|
54
|
+
Use for:
|
|
55
|
+
|
|
56
|
+
- technical drawing reveals,
|
|
57
|
+
- paths that guide the camera or eye,
|
|
58
|
+
- diagrams and annotations,
|
|
59
|
+
- vector bridge elements,
|
|
60
|
+
- line accents tied to chapter beats.
|
|
61
|
+
|
|
62
|
+
Direction schema:
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
path role: bridge from product outline to tunnel axis
|
|
66
|
+
start: 0% drawn
|
|
67
|
+
entrance: draw 0 to 58% during establish
|
|
68
|
+
hold: preserve 58% while copy is readable
|
|
69
|
+
handoff: complete draw and move highlight along the final 42%
|
|
70
|
+
reverse: exact scrub reversal
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Prepare paths carefully. Multi-segment paths may need to be separated for predictable drawing.
|
|
74
|
+
|
|
75
|
+
## MorphSVGPlugin
|
|
76
|
+
|
|
77
|
+
Use for:
|
|
78
|
+
|
|
79
|
+
- icon-to-object transitions,
|
|
80
|
+
- typography-to-symbol bridges,
|
|
81
|
+
- mask deformation,
|
|
82
|
+
- portal shape transitions,
|
|
83
|
+
- vector states that preserve conceptual identity.
|
|
84
|
+
|
|
85
|
+
Direction questions:
|
|
86
|
+
|
|
87
|
+
- Are source and target paths semantically related?
|
|
88
|
+
- Should the form rotate, scale, or move during the morph?
|
|
89
|
+
- Which contour point should visually remain anchored?
|
|
90
|
+
- Is the morph a primary beat or a transition cover?
|
|
91
|
+
- Does the shape remain valid on mobile?
|
|
92
|
+
|
|
93
|
+
Prepare source and target paths to reduce unexpected point correspondence. Break complex forms into multiple paths when needed.
|
|
94
|
+
|
|
95
|
+
## MotionPathPlugin
|
|
96
|
+
|
|
97
|
+
Use for:
|
|
98
|
+
|
|
99
|
+
- camera or object travel along authored curves,
|
|
100
|
+
- particles following a visual axis,
|
|
101
|
+
- interface elements attached to a path,
|
|
102
|
+
- spatial carry through a transition.
|
|
103
|
+
|
|
104
|
+
Separate path progress from auto-rotation when direction must be art-directed. A camera path should also define target behavior and FOV.
|
|
105
|
+
|
|
106
|
+
## Flip
|
|
107
|
+
|
|
108
|
+
Use for:
|
|
109
|
+
|
|
110
|
+
- moving an element between DOM layouts while preserving visual continuity,
|
|
111
|
+
- grid-to-detail transitions,
|
|
112
|
+
- navigation and overlay expansion,
|
|
113
|
+
- shared-element route transitions.
|
|
114
|
+
|
|
115
|
+
A FLIP transition is a state-layout bridge. It does not replace the chapter state model. Define which wrapper GSAP owns and keep Motion layout animation off that same layer.
|
|
116
|
+
|
|
117
|
+
## Observer
|
|
118
|
+
|
|
119
|
+
Use for:
|
|
120
|
+
|
|
121
|
+
- wheel or touch gestures that advance discrete chapters,
|
|
122
|
+
- controlled full-screen state experiences,
|
|
123
|
+
- drag and swipe intent,
|
|
124
|
+
- gesture locking,
|
|
125
|
+
- pausing native scroll during an immersive mode (stop Lenis with `lenis.stop()` and resume it on exit).
|
|
126
|
+
|
|
127
|
+
Define thresholds, cooldowns, reversibility, focus behavior, keyboard alternatives, and escape conditions. Do not trap the user without an accessible navigation path.
|
|
128
|
+
|
|
129
|
+
## ScrollToPlugin
|
|
130
|
+
|
|
131
|
+
Use for:
|
|
132
|
+
|
|
133
|
+
- explicit chapter navigation,
|
|
134
|
+
- restoring a progress location,
|
|
135
|
+
- menu links into an immersive sequence,
|
|
136
|
+
- guided demos.
|
|
137
|
+
|
|
138
|
+
With Lenis active, `lenis.scrollTo()` is the one authoritative scroll command path. Do not tween the root scroller with ScrollToPlugin at the same time, or two scroll animations will fight. Use ScrollToPlugin only for non-root scroll containers.
|
|
139
|
+
|
|
140
|
+
## CustomEase
|
|
141
|
+
|
|
142
|
+
Use for:
|
|
143
|
+
|
|
144
|
+
- branded camera acceleration,
|
|
145
|
+
- a repeated product motion signature,
|
|
146
|
+
- transition covers requiring exact velocity shape,
|
|
147
|
+
- matching motion to sound or film reference.
|
|
148
|
+
|
|
149
|
+
Document the intended feel and reuse the same named ease across related beats. Avoid a different custom ease for every tween.
|
|
150
|
+
|
|
151
|
+
## CustomWiggle and CustomBounce
|
|
152
|
+
|
|
153
|
+
Use sparingly for:
|
|
154
|
+
|
|
155
|
+
- physically justified impacts,
|
|
156
|
+
- tactile UI accents,
|
|
157
|
+
- elastic materials,
|
|
158
|
+
- stylized object responses.
|
|
159
|
+
|
|
160
|
+
They are rarely appropriate for the main camera.
|
|
161
|
+
|
|
162
|
+
## Draggable and InertiaPlugin
|
|
163
|
+
|
|
164
|
+
Use for:
|
|
165
|
+
|
|
166
|
+
- object exploration,
|
|
167
|
+
- carousels with physical response,
|
|
168
|
+
- 3D model rotation proxies,
|
|
169
|
+
- timeline scrubbing controls,
|
|
170
|
+
- spatial interfaces.
|
|
171
|
+
|
|
172
|
+
Define boundaries, snapping, inertia, handoff to scroll, and what happens when the narrative timeline becomes active.
|
|
173
|
+
|
|
174
|
+
## TextPlugin
|
|
175
|
+
|
|
176
|
+
Use for controlled text replacement, counters, or terminal-like effects. Do not use typewriter behavior as a default “tech” aesthetic without narrative justification.
|
|
177
|
+
|
|
178
|
+
## Physics and procedural plugins
|
|
179
|
+
|
|
180
|
+
Physics-based plugins can create useful particles and impacts, but WebGL particle systems may be more appropriate for large quantities. Choose based on visual role and performance.
|
|
181
|
+
|
|
182
|
+
## Plugin registration pattern
|
|
183
|
+
|
|
184
|
+
Register only in the browser for frameworks that render on the server.
|
|
185
|
+
|
|
186
|
+
```ts
|
|
187
|
+
import gsap from 'gsap';
|
|
188
|
+
import { ScrollTrigger } from 'gsap/ScrollTrigger';
|
|
189
|
+
import { SplitText } from 'gsap/SplitText';
|
|
190
|
+
import { DrawSVGPlugin } from 'gsap/DrawSVGPlugin';
|
|
191
|
+
import { MorphSVGPlugin } from 'gsap/MorphSVGPlugin';
|
|
192
|
+
import { MotionPathPlugin } from 'gsap/MotionPathPlugin';
|
|
193
|
+
|
|
194
|
+
if (typeof window !== 'undefined') {
|
|
195
|
+
gsap.registerPlugin(
|
|
196
|
+
ScrollTrigger,
|
|
197
|
+
SplitText,
|
|
198
|
+
DrawSVGPlugin,
|
|
199
|
+
MorphSVGPlugin,
|
|
200
|
+
MotionPathPlugin,
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Verify import paths and bundler behavior against the installed GSAP version and official documentation.
|
|
206
|
+
|
|
207
|
+
## Plugin review rule
|
|
208
|
+
|
|
209
|
+
For every plugin in the project, document:
|
|
210
|
+
|
|
211
|
+
- the experience problem it solves,
|
|
212
|
+
- its authoritative properties,
|
|
213
|
+
- its lifecycle and cleanup,
|
|
214
|
+
- responsive behavior,
|
|
215
|
+
- reverse behavior,
|
|
216
|
+
- fallback when disabled.
|
|
217
|
+
|
|
218
|
+
If a plugin cannot be tied to a clear responsibility, remove it from the central experience architecture.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# Tuning Harness
|
|
2
|
+
|
|
3
|
+
## Manual tweaking is part of direction
|
|
4
|
+
|
|
5
|
+
Three.js composition requires visual judgment. The goal is not to eliminate manual tweaking; it is to make it fast, controlled, reversible, and understandable.
|
|
6
|
+
|
|
7
|
+
A tuning harness should let you answer:
|
|
8
|
+
|
|
9
|
+
- Where am I in the experience?
|
|
10
|
+
- Which chapter and phase are active?
|
|
11
|
+
- Which system owns the property I am inspecting?
|
|
12
|
+
- What are the current camera and target values?
|
|
13
|
+
- Can I isolate this chapter and handoff?
|
|
14
|
+
- Can I compare two settings without rebuilding?
|
|
15
|
+
- Can I capture the current composition as direction data?
|
|
16
|
+
|
|
17
|
+
## Minimum controls
|
|
18
|
+
|
|
19
|
+
### Narrative controls
|
|
20
|
+
|
|
21
|
+
- global progress slider,
|
|
22
|
+
- active chapter selector,
|
|
23
|
+
- local chapter progress slider,
|
|
24
|
+
- play and pause,
|
|
25
|
+
- forward and reverse,
|
|
26
|
+
- playback speed,
|
|
27
|
+
- jump to semantic label,
|
|
28
|
+
- isolate handoff,
|
|
29
|
+
- lock scroll while scrubbing.
|
|
30
|
+
|
|
31
|
+
### Camera controls
|
|
32
|
+
|
|
33
|
+
- camera world position,
|
|
34
|
+
- camera narrative-rig position,
|
|
35
|
+
- target world position,
|
|
36
|
+
- FOV,
|
|
37
|
+
- roll,
|
|
38
|
+
- near and far planes,
|
|
39
|
+
- focus distance,
|
|
40
|
+
- aperture,
|
|
41
|
+
- exposure,
|
|
42
|
+
- capture current values as a named shot.
|
|
43
|
+
|
|
44
|
+
### Subject controls
|
|
45
|
+
|
|
46
|
+
- placement position,
|
|
47
|
+
- rotation,
|
|
48
|
+
- scale,
|
|
49
|
+
- anchor visualization,
|
|
50
|
+
- bounding box,
|
|
51
|
+
- material and shader channels,
|
|
52
|
+
- capture current values as a key pose.
|
|
53
|
+
|
|
54
|
+
### Input controls
|
|
55
|
+
|
|
56
|
+
- pointer visualization,
|
|
57
|
+
- current pointer influence,
|
|
58
|
+
- scroll velocity and normalized velocity,
|
|
59
|
+
- direction,
|
|
60
|
+
- interaction envelope,
|
|
61
|
+
- force reduced motion,
|
|
62
|
+
- emulate touch input.
|
|
63
|
+
|
|
64
|
+
### Rendering controls
|
|
65
|
+
|
|
66
|
+
- FPS and frame duration,
|
|
67
|
+
- draw calls,
|
|
68
|
+
- triangles,
|
|
69
|
+
- textures,
|
|
70
|
+
- render targets,
|
|
71
|
+
- DPR,
|
|
72
|
+
- shadow toggle,
|
|
73
|
+
- post-processing toggle by pass,
|
|
74
|
+
- particle-density tier,
|
|
75
|
+
- wireframe and normals,
|
|
76
|
+
- scene-group visibility.
|
|
77
|
+
|
|
78
|
+
## Direction register
|
|
79
|
+
|
|
80
|
+
Maintain a central register:
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
export const direction = {
|
|
84
|
+
chapters: {
|
|
85
|
+
reveal: {
|
|
86
|
+
scrollVh: 3.2,
|
|
87
|
+
phases: {
|
|
88
|
+
entrance: [0.00, 0.18],
|
|
89
|
+
establish: [0.18, 0.36],
|
|
90
|
+
development: [0.36, 0.68],
|
|
91
|
+
transformation: [0.68, 0.84],
|
|
92
|
+
handoff: [0.84, 1.00],
|
|
93
|
+
},
|
|
94
|
+
pointerStrength: 0.045,
|
|
95
|
+
velocityStrength: 0.12,
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
effects: {
|
|
99
|
+
bloom: { base: 0.15, apex: 0.55 },
|
|
100
|
+
grain: { strength: 0.08 },
|
|
101
|
+
distortion: { maxVelocity: 0.22 },
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Use named values and units. Avoid ambiguous values such as `speed: 2` without defining what the number means.
|
|
107
|
+
|
|
108
|
+
## Preset capture
|
|
109
|
+
|
|
110
|
+
A capture action should output valid direction data:
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"name": "productMacroDesktop",
|
|
115
|
+
"camera": {
|
|
116
|
+
"position": [0.12, 0.36, 2.18],
|
|
117
|
+
"target": [0.04, 0.18, 0.00],
|
|
118
|
+
"fov": 29,
|
|
119
|
+
"roll": -0.012
|
|
120
|
+
},
|
|
121
|
+
"subject": {
|
|
122
|
+
"position": [0.28, -0.14, 0.24],
|
|
123
|
+
"rotation": [0.06, -0.31, 0.02],
|
|
124
|
+
"scale": 1.18
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The agent can then compare, name, and integrate the preset into `shots.ts`.
|
|
130
|
+
|
|
131
|
+
## Debug overlays
|
|
132
|
+
|
|
133
|
+
Useful overlays include:
|
|
134
|
+
|
|
135
|
+
- viewport center and thirds,
|
|
136
|
+
- typography safe areas,
|
|
137
|
+
- camera target and forward axis,
|
|
138
|
+
- model anchors,
|
|
139
|
+
- portal plane,
|
|
140
|
+
- clipping and mask bounds,
|
|
141
|
+
- chapter and handoff range markers,
|
|
142
|
+
- active ownership labels,
|
|
143
|
+
- current cue names.
|
|
144
|
+
|
|
145
|
+
## Slow-motion review
|
|
146
|
+
|
|
147
|
+
Review time-driven intros and discrete transitions at `0.25x` and `0.5x` speed. Scrub scroll-driven timelines slowly. Look for:
|
|
148
|
+
|
|
149
|
+
- property jumps,
|
|
150
|
+
- target drift,
|
|
151
|
+
- hidden geometry appearing too early,
|
|
152
|
+
- opacity changes covering architectural mistakes,
|
|
153
|
+
- type and camera landing at the same instant without hierarchy,
|
|
154
|
+
- insufficient occlusion,
|
|
155
|
+
- interaction influence during critical moves,
|
|
156
|
+
- abrupt effect thresholds.
|
|
157
|
+
|
|
158
|
+
## Tuning order
|
|
159
|
+
|
|
160
|
+
Tune in this order:
|
|
161
|
+
|
|
162
|
+
1. state continuity,
|
|
163
|
+
2. camera and subject composition,
|
|
164
|
+
3. chapter phase boundaries,
|
|
165
|
+
4. handoff coverage and ownership,
|
|
166
|
+
5. hierarchy of beats,
|
|
167
|
+
6. typography timing,
|
|
168
|
+
7. interaction envelopes,
|
|
169
|
+
8. lighting and material response,
|
|
170
|
+
9. post-processing,
|
|
171
|
+
10. microtiming and accents.
|
|
172
|
+
|
|
173
|
+
Do not tune bloom, grain, and distortion before the camera path and state continuity are correct.
|
|
174
|
+
|
|
175
|
+
## Review recordings
|
|
176
|
+
|
|
177
|
+
Capture repeatable recordings at:
|
|
178
|
+
|
|
179
|
+
- slow deliberate scroll,
|
|
180
|
+
- normal trackpad scroll,
|
|
181
|
+
- fast scroll and direction reversal,
|
|
182
|
+
- touch scroll,
|
|
183
|
+
- mobile portrait,
|
|
184
|
+
- mobile landscape when supported,
|
|
185
|
+
- reduced motion,
|
|
186
|
+
- low-performance tier,
|
|
187
|
+
- route enter and leave,
|
|
188
|
+
- browser resize during the experience.
|
|
189
|
+
|
|
190
|
+
Compare the same chapter across revisions. A screen recording is useful evidence for agent audits when the code alone does not reveal perceptual timing.
|
|
191
|
+
|
|
192
|
+
## Acceptance thresholds
|
|
193
|
+
|
|
194
|
+
Define project-specific thresholds such as:
|
|
195
|
+
|
|
196
|
+
- no visible jump larger than one device pixel at ownership transfer,
|
|
197
|
+
- no frame longer than 50 ms during a normal chapter transition on the target device,
|
|
198
|
+
- stable 60 FPS on the primary desktop class or a documented lower target,
|
|
199
|
+
- mobile camera keeps the principal subject inside the safe area at all key poses,
|
|
200
|
+
- text remains readable for a minimum scroll interval,
|
|
201
|
+
- reduced-motion mode contains no large forced parallax or rapid camera pass-through,
|
|
202
|
+
- all triggers and ticker callbacks are removed after route leave.
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Responsive, Performance, and Accessibility Systems
|
|
2
|
+
|
|
3
|
+
## Responsive choreography
|
|
4
|
+
|
|
5
|
+
Responsive work is not a scale transform applied to desktop direction. It is a reinterpretation of the same narrative intent under different spatial and input constraints.
|
|
6
|
+
|
|
7
|
+
Define viewport classes such as:
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
type ViewportClass =
|
|
11
|
+
| 'desktop-wide'
|
|
12
|
+
| 'desktop'
|
|
13
|
+
| 'tablet'
|
|
14
|
+
| 'mobile-portrait'
|
|
15
|
+
| 'mobile-landscape';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
For each class define:
|
|
19
|
+
|
|
20
|
+
- shot presets,
|
|
21
|
+
- subject scale and anchors,
|
|
22
|
+
- typography composition,
|
|
23
|
+
- scroll-distance budgets,
|
|
24
|
+
- interaction strengths,
|
|
25
|
+
- transition coverage values,
|
|
26
|
+
- particle and effect tier,
|
|
27
|
+
- copy density,
|
|
28
|
+
- controls and navigation behavior.
|
|
29
|
+
|
|
30
|
+
## Mobile direction changes
|
|
31
|
+
|
|
32
|
+
Common intentional changes include:
|
|
33
|
+
|
|
34
|
+
- reduce camera lateral travel,
|
|
35
|
+
- favor target movement over large camera orbit,
|
|
36
|
+
- shorten or simplify portal passes,
|
|
37
|
+
- move copy into a stable safe region,
|
|
38
|
+
- use word-based rather than line-based splitting,
|
|
39
|
+
- reduce pointer-dependent behavior,
|
|
40
|
+
- replace hover interactions with tap or scroll responses,
|
|
41
|
+
- reduce transparent particles and depth-of-field,
|
|
42
|
+
- increase handoff occluder scale to guarantee coverage,
|
|
43
|
+
- allocate more scroll distance for dense reading.
|
|
44
|
+
|
|
45
|
+
## Reduced-motion choreography
|
|
46
|
+
|
|
47
|
+
Reduced motion should preserve story and hierarchy while reducing:
|
|
48
|
+
|
|
49
|
+
- long spatial travel,
|
|
50
|
+
- rapid acceleration,
|
|
51
|
+
- large parallax,
|
|
52
|
+
- camera roll,
|
|
53
|
+
- depth tunneling,
|
|
54
|
+
- repeated oscillation,
|
|
55
|
+
- velocity-linked distortion,
|
|
56
|
+
- disorienting zoom changes.
|
|
57
|
+
|
|
58
|
+
Possible substitutions:
|
|
59
|
+
|
|
60
|
+
- dissolve within the same composition rather than fly through space,
|
|
61
|
+
- cut between matched key poses under a short cover,
|
|
62
|
+
- reveal type by opacity and contrast instead of large masked translation,
|
|
63
|
+
- use limited scale changes,
|
|
64
|
+
- disable pointer parallax and camera shake,
|
|
65
|
+
- preserve bridge objects but reduce movement distance.
|
|
66
|
+
|
|
67
|
+
Reduced motion is still directed. Do not simply disable all animation and leave broken visibility states.
|
|
68
|
+
|
|
69
|
+
## Semantic content and accessibility
|
|
70
|
+
|
|
71
|
+
The experience must preserve:
|
|
72
|
+
|
|
73
|
+
- meaningful document order,
|
|
74
|
+
- readable text outside the canvas,
|
|
75
|
+
- keyboard access,
|
|
76
|
+
- focus visibility,
|
|
77
|
+
- accessible controls,
|
|
78
|
+
- route announcements where needed,
|
|
79
|
+
- alternatives for gesture-only interactions,
|
|
80
|
+
- sufficient contrast,
|
|
81
|
+
- non-blocking scroll escape,
|
|
82
|
+
- meaningful fallback when WebGL is unavailable.
|
|
83
|
+
|
|
84
|
+
Canvas visuals should not be the only source of essential information.
|
|
85
|
+
|
|
86
|
+
## Input accessibility
|
|
87
|
+
|
|
88
|
+
If wheel or touch gestures advance discrete chapters, also provide:
|
|
89
|
+
|
|
90
|
+
- keyboard navigation,
|
|
91
|
+
- visible progress or navigation,
|
|
92
|
+
- a way to escape or return,
|
|
93
|
+
- sensible browser-history behavior,
|
|
94
|
+
- focus management,
|
|
95
|
+
- reduced-motion behavior,
|
|
96
|
+
- no accidental trapping inside nested scrollers.
|
|
97
|
+
|
|
98
|
+
## Performance tiers
|
|
99
|
+
|
|
100
|
+
Example:
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
type PerformanceTier = 'high' | 'balanced' | 'safe';
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### High
|
|
107
|
+
|
|
108
|
+
- full post-processing,
|
|
109
|
+
- higher DPR cap,
|
|
110
|
+
- dense particles,
|
|
111
|
+
- dynamic shadows,
|
|
112
|
+
- higher texture or geometry detail.
|
|
113
|
+
|
|
114
|
+
### Balanced
|
|
115
|
+
|
|
116
|
+
- selected post effects,
|
|
117
|
+
- moderate DPR,
|
|
118
|
+
- reduced particles,
|
|
119
|
+
- limited shadows,
|
|
120
|
+
- optimized texture sizes.
|
|
121
|
+
|
|
122
|
+
### Safe
|
|
123
|
+
|
|
124
|
+
- minimal post-processing,
|
|
125
|
+
- low DPR cap,
|
|
126
|
+
- simplified materials,
|
|
127
|
+
- static or baked lighting,
|
|
128
|
+
- reduced geometry and particles,
|
|
129
|
+
- simpler transitions preserving the bridge concept.
|
|
130
|
+
|
|
131
|
+
Do not rely on a single device heuristic. Allow manual override and respond to observed performance when appropriate.
|
|
132
|
+
|
|
133
|
+
## Frame-budget thinking
|
|
134
|
+
|
|
135
|
+
At 60 Hz the total frame duration is about 16.7 ms. This includes JavaScript, style, layout, paint, and GPU rendering. Treat long main-thread tasks, shader cost, overdraw, and asset decoding as part of one budget.
|
|
136
|
+
|
|
137
|
+
Profile:
|
|
138
|
+
|
|
139
|
+
- CPU frame time,
|
|
140
|
+
- GPU frame time when available,
|
|
141
|
+
- JS allocations,
|
|
142
|
+
- layout and style recalculation,
|
|
143
|
+
- texture memory,
|
|
144
|
+
- draw calls,
|
|
145
|
+
- triangles,
|
|
146
|
+
- transparent overdraw,
|
|
147
|
+
- shader complexity,
|
|
148
|
+
- render-target count and resolution.
|
|
149
|
+
|
|
150
|
+
## Asset strategy
|
|
151
|
+
|
|
152
|
+
Define asset readiness by chapter:
|
|
153
|
+
|
|
154
|
+
```text
|
|
155
|
+
critical for first paint
|
|
156
|
+
critical for intro
|
|
157
|
+
required before chapter 2 handoff
|
|
158
|
+
prefetch during chapter 1 hold
|
|
159
|
+
optional enhancement for high tier
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Preload the next chapter's bridge assets before the handoff. Do not load every high-resolution asset before showing anything unless the concept requires a fully controlled opening.
|
|
163
|
+
|
|
164
|
+
## Common performance failures
|
|
165
|
+
|
|
166
|
+
- full-resolution render targets for several effects,
|
|
167
|
+
- high DPR on dense mobile screens,
|
|
168
|
+
- unbounded transparent particles,
|
|
169
|
+
- shadows on many dynamic lights,
|
|
170
|
+
- rebuilding geometry or materials during render,
|
|
171
|
+
- React state updates every frame,
|
|
172
|
+
- layout reads and writes interleaved in pointer handlers,
|
|
173
|
+
- multiple independent RAF loops doing redundant work (including R3F's default loop running next to the Lenis ticker, which should be a single `gsap.ticker` clock),
|
|
174
|
+
- oversized textures,
|
|
175
|
+
- mounting the incoming scene during the critical frame,
|
|
176
|
+
- excessive blur filters on large DOM layers,
|
|
177
|
+
- SplitText or ScrollTrigger refresh loops during resize.
|
|
178
|
+
|
|
179
|
+
## Quality validation matrix
|
|
180
|
+
|
|
181
|
+
Test combinations, not isolated features:
|
|
182
|
+
|
|
183
|
+
| Dimension | Cases |
|
|
184
|
+
|---|---|
|
|
185
|
+
| Input | mouse, trackpad, touch, keyboard |
|
|
186
|
+
| Motion | normal, reduced motion |
|
|
187
|
+
| Performance | high, balanced, safe |
|
|
188
|
+
| Viewport | wide desktop, laptop, tablet, mobile portrait |
|
|
189
|
+
| Scroll | slow, fast, reverse, jump via navigation |
|
|
190
|
+
| Lifecycle | first load, route enter, route leave, back navigation |
|
|
191
|
+
| Assets | warm cache, cold cache, delayed model, delayed font |
|
|
192
|
+
| Visibility | foreground tab, background and resume |
|
|
193
|
+
|
|
194
|
+
## Graceful failure
|
|
195
|
+
|
|
196
|
+
Define behavior for:
|
|
197
|
+
|
|
198
|
+
- WebGL unavailable,
|
|
199
|
+
- model fails to load,
|
|
200
|
+
- shader compilation fails,
|
|
201
|
+
- reduced-data preference,
|
|
202
|
+
- autoplay audio unavailable,
|
|
203
|
+
- low-memory device,
|
|
204
|
+
- missing optional plugin effect.
|
|
205
|
+
|
|
206
|
+
The fallback should preserve content and visual hierarchy, not display an empty stage.
|