Skip to content

Diogenesoftoronto/keating / video/keating-surface-tour/.agents/skills/hyperframes-animation

hyperframes-animation

Verified

All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.

FileKindSize
SKILL.mdskill md7.6 KB
adapters/animate-text.mdmarkdown4.0 KB
adapters/animejs.mdmarkdown6.1 KB
adapters/css-animations.mdmarkdown5.3 KB
adapters/gsap-easing-and-stagger.mdmarkdown13.0 KB
adapters/gsap-timeline-and-labels.mdmarkdown3.6 KB
adapters/gsap-transforms-and-perf.mdmarkdown8.4 KB
adapters/gsap.mdmarkdown6.9 KB
adapters/html-in-canvas-patterns.mdmarkdown16.8 KB
adapters/lottie.mdmarkdown4.0 KB
adapters/three.mdmarkdown5.1 KB
adapters/typegpu.mdmarkdown7.9 KB
adapters/waapi.mdmarkdown4.1 KB
blueprints-index.mdmarkdown25.9 KB
blueprints/agent-progress-theater.mdmarkdown15.7 KB
blueprints/camera-journey.mdmarkdown13.3 KB
blueprints/comparison-split.mdmarkdown3.2 KB
blueprints/constellation-hub.mdmarkdown7.0 KB
blueprints/cta-morph-press.mdmarkdown6.3 KB
blueprints/cursor-ui-demo.mdmarkdown19.8 KB
blueprints/dataviz-countup.mdmarkdown14.3 KB
blueprints/device-surface-showcase.mdmarkdown16.7 KB
blueprints/fixed-anchor-cycle.mdmarkdown8.9 KB
blueprints/grid-card-assemble.mdmarkdown15.2 KB
blueprints/kinetic-type-beats.mdmarkdown28.5 KB
blueprints/logo-assemble-lockup.mdmarkdown26.0 KB
blueprints/overwhelm-surround.mdmarkdown6.0 KB
blueprints/panel-edit-live-sync.mdmarkdown13.1 KB
blueprints/prompt-type-submit-generate.mdmarkdown18.2 KB
blueprints/spatial-pan-stations.mdmarkdown4.8 KB
blueprints/ticker-takeover.mdmarkdown3.0 KB
blueprints/titlecard-reveal.mdmarkdown7.3 KB
blueprints/transcript-scroll-artifact-reveal.mdmarkdown11.4 KB
blueprints/typewriter-reveal.mdmarkdown6.1 KB
blueprints/video-text-pivot.mdmarkdown3.2 KB
blueprints/zoom-out-workspace-reveal.mdmarkdown14.4 KB
examples/brand-reveal-assemble-zoom.htmlother12.0 KB
examples/comparison-split-cards.htmlother21.2 KB
examples/concept-demo-decode-pan.htmlother18.0 KB
examples/cta-morph-press.htmlother14.8 KB
examples/cta-orbit-collapse.htmlother49.5 KB
examples/demo-page-scroll-spotlight.htmlother24.4 KB
examples/hook-counter-burst.htmlother22.5 KB
examples/messaging-multi-phrase.htmlother11.9 KB
examples/metric-video-text-pivot.htmlother25.0 KB
examples/problem-mockup-overwhelm.htmlother43.4 KB
examples/proof-logo-chain.htmlother28.2 KB
examples/takeover-ticker-displace.htmlother10.7 KB
examples/workflow-approve-press.htmlother20.2 KB
rules-index.mdmarkdown20.7 KB
rules/3d-camera-flight.mdmarkdown17.7 KB
rules/3d-page-scroll.mdmarkdown7.2 KB
rules/3d-text-depth-layers.mdmarkdown6.6 KB
rules/ai-tracking-box.mdmarkdown6.4 KB
rules/ambient-glow-bloom.mdmarkdown9.6 KB
rules/anchored-layout-expand.mdmarkdown10.1 KB
rules/asr-keyword-glow.mdmarkdown6.6 KB
rules/avatar-cloud-network.mdmarkdown6.4 KB
rules/camera-cursor-tracking.mdmarkdown7.7 KB
rules/card-morph-anchor.mdmarkdown7.2 KB
rules/center-outward-expansion.mdmarkdown4.2 KB
rules/chart-scrub-readout.mdmarkdown10.1 KB
rules/chromatic-glitch.mdmarkdown10.1 KB
rules/context-sensitive-cursor.mdmarkdown6.8 KB
rules/control-target-sync.mdmarkdown10.0 KB
rules/coordinate-target-zoom.mdmarkdown7.4 KB
rules/counting-dynamic-scale.mdmarkdown5.8 KB
rules/css-marker-patterns.mdmarkdown5.6 KB
rules/cursor-click-ripple.mdmarkdown6.3 KB
rules/cursor-drag.mdmarkdown10.0 KB
rules/depth-of-field-blur.mdmarkdown8.7 KB
rules/depth-scatter-assemble.mdmarkdown6.9 KB
rules/discrete-text-sequence.mdmarkdown6.3 KB
rules/dynamic-content-sequencing.mdmarkdown8.4 KB
rules/gradient-text-sweep.mdmarkdown8.5 KB
rules/gsap-effects.mdmarkdown6.8 KB
rules/hacker-flip-3d.mdmarkdown5.5 KB
rules/kinetic-beat-slam.mdmarkdown6.3 KB
rules/motion-blur-streak.mdmarkdown10.4 KB
rules/multi-cursor-choreography.mdmarkdown10.3 KB
rules/multi-phase-camera.mdmarkdown7.6 KB
rules/nudge-curve.mdmarkdown2.6 KB
rules/orbit-3d-entry.mdmarkdown6.5 KB
rules/particle-burst.mdmarkdown9.7 KB
rules/physics-press-reaction.mdmarkdown6.5 KB
rules/press-release-spring.mdmarkdown6.9 KB
rules/reactive-displacement.mdmarkdown6.4 KB
rules/scale-swap-transition.mdmarkdown5.4 KB
rules/sine-wave-loop.mdmarkdown6.0 KB
rules/split-tilt-cards.mdmarkdown5.5 KB
rules/spring-pop-entrance.mdmarkdown6.4 KB
rules/stat-bars-and-fills.mdmarkdown5.4 KB
rules/svg-icon-enrichment.mdmarkdown7.4 KB
rules/svg-path-draw.mdmarkdown5.2 KB
rules/theme-crossfade-morph.mdmarkdown9.2 KB
rules/vertical-spring-ticker.mdmarkdown5.4 KB
rules/viewport-change.mdmarkdown8.8 KB
rules/waterfall-entry.mdmarkdown4.5 KB
scripts/animation-map-sampling.mjsscript1.4 KB
scripts/animation-map-sampling.test.mjsscript1.6 KB
scripts/animation-map.mjsscript19.8 KB
scripts/animation-map.test.mjsscript12.1 KB
scripts/package-loader.mjsscript13.2 KB
scripts/package-loader.test.mjsscript2.5 KB
techniques.mdmarkdown15.4 KB
transitions/TRANSITION-REGISTRY.mdmarkdown7.9 KB
transitions/catalog.mdmarkdown6.5 KB
transitions/css-3d.mdmarkdown421 B
transitions/css-blur.mdmarkdown1.7 KB
transitions/css-cover.mdmarkdown1.4 KB
transitions/css-destruction.mdmarkdown4.4 KB
transitions/css-dissolve.mdmarkdown2.4 KB
transitions/css-distortion.mdmarkdown1.8 KB
transitions/css-grid.mdmarkdown370 B
transitions/css-light.mdmarkdown2.3 KB
transitions/css-mechanical.mdmarkdown1.6 KB
transitions/css-other.mdmarkdown838 B
transitions/css-push.mdmarkdown1.2 KB
transitions/css-radial.mdmarkdown1.0 KB
transitions/css-scale.mdmarkdown715 B
transitions/overview.mdmarkdown13.5 KB

