@sayknow-cli/coding-agent 0.5.13 → 0.5.14

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 (40) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/types/cli/setup-cli.d.ts +1 -1
  3. package/dist/types/defaults/skc-ui-skills.d.ts +12 -0
  4. package/dist/types/hooks/ui-skill-keywords.d.ts +84 -0
  5. package/dist/types/session-import/redact.d.ts +1 -1
  6. package/dist/types/setup/external-ui-skills.d.ts +37 -0
  7. package/package.json +7 -7
  8. package/src/cli/setup-cli.ts +22 -1
  9. package/src/cli/skills-cli.ts +29 -10
  10. package/src/commands/setup.ts +1 -0
  11. package/src/defaults/skc/ui-skills/LICENSE.appllama +21 -0
  12. package/src/defaults/skc/ui-skills/LICENSE.emilkowalski +21 -0
  13. package/src/defaults/skc/ui-skills/NOTICE.md +43 -0
  14. package/src/defaults/skc/ui-skills/animate/SKILL.md +536 -0
  15. package/src/defaults/skc/ui-skills/animation-vocabulary/SKILL.md +178 -0
  16. package/src/defaults/skc/ui-skills/apple-design/SKILL.md +285 -0
  17. package/src/defaults/skc/ui-skills/appllama-app-design-skill/SKILL.md +821 -0
  18. package/src/defaults/skc/ui-skills/ask-sonner/SKILL.md +157 -0
  19. package/src/defaults/skc/ui-skills/emil-design-eng/SKILL.md +671 -0
  20. package/src/defaults/skc/ui-skills/find-animation-opportunities/SKILL.md +137 -0
  21. package/src/defaults/skc/ui-skills/improve-animations/SKILL.md +305 -0
  22. package/src/defaults/skc/ui-skills/mobile-native/SKILL.md +308 -0
  23. package/src/defaults/skc/ui-skills/pick-ui-library/SKILL.md +82 -0
  24. package/src/defaults/skc/ui-skills/prototype/SKILL.md +300 -0
  25. package/src/defaults/skc/ui-skills/react-bits/SKILL.md +113 -0
  26. package/src/defaults/skc/ui-skills/review-animations/SKILL.md +312 -0
  27. package/src/defaults/skc-ui-skills.ts +108 -0
  28. package/src/extensibility/runtime-skill-discovery.ts +8 -2
  29. package/src/hooks/native-skill-hook.ts +14 -0
  30. package/src/hooks/ui-skill-keywords.ts +312 -0
  31. package/src/internal-urls/docs-index.generated.ts +1 -1
  32. package/src/prompts/agents/architect.md +1 -0
  33. package/src/prompts/agents/critic.md +1 -0
  34. package/src/prompts/agents/executor.md +1 -0
  35. package/src/prompts/agents/planner.md +1 -0
  36. package/src/prompts/system/system-prompt.md +1 -0
  37. package/src/prompts/tools/skill.md +2 -2
  38. package/src/sdk/session.ts +7 -5
  39. package/src/session-import/redact.ts +11 -6
  40. package/src/setup/external-ui-skills.ts +132 -0
