Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
21bc25e
Earth Watch: fixes from the first live sweep + live OWID verification
marcoloco23 Sep 26, 2026
2b6e341
Earth Watch: fixes from the first live sweep + live OWID verification
marcoloco23 Sep 26, 2026
cd12325
M3 chores: ledger_* MCP tools, doctor Watch section, JSON Schema export
marcoloco23 Sep 26, 2026
729f10e
M3: flaring tool + flaring@1.0 watch rule
marcoloco23 Sep 26, 2026
0cf3717
Merge branch 'worktree-agent-aecf1d93d208459a5' into worktree-earth-w…
marcoloco23 Sep 26, 2026
0b58aea
watchlists: raise control thresholds above observed floodplain alert …
marcoloco23 Sep 26, 2026
051ca74
Merge branch 'worktree-agent-a2f6087f83aec1bfa' into worktree-earth-w…
marcoloco23 Sep 26, 2026
2a9896c
pnpm: approve esbuild build scripts (pnpm 11 refused to run scripts o…
marcoloco23 Sep 26, 2026
4fca639
fires_in: FIRMS area API now caps dayRange at 5 (observed live); clam…
marcoloco23 Sep 26, 2026
bbd4fc5
M3 methane wedge: methane_plumes tool + methane_anomaly@1.0 rule
marcoloco23 Sep 26, 2026
d480daa
doctor: drop the hardcoded tool ratio; ship schema/ in the npm package
marcoloco23 Sep 26, 2026
7c2b03b
Merge branch 'worktree-agent-a1c439d5558b93fd5' into worktree-earth-w…
marcoloco23 Sep 26, 2026
f226e9e
VISION §14: the life layer — biodiversity incl. fungi, honest per-pla…
marcoloco23 Sep 26, 2026
b4066ac
M3 attribution: protected_areas + emitters tools
marcoloco23 Sep 26, 2026
de19865
protected_areas: add WDPA via GFW Data API (IDs + stats only); revert…
marcoloco23 Sep 26, 2026
41fe939
Merge branch 'worktree-agent-a7940c1719149a10e' into worktree-earth-w…
marcoloco23 Sep 26, 2026
1e70ed4
Dashboard UI: mission-control design system, case pages, calm motion
marcoloco23 Sep 26, 2026
4778e65
ROADMAP: M2 live-verified, M3 shipped; scripts/list-tools.mjs
marcoloco23 Sep 26, 2026
8eebd43
Merge branch 'worktree-agent-a543cb68c200fe0aa' into worktree-earth-w…
marcoloco23 Sep 26, 2026
1974f47
CONTINUITY + PROGRESS: session 8b — MVP handoff
marcoloco23 Sep 26, 2026
f290aec
Life layer: biodiversity, species, coral_bleaching + world_pulse life…
marcoloco23 Sep 26, 2026
31ce03a
Merge branch 'worktree-agent-a89ec6ebab1307277' into worktree-earth-w…
marcoloco23 Sep 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
385 changes: 385 additions & 0 deletions .agents/skills/animate-expo/RECIPES.md

Large diffs are not rendered by default.

263 changes: 263 additions & 0 deletions .agents/skills/animate-expo/SKILL.md

Large diffs are not rendered by default.

324 changes: 324 additions & 0 deletions .agents/skills/animate/RECIPES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,324 @@
# Animation Recipes

Ready-to-build implementations for the cases that come up most. Start from the recipe, then adapt — don't rebuild from scratch.

Curves are the `--ease-out`, `--ease-in-out`, and `--ease-drawer` tokens defined in SKILL.md.

---

## Button press

Any pressable element. Instant feedback that the interface heard the user.

```css
.button {
transition: transform 160ms var(--ease-out);
}

.button:active {
transform: scale(0.97);
}
```

`scale()` scales children too — the label and icons come along, which is what makes it read as a physical press.

No hover gating needed here: `:active` is a real press on touch. Gate any `:hover` styling separately.

---

## Dropdown, popover, menu, select

Scales out of its trigger, not out of thin air.

```css
.popover {
transform-origin: var(--transform-origin); /* Base UI supplies this */
transition:
opacity 200ms var(--ease-out),
transform 200ms var(--ease-out);
}

.popover[data-starting-style],
.popover[data-ending-style] {
opacity: 0;
transform: scale(0.95);
}
```

The `transform-origin` is the whole point — the panel should look like it came out of the thing you clicked.

---

## Tooltip

Same shape as a popover, faster, plus the detail most implementations miss.

```css
.tooltip {
transform-origin: var(--transform-origin);
transition:
transform 125ms var(--ease-out),
opacity 125ms var(--ease-out);
}

.tooltip[data-starting-style],
.tooltip[data-ending-style] {
opacity: 0;
transform: scale(0.97);
}

/* Once one tooltip is open, neighbours open instantly */
.tooltip[data-instant] {
transition-duration: 0ms;
}
```

The initial delay prevents accidental activation. After that, skipping both the delay and the animation makes the whole toolbar feel faster.

---

## Modal

The one popover that stays centered.

```css
.modal {
transform-origin: center; /* exempt — not anchored to a trigger */
transition:
opacity 250ms var(--ease-out),
transform 250ms var(--ease-out);
}

.modal[data-starting-style],
.modal[data-ending-style] {
opacity: 0;
transform: scale(0.96);
}

.backdrop {
transition: opacity 250ms var(--ease-out);
}
```

Animate the backdrop's opacity alongside it so they read as one surface.

---

## Drawer / sheet

```css
.drawer {
transform: translateY(0);
transition: transform 500ms var(--ease-drawer);
}

.drawer[data-closed] {
transform: translateY(100%);
}
```

This is how Vaul hides a drawer before animating it in.

Add drag and it becomes a gesture problem — see **Drag to dismiss** below.

---

## Toast

```css
.toast {
opacity: 1;
transform: translateY(0);
transition:
opacity 400ms ease,
transform 400ms ease;

@starting-style {
opacity: 0;
transform: translateY(100%);
}
}
```

- `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.
- If `@starting-style` isn't available, fall back to the mount flag:

```jsx
useEffect(() => { setMounted(true); }, []);
// <div data-mounted={mounted}>
```

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.

---

## Accordion / collapse

```css
.content {
overflow: hidden;
transition:
height 200ms var(--ease-out),
opacity 200ms var(--ease-out);
}
```

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`.

---

## Stagger a group entrance

For a list or grid the user sees occasionally — not for a list they scroll past all day.

```css
.item {
opacity: 0;
transform: translateY(8px);
animation: fadeIn 300ms var(--ease-out) forwards;
}

.item:nth-child(2) { animation-delay: 50ms; }
.item:nth-child(3) { animation-delay: 100ms; }
.item:nth-child(4) { animation-delay: 150ms; }

@keyframes fadeIn {
to {
opacity: 1;
transform: translateY(0);
}
}
```

Stagger is decorative — it must never block interaction while it plays.

---

## Hold to confirm

For destructive actions where a plain click is too easy to fire by accident.

```css
.overlay {
clip-path: inset(0 100% 0 0);
transition: clip-path 200ms var(--ease-out); /* release: snappy */
}

.button:active .overlay {
clip-path: inset(0 0 0 0);
transition: clip-path 2s linear; /* press: slow and deliberate */
}

.button:active {
transform: scale(0.97);
}
```

`linear` is correct here — the fill is a progress indicator, and progress shouldn't ease.

---

## Tab indicator with a color transition

Timing individual color transitions across a tab list never quite lands. Clip instead.

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:

```css
.tabs-active-copy {
clip-path: inset(0 60% 0 20%); /* driven by the active tab's position */
transition: clip-path 250ms var(--ease-in-out);
}
```

The text and background change together, in perfect sync, because they're one element being revealed rather than two colors being interpolated.

---

## Scroll reveal

Marketing surfaces only. Don't do this to functional UI a user visits daily.

```css
.reveal {
clip-path: inset(0 0 100% 0);
transition: clip-path 600ms var(--ease-in-out);
}

.reveal[data-visible] {
clip-path: inset(0 0 0 0);
}
```

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.

---

## Drag to dismiss

The gesture recipe. Springs, not durations, because the user can reverse mid-motion.

```js
// Dismiss on a flick, not just on distance
const timeTaken = Date.now() - dragStartTime.current;
const velocity = Math.abs(swipeAmount) / timeTaken;

if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {
dismiss();
}
```

```js
// Set transform on the dragged element directly.
// Driving it through a CSS variable on the parent recalcs styles for every child.
element.style.transform = `translateY(${distance}px)`;
```

Four details that separate a good drag from a bad one:

- **Pointer capture** once the drag starts, so it continues when the pointer leaves the element's bounds.
- **Multi-touch protection** — `if (isDragging) return` on new touch points, or switching fingers mid-drag makes the element jump.
- **Damping past boundaries** — dragging beyond a natural edge moves the element less the further it goes. Real things slow before they stop.
- **Friction, not a wall** — allow the over-drag with rising resistance rather than refusing it.

Settle with a spring so an interrupted drag keeps its velocity:

```js
{ type: "spring", duration: 0.5, bounce: 0.2 }
```

---

## Masking a crossfade that won't settle

When two states overlap visibly during a transition and no amount of easing or duration tuning fixes it, blur the seam:

```css
.content {
transition:
filter 200ms ease,
opacity 200ms ease;
}

.content.transitioning {
filter: blur(2px);
opacity: 0.7;
}
```

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.

---

## Programmatic, without a library

When the motion needs JS control but not a dependency, WAAPI gives you CSS-grade performance:

```js
element.animate(
[{ clipPath: 'inset(0 0 100% 0)' }, { clipPath: 'inset(0 0 0 0)' }],
{ duration: 1000, fill: 'forwards', easing: 'cubic-bezier(0.77, 0, 0.175, 1)' }
);
```

Hardware-accelerated, interruptible, no bundle cost.
Loading
Loading