rules/dynamic-content-sequencing.md

View on GitHub
---
name: dynamic-content-sequencing
description: Auto-calculate timeline start/end times from content length + per-item duration config — longer content gets more screen time without hardcoded numbers.
metadata:
  tags: timeline, sequencing, dynamic, duration, content-aware, utility
---

# Dynamic Content Sequencing

A utility pattern (not a motion rule in itself) for scenes that show a SEQUENCE of items (cards, phrases, stats): each item's duration is computed from its content length + per-item config, and the sequencer assigns absolute start/end times automatically — no hardcoded offsets per item. Distinct from [discrete-text-sequence](discrete-text-sequence.md) (one text element changing states) — this rule swaps between distinct content blocks.

## How It Works

A content array of `{ eyebrow, title, body, speedFactor, hold }` entries is reduced once at build time into a flat `TIMELINE` of `{ …entry, start, end }` — duration per entry is `BASE_DURATION + body.length × SEC_PER_CHAR + hold`, so longer text earns more reading time. A single linear driver's `onUpdate` reverse-searches the active entry and swaps the DOM **only on transitions** (a `lastTitle` guard — per-frame `textContent` writes flicker in render); an optional progress bar fills 0→100% across the whole run.

## Recipe

```html
<!-- inside a standard scene clip (hyperframes-core) -->
<div class="display">
  <div class="eyebrow" id="eyebrow"></div>
  <div class="title" id="title"></div>
  <div class="body" id="body"></div>
  <div class="progress-bar"><div class="progress-fill" id="progress-fill"></div></div>
</div>
```