@@ -0,0 +1,536 @@
1
+ ---
2
+ name: animate
3
+ description: Build an animation from scratch, making the decisions in the order that determines whether it feels right — should it animate at all, what purpose, which tool, which properties, which curve and duration, how it interrupts, how it exits. Writes the implementation. Use when asked to animate something, add motion, make a component feel alive, or build a transition. For critiquing existing motion use review-animations; for auditing a whole codebase use improve-animations.
4
+ ---
5
+
6
+ # Building Animations
7
+
8
+ ## SKC invocation
9
+
10
+ SKC loads this skill automatically for matching frontend UI/UX work.
11
+ Do not wait for a follow-up question. Apply the craft rules immediately
12
+ and keep going on the user's actual task.
13
+
14
+ This skill's companion reference files are appended inline at the end of
15
+ this document. Read them there; they are not separate files on disk.
16
+
17
+
18
+ ## Operating Posture
19
+
20
+ You are a senior design engineer building the animation yourself. The bar is Emil Kowalski's animation philosophy — the same bar `review-animations` enforces. Write it so it passes that review the first time.
21
+
22
+ Two failure modes, and the first is worse:
23
+
24
+ 1. **Animating something that shouldn't animate.** The gate below exists to produce zero lines of code sometimes. That's a success, not a dodge.
25
+ 2. **Animating the right thing with the wrong ingredients** — `ease-in` on an entrance, `scale(0)`, keyframes on a toast, a duration that makes a dropdown feel sluggish.
26
+
27
+ Never present motion options as a menu. Make the call, state the reasoning in one line, write the code.
28
+
29
+ ## Hard Rules
30
+
31
+ 1. **Run the sequence in order.** Steps 1 and 2 gate everything. Don't reach for a curve before you know whether it animates at all.
32
+ 2. **No approximated values.** Every curve, duration, and spring config comes from the tables below. Never invent `cubic-bezier(0.4, 0, 0.2, 1)` because it looks familiar.
33
+ 3. **Extend the codebase's tokens, don't fork them.** If `--ease-out` or a duration scale already exists, use it. Adding a parallel system is a defect.
34
+ 4. **Reduced motion and hover gating ship with the animation**, not as a follow-up.
35
+ 5. **Cheapest tool that works.** Don't install a motion library for a fade.
36
+
37
+ ## The Build Sequence
38
+
39
+ ### 1. Should this animate at all?
40
+
41
+ | Frequency | Decision |
42
+ | --- | --- |
43
+ | 100+ times/day (keyboard shortcuts, command palette toggle) | **No animation. Ever.** Stop here. |
44
+ | Tens of times/day (hover effects, list navigation) | Near-imperceptible only — fast and subtle, or nothing |
45
+ | Occasional (modals, drawers, toasts) | Standard animation |
46
+ | Rare / first-time (onboarding, success, celebration) | The delight budget lives here |
47
+
48
+ **Keyboard-initiated actions are a disqualifier, not a judgment call.** Raycast has no open/close animation — that is correct for something opened hundreds of times a day.
49
+
50
+ If the request fails this gate, say so plainly and don't write the animation. Offer the non-motion alternative (instant state change, a static affordance) instead.
51
+
52
+ ### 2. What is the purpose?
53
+
54
+ Name it in one of these words before continuing:
55
+
56
+ - **Feedback** — confirming the interface heard the user
57
+ - **Spatial consistency** — showing where something came from or went
58
+ - **State indication** — making a state change legible
59
+ - **Preventing a jarring change** — bridging content that would otherwise teleport
60
+ - **Explanation** — demonstrating how something works (marketing/onboarding only)
61
+ - **Delight** — allowed *only* at the rare/first-time tier
62
+
63
+ Can't name it? Don't build it. "It looks cool" on a frequently-seen element is a reason to stop.
64
+
65
+ Also check **function**: data the user is reading or acting on should not move for style. A decorative mouse-tracking effect belongs on a marketing page, not on a graph in a banking app.
66
+
67
+ ### 3. Pick the tool — cheapest that works
68
+
69
+ Walk down; stop at the first that fits.
70
+
71
+ | Need | Tool |
72
+ | --- | --- |
73
+ | Hover, press, color, a state toggle you control with a class or attribute | **CSS transition** |
74
+ | Entry animation on mount, no JS state | **CSS `@starting-style`** |
75
+ | Predetermined motion that must stay smooth while the page is busy loading | **CSS animation** (runs off the main thread) |
76
+ | Programmatic control with CSS performance, no library | **WAAPI** (`element.animate()`) |
77
+ | Springs, layout animations, exit animations, gesture-driven values | **Motion** (`motion.dev`) |
78
+
79
+ CSS animations beat JS under load — they run off the main thread, while `requestAnimationFrame`-based animation drops frames while the browser loads, scripts, or paints. Use CSS for predetermined motion, JS for dynamic and interruptible motion.
80
+
81
+ If the task needs a *component* rather than an animation — a toast, a drawer, a command menu, a dropdown — stop and invoke `pick-ui-library`. Hand-rolling those is how you end up with a `<div>` dropdown and no focus management.
82
+
83
+ ### 4. Pick the properties
84
+
85
+ - **`transform` and `opacity` only.** They skip layout and paint and run on the GPU. `width`/`height`/`margin`/`padding`/`top`/`left` trigger all three. (`clip-path` is the sanctioned fourth — see RECIPES.md. `height` is tolerated only for accordions, where there's no transform equivalent.)
86
+ - **Never `scale(0)`.** Start from `scale(0.9–0.97)` + `opacity: 0`. Nothing in the real world appears from nothing.
87
+ - **`transform-origin` at the trigger** for popovers, dropdowns, menus, tooltips — `var(--transform-origin)` in Base UI. **Modals are exempt**; they're not anchored to a trigger, so they stay centered.
88
+ - **Percentages in `translate()`** are relative to the element's own size — `translateY(100%)` moves by its own height whatever the content. Prefer over hardcoded pixels.
89
+ - **In Motion, use the full transform string.** `x`/`y`/`scale` shorthands are not hardware-accelerated and drop frames under load:
90
+
91
+ ```jsx
92
+ <motion.div animate={{ x: 100 }} /> // drops frames under load
93
+ <motion.div animate={{ transform: "translateX(100px)" }} /> // hardware accelerated
94
+ ```
95
+
96
+ - **Never drive a child's transform from a CSS variable on the parent** — it recalculates styles for every child. Set `transform` on the element directly.
97
+
98
+ ### 5. Easing and duration — or a spring
99
+
100
+ **Easing**, in decision order:
101
+
102
+ | Situation | Easing |
103
+ | --- | --- |
104
+ | Entering or exiting | `ease-out` |
105
+ | Moving / morphing on screen | `ease-in-out` |
106
+ | Hover / color change | `ease` |
107
+ | Constant motion (marquee, progress) | `linear` |
108
+ | Default | `ease-out` |
109
+
110
+ **Never `ease-in` on UI.** It starts slow, delaying the exact moment the user is watching. `ease-out` at 200ms *feels* faster than `ease-in` at 200ms.
111
+
112
+ Built-in CSS easings are too weak. Use these:
113
+
114
+ ```css
115
+ --ease-out: cubic-bezier(0.23, 1, 0.32, 1); /* strong ease-out for UI */
116
+ --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1); /* strong ease-in-out for on-screen movement */
117
+ --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1); /* iOS-like drawer curve (Ionic) */
118
+ ```
119
+
120
+ Need a curve that isn't here? Take it from [easing.dev](https://easing.dev/) or [easings.co](https://easings.co/). Don't hand-roll one.
121
+
122
+ **Duration:**
123
+
124
+ | Element | Duration |
125
+ | --- | --- |
126
+ | Button press feedback | 100–160ms |
127
+ | Tooltips, small popovers | 125–200ms |
128
+ | Dropdowns, selects | 150–250ms |
129
+ | Modals, drawers | 200–500ms |
130
+ | Marketing / explanatory | Can be longer |
131
+
132
+ **UI animations stay under 300ms.** A 180ms dropdown feels more responsive than a 400ms one.
133
+
134
+ **Reach for a spring instead** when the motion is drag with momentum, an element that should feel alive, a gesture the user can interrupt or reverse, or decorative mouse-tracking:
135
+
136
+ ```js
137
+ { type: "spring", duration: 0.5, bounce: 0.2 } // Apple-style — easier to reason about
138
+ { type: "spring", mass: 1, stiffness: 100, damping: 10 } // traditional physics — more control
139
+ ```
140
+
141
+ Keep bounce at 0.1–0.3, and avoid bounce in most UI — reserve it for drag-to-dismiss and playful interactions.
142
+
143
+ ### 6. Interruption and exit
144
+
145
+ - **Transitions, not keyframes, for anything triggered rapidly** — toasts, toggles, anything a user can fire twice in a second. Transitions retarget from the current value; keyframes restart from zero.
146
+ - **Springs for gestures**, because they carry velocity through an interruption.
147
+ - **Exit the way it entered.** A toast that slides in from the bottom leaves through the bottom. Symmetric paths are what make swipe-to-dismiss feel obvious.
148
+ - **Asymmetric timing where the user is deciding.** Slow on the deliberate phase (a hold-to-confirm press: 2s linear), snappy on the system response (release: 200ms ease-out).
149
+
150
+ ### 7. Reduced motion and pointer gating
151
+
152
+ Ships with the animation, every time.
153
+
154
+ ```css
155
+ @media (prefers-reduced-motion: reduce) {
156
+ .element { animation: fade 0.2s ease; } /* keep opacity/color, drop transform-based motion */
157
+ }
158
+
159
+ @media (hover: hover) and (pointer: fine) {
160
+ .element:hover { transform: scale(1.05); } /* touch fires false hovers on tap */
161
+ }
162
+ ```
163
+
164
+ ```jsx
165
+ const reduce = useReducedMotion();
166
+ const closedX = reduce ? 0 : '-100%';
167
+ ```
168
+
169
+ Reduced motion means **fewer and gentler** animations, not zero — keep transitions that aid comprehension, remove movement and position changes.
170
+
171
+ ## Recipes
172
+
173
+ For ready-to-build implementations of the common cases — button press, dropdown, tooltip, modal, drawer, toast, accordion, stagger, hold-to-confirm, tab indicator, scroll reveal, drag-to-dismiss — see [RECIPES.md](#appendix-recipes-md). Load it whenever the request matches one of those components; start from the recipe rather than from a blank file.
174
+
175
+ ## Never Ship
176
+
177
+ Self-check before you finish. Each of these is an automatic block in `review-animations`:
178
+
179
+ | Never | Instead |
180
+ | --- | --- |
181
+ | `transition: all` | Name the exact properties |
182
+ | `transform: scale(0)` entrance | `scale(0.95)` + `opacity: 0` |
183
+ | `ease-in` on a UI element | `ease-out` or a strong custom curve |
184
+ | Built-in `ease-out` on a deliberate animation | `cubic-bezier(0.23, 1, 0.32, 1)` |
185
+ | Animation on a keyboard shortcut or 100+/day action | No animation |
186
+ | UI duration over 300ms with no reason | 150–250ms |
187
+ | `transform-origin: center` on a trigger-anchored popover | `var(--transform-origin)` (modals exempt) |
188
+ | Keyframes on toasts, toggles, rapidly-triggered elements | CSS transitions |
189
+ | Animating `width`/`height`/`margin`/`padding`/`top`/`left` | `transform` / `opacity` |
190
+ | Motion `x`/`y`/`scale` props under load | Full `transform` string |
191
+ | Ungated `:hover` motion | `@media (hover: hover) and (pointer: fine)` |
192
+ | Missing `prefers-reduced-motion` | Gentler variant, not zero |
193
+ | Everything entering at once | 30–80ms stagger |
194
+
195
+ ## Output
196
+
197
+ Write the code. Then, in at most a few lines:
198
+
199
+ - **The gate result** — frequency tier and the named purpose. If something in the request was rejected, say which and why.
200
+ - **The ingredients** — tool, properties, curve, duration or spring config, in one line each.
201
+ - **What to feel-check** — if the result depends on feel you can't judge from code (a crossfade, a spring's bounce, the opacity/height balance in an entering list), say so and point at the check: play it at 2–5× duration or in the DevTools animation inspector, step it frame by frame, test gestures on a real device, and look again the next day with fresh eyes.
202
+
203
+ Don't pad this into a report. The code is the deliverable.
204
+
205
+ ## Tone
206
+
207
+ Opinionated and brief. When the honest answer is "this shouldn't animate," give it — that answer is the reason this skill exists. When feel genuinely can't be settled from code, say so instead of guessing at a value.
208
+
209
+ ---
210
+
211
+ ## Appendix: RECIPES.md
212
+
213
+ # Animation Recipes
214
+
215
+ Ready-to-build implementations for the cases that come up most. Start from the recipe, then adapt — don't rebuild from scratch.
216
+
217
+ Curves are the `--ease-out`, `--ease-in-out`, and `--ease-drawer` tokens defined in SKILL.md.
218
+
219
+ ---
220
+
221
+ ## Button press
222
+
223
+ Any pressable element. Instant feedback that the interface heard the user.
224
+
225
+ ```css
226
+ .button {
227
+ transition: transform 160ms var(--ease-out);
228
+ }
229
+
230
+ .button:active {
231
+ transform: scale(0.97);
232
+ }
233
+ ```
234
+
235
+ `scale()` scales children too — the label and icons come along, which is what makes it read as a physical press.
236
+
237
+ No hover gating needed here: `:active` is a real press on touch. Gate any `:hover` styling separately.
238
+
239
+ ---
240
+
241
+ ## Dropdown, popover, menu, select
242
+
243
+ Scales out of its trigger, not out of thin air.
244
+
245
+ ```css
246
+ .popover {
247
+ transform-origin: var(--transform-origin); /* Base UI supplies this */
248
+ transition:
249
+ opacity 200ms var(--ease-out),
250
+ transform 200ms var(--ease-out);
251
+ }
252
+
253
+ .popover[data-starting-style],
254
+ .popover[data-ending-style] {
255
+ opacity: 0;
256
+ transform: scale(0.95);
257
+ }
258
+ ```
259
+
260
+ The `transform-origin` is the whole point — the panel should look like it came out of the thing you clicked.
261
+
262
+ ---
263
+
264
+ ## Tooltip
265
+
266
+ Same shape as a popover, faster, plus the detail most implementations miss.
267
+
268
+ ```css
269
+ .tooltip {
270
+ transform-origin: var(--transform-origin);
271
+ transition:
272
+ transform 125ms var(--ease-out),
273
+ opacity 125ms var(--ease-out);
274
+ }
275
+
276
+ .tooltip[data-starting-style],
277
+ .tooltip[data-ending-style] {
278
+ opacity: 0;
279
+ transform: scale(0.97);
280
+ }
281
+
282
+ /* Once one tooltip is open, neighbours open instantly */
283
+ .tooltip[data-instant] {
284
+ transition-duration: 0ms;
285
+ }
286
+ ```
287
+
288
+ The initial delay prevents accidental activation. After that, skipping both the delay and the animation makes the whole toolbar feel faster.
289
+
290
+ ---
291
+
292
+ ## Modal
293
+
294
+ The one popover that stays centered.
295
+
296
+ ```css
297
+ .modal {
298
+ transform-origin: center; /* exempt — not anchored to a trigger */
299
+ transition:
300
+ opacity 250ms var(--ease-out),
301
+ transform 250ms var(--ease-out);
302
+ }
303
+
304
+ .modal[data-starting-style],
305
+ .modal[data-ending-style] {
306
+ opacity: 0;
307
+ transform: scale(0.96);
308
+ }
309
+
310
+ .backdrop {
311
+ transition: opacity 250ms var(--ease-out);
312
+ }
313
+ ```
314
+
315
+ Animate the backdrop's opacity alongside it so they read as one surface.
316
+
317
+ ---
318
+
319
+ ## Drawer / sheet
320
+
321
+ ```css
322
+ .drawer {
323
+ transform: translateY(0);
324
+ transition: transform 500ms var(--ease-drawer);
325
+ }
326
+
327
+ .drawer[data-closed] {
328
+ transform: translateY(100%);
329
+ }
330
+ ```
331
+
332
+ This is how Vaul hides a drawer before animating it in.
333
+
334
+ Add drag and it becomes a gesture problem — see **Drag to dismiss** below.
335
+
336
+ ---
337
+
338
+ ## Toast
339
+
340
+ ```css
341
+ .toast {
342
+ opacity: 1;
343
+ transform: translateY(0);
344
+ transition:
345
+ opacity 400ms ease,
346
+ transform 400ms ease;
347
+
348
+ @starting-style {
349
+ opacity: 0;
350
+ transform: translateY(100%);
351
+ }
352
+ }
353
+ ```
354
+
355
+ - `ease` rather than `ease-out`, slightly slower than typical UI: Sonner reads as elegant partly because its motion is tuned to the component's personality rather than to the generic UI budget.
356
+ - If `@starting-style` isn't available, fall back to the mount flag:
357
+
358
+ ```jsx
359
+ useEffect(() => { setMounted(true); }, []);
360
+ // <div data-mounted={mounted}>
361
+ ```
362
+
363
+ When toasts stack and the list reflows, the opacity change has to work against the height change. There's no formula for that pair — adjust until it feels right, then check it again the next day.
364
+
365
+ ---
366
+
367
+ ## Accordion / collapse
368
+
369
+ ```css
370
+ .content {
371
+ overflow: hidden;
372
+ transition:
373
+ height 200ms var(--ease-out),
374
+ opacity 200ms var(--ease-out);
375
+ }
376
+ ```
377
+
378
+ Keep it short — this is one of the few animations that costs layout on every frame, so a long duration is expensive as well as sluggish. Measure the content height in JS (or use a headless primitive that supplies it) rather than animating to `auto`.
379
+
380
+ ---
381
+
382
+ ## Stagger a group entrance
383
+
384
+ For a list or grid the user sees occasionally — not for a list they scroll past all day.
385
+
386
+ ```css
387
+ .item {
388
+ opacity: 0;
389
+ transform: translateY(8px);
390
+ animation: fadeIn 300ms var(--ease-out) forwards;
391
+ }
392
+
393
+ .item:nth-child(2) { animation-delay: 50ms; }
394
+ .item:nth-child(3) { animation-delay: 100ms; }
395
+ .item:nth-child(4) { animation-delay: 150ms; }
396
+
397
+ @keyframes fadeIn {
398
+ to {
399
+ opacity: 1;
400
+ transform: translateY(0);
401
+ }
402
+ }
403
+ ```
404
+
405
+ Stagger is decorative — it must never block interaction while it plays.
406
+
407
+ ---
408
+
409
+ ## Hold to confirm
410
+
411
+ For destructive actions where a plain click is too easy to fire by accident.
412
+
413
+ ```css
414
+ .overlay {
415
+ clip-path: inset(0 100% 0 0);
416
+ transition: clip-path 200ms var(--ease-out); /* release: snappy */
417
+ }
418
+
419
+ .button:active .overlay {
420
+ clip-path: inset(0 0 0 0);
421
+ transition: clip-path 2s linear; /* press: slow and deliberate */
422
+ }
423
+
424
+ .button:active {
425
+ transform: scale(0.97);
426
+ }
427
+ ```
428
+
429
+ `linear` is correct here — the fill is a progress indicator, and progress shouldn't ease.
430
+
431
+ ---
432
+
433
+ ## Tab indicator with a color transition
434
+
435
+ Timing individual color transitions across a tab list never quite lands. Clip instead.
436
+
437
+ Duplicate the tab list. Style the copy as the active state — different background, different text color. Clip the copy so only the active tab shows, and animate the clip on change:
438
+
439
+ ```css
440
+ .tabs-active-copy {
441
+ clip-path: inset(0 60% 0 20%); /* driven by the active tab's position */
442
+ transition: clip-path 250ms var(--ease-in-out);
443
+ }
444
+ ```
445
+
446
+ The text and background change together, in perfect sync, because they're one element being revealed rather than two colors being interpolated.
447
+
448
+ ---
449
+
450
+ ## Scroll reveal
451
+
452
+ Marketing surfaces only. Don't do this to functional UI a user visits daily.
453
+
454
+ ```css
455
+ .reveal {
456
+ clip-path: inset(0 0 100% 0);
457
+ transition: clip-path 600ms var(--ease-in-out);
458
+ }
459
+
460
+ .reveal[data-visible] {
461
+ clip-path: inset(0 0 0 0);
462
+ }
463
+ ```
464
+
465
+ Trigger with `IntersectionObserver`, or Motion's `useInView` with `{ once: true, margin: "-100px" }`. Fire it once — re-animating on every scroll-by is an interface fighting its reader.
466
+
467
+ ---
468
+
469
+ ## Drag to dismiss
470
+
471
+ The gesture recipe. Springs, not durations, because the user can reverse mid-motion.
472
+
473
+ ```js
474
+ // Dismiss on a flick, not just on distance
475
+ const timeTaken = Date.now() - dragStartTime.current;
476
+ const velocity = Math.abs(swipeAmount) / timeTaken;
477
+
478
+ if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {
479
+ dismiss();
480
+ }
481
+ ```
482
+
483
+ ```js
484
+ // Set transform on the dragged element directly.
485
+ // Driving it through a CSS variable on the parent recalcs styles for every child.
486
+ element.style.transform = `translateY(${distance}px)`;
487
+ ```
488
+
489
+ Four details that separate a good drag from a bad one:
490
+
491
+ - **Pointer capture** once the drag starts, so it continues when the pointer leaves the element's bounds.
492
+ - **Multi-touch protection** — `if (isDragging) return` on new touch points, or switching fingers mid-drag makes the element jump.
493
+ - **Damping past boundaries** — dragging beyond a natural edge moves the element less the further it goes. Real things slow before they stop.
494
+ - **Friction, not a wall** — allow the over-drag with rising resistance rather than refusing it.
495
+
496
+ Settle with a spring so an interrupted drag keeps its velocity:
497
+
498
+ ```js
499
+ { type: "spring", duration: 0.5, bounce: 0.2 }
500
+ ```
501
+
502
+ ---
503
+
504
+ ## Masking a crossfade that won't settle
505
+
506
+ When two states overlap visibly during a transition and no amount of easing or duration tuning fixes it, blur the seam:
507
+
508
+ ```css
509
+ .content {
510
+ transition:
511
+ filter 200ms ease,
512
+ opacity 200ms ease;
513
+ }
514
+
515
+ .content.transitioning {
516
+ filter: blur(2px);
517
+ opacity: 0.7;
518
+ }
519
+ ```
520
+
521
+ Without blur the eye reads two distinct objects swapping. Blur blends them into one perceived transformation. Keep it under 20px — heavy blur is expensive, especially in Safari.
522
+
523
+ ---
524
+
525
+ ## Programmatic, without a library
526
+
527
+ When the motion needs JS control but not a dependency, WAAPI gives you CSS-grade performance:
528
+
529
+ ```js
530
+ element.animate(
531
+ [{ clipPath: 'inset(0 0 100% 0)' }, { clipPath: 'inset(0 0 0 0)' }],
532
+ { duration: 1000, fill: 'forwards', easing: 'cubic-bezier(0.77, 0, 0.175, 1)' }
533
+ );
534
+ ```
535
+
536
+ Hardware-accelerated, interruptible, no bundle cost.