```css
.body {
  min-height: 160px; /* reserve space — content height varies; without this, layout jumps */
}
.progress-fill {
  height: 100%;
  width: 0%;
}
```

```js
// N entries, each with its own pacing (optionally a speedFactor multiplier);
// the final entry uses a larger hold (closing beat).
const CONTENT = [
  { eyebrow: "{eyebrow1}", title: "{title1}", body: "{body1}", hold: HOLD_MID },
  // …
  { eyebrow: "{eyebrowN}", title: "{titleN}", body: "{bodyN}", hold: HOLD_FINAL },
];

// Pre-compute absolute start/end ONCE — never in onUpdate.
let cumulative = 0;
const TIMELINE = CONTENT.map((entry) => {
  const dur = BASE_DURATION + entry.body.length * SEC_PER_CHAR + entry.hold;
  const start = cumulative;
  cumulative += dur;
  return { ...entry, start, end: cumulative };
});

function entryAt(time) {
  for (let i = TIMELINE.length - 1; i >= 0; i--) {
    if (time >= TIMELINE[i].start) return TIMELINE[i];
  }
  return TIMELINE[0];
}

const eyebrowEl = document.getElementById("eyebrow");
const titleEl = document.getElementById("title");
const bodyEl = document.getElementById("body");
const progressEl = document.getElementById("progress-fill");

const TOTAL_DURATION = cumulative + TAIL_PAD;
const driver = { t: 0 };
let lastTitle = "";

tl.to(
  driver,
  {
    t: TOTAL_DURATION,
    duration: TOTAL_DURATION,
    ease: "none",
    onUpdate: () => {
      const entry = entryAt(driver.t);
      // Swap content only on transitions — no per-frame DOM thrash
      if (entry.title !== lastTitle) {
        eyebrowEl.textContent = entry.eyebrow;
        titleEl.textContent = entry.title;
        bodyEl.textContent = entry.body;
        lastTitle = entry.title;
      }
      progressEl.style.width = `${(driver.t / TOTAL_DURATION) * 100}%`;
    },
  },
  0,
);
```

## Variations

- **Crossfade between items** — return BOTH adjacent entries during an overlap window (`time ≥ e.start − overlap && time ≤ e.end + overlap`, overlap ≈ 0.3s) and render them with opacities computed from distance to the boundary.
- **Per-item motion variation** — map an `entry.style` key to an existing rule per chapter (e.g. `3d-text-depth-layers` → `hacker-flip-3d` → `counting-dynamic-scale`); the sequencer only orchestrates timing.
- **Auto-extend composition duration** — you can set `data-duration` from the computed `TOTAL_DURATION` in script, but HF reads `data-duration` at composition load and setting it after init may not take effect — author the duration manually from a rough total.

### Accelerating cadence (geometric hold decay)

For rhetorical escalation — "everyone says…", a roll-call, a praise flurry — the beat grid itself accelerates: early entries hold ~1s (read speed), then windows shrink geometrically into a ~0.15–0.3s flurry, braking on an emphasis state before the resolve. The acceleration is pre-computed into the same flat `TIMELINE` — still content-driven, still deterministic, no speed-up tween anywhere:

```js
// Geometric decay on the hold, clamped at a flurry floor; the brake state holds longest.
const HOLDS = CONTENT.map((entry, i) => Math.max(FLURRY_FLOOR, HOLD_START * Math.pow(DECAY, i)));
HOLDS[CONTENT.length - 1] = HOLD_FINAL;

let cumulative = 0;
const TIMELINE = CONTENT.map((entry, i) => {
  // Past ~0.5s states are glanced as motion texture, not read —
  // drop the per-char term or you never reach flurry speed.
  const readable = HOLDS[i] >= READ_THRESHOLD;
  const dur = HOLDS[i] + (readable ? entry.body.length * SEC_PER_CHAR : 0);
  const start = cumulative;
  cumulative += dur;
  return { ...entry, start, end: cumulative };
});
```

Worked example — **praise-chip flurry**: ~16 short quotes hard-cut through a chip beside a pinned wordmark. First 3 states at `HOLD_START = 1.0` (each reads fully); `DECAY = 0.8` shrinks every following window until `FLURRY_FLOOR = 0.2` catches it (≈12 states over ~2.5s — a churn of acclaim, individually glanced); the longest phrase takes `HOLD_FINAL ≈ 1.6` as the brake before the closing lockup.

Values: `HOLD_START` 0.8–1.2s; `DECAY` 0.75–0.88 (higher = longer runway before the flurry bites); `FLURRY_FLOOR` 0.15–0.3s (below ~0.15s swaps strobe); `READ_THRESHOLD` ~0.5s; brake ≥ 4× the floor or the stop doesn't register as a beat. The 3–6 entry guidance relaxes here — 12–18 states are legal precisely because flurry states aren't individually read. The hard-cut discipline (`lastTitle` guard, instant swaps) is what lets 0.2s states render clean.

## Values

| token         | range                 | notes                                                                                                                 |
| ------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------- |
| BASE_DURATION | 0.6–1.5s              | minimum per entry regardless of length — even one-word entries get read time                                          |
| SEC_PER_CHAR  | 0.03–0.06 s/char      | ≈17–33 chars/sec; uniform across the sequence so the pace reads as one engine; lean high for wide-character languages |
| HOLD_MID      | 0.5–1.0s              | dwell on a non-final entry; `< HOLD_FINAL`                                                                            |
| HOLD_FINAL    | 1.0–2.0s              | climax dwell — must exceed HOLD_MID by a clear margin so the close reads as a beat                                    |
| SPEED_FACTOR  | 0.5–2.0 (default 1.0) | per-entry only; if every entry shares a factor, fold it into SEC_PER_CHAR                                             |
| TAIL_PAD      | 0.0–1.0s              | quiet beat after the last entry; prefer 0 when the next composition owns the breath                                   |
| CONTENT N     | 3–6 entries           | <3 isn't a sequence; >6 drags (accelerating cadence relaxes this — see above)                                         |

Reference: `../../examples/messaging-multi-phrase.html`.

## Critical Constraints

- **Pre-compute the TIMELINE once at build** — never recompute in `onUpdate`; the reverse search over the flat array is the whole per-frame cost.
- **DOM swap only on entry transition** (`lastTitle`/key guard) — per-frame `textContent` assignment flickers in HF render.
- **`min-height` on the body element** — without reservation, downstream elements (progress bar, brand) jitter as content height varies.
- **Sequential only** — for parallel tracks use a different reduction.
- **Titles fit one line at the chosen size; bodies fit inside `min-height` after wrapping.**

## See also

`discrete-text-sequence` (per-entry typewriter on the body) · `context-sensitive-cursor` (cursor color per chapter) · `vertical-spring-ticker` (animated word swap instead of hard cut) · `scale-swap-transition` (visual morph between entries).
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 469kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 469kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 469kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall