All skills
heygen-com avatar

/hyperframes-animation

@ff6e210
by HeyGenheygen-com/hyperframes55k stars
4,998

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.

Use this Skill: https://skilld.dev/gh/heygen-com/hyperframes/hyperframes-animation

This session only. Nothing lands on disk.

rulescounting-dynamic-scale.md

≈1.5k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Counting with Dynamic Scale

A number counts from A → B while its transform scale grows to the final size — escalating visual weight ("this is impressive") without tweening font-size or forcing text layout on every frame. The final font size is static CSS; only the transform changes.

How It Works

Two synchronized tweens at the SAME timeline position with the SAME ease: (1) a proxy value rendered as text via onUpdate (Math.round(...).toLocaleString()), (2) the counter's transform scale: START_SCALE → 1, where START_SCALE = START_SIZE / END_SIZE. A suffix (%, ×, +) slides in AFTER the count lands — the number gets its own beat — and a label fades in early.

Recipe

<!-- inside a standard scene clip (hyperframes-core) -->
<div class="counter-wrap">
  <span class="counter" id="counter">0</span><span class="counter-suffix">{suffix}</span>
</div>
<div class="counter-label">{label}</div>
.counter-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  width: {counterContainerWidth}; /* fixed width — no layout shift as digit count changes */
}
.counter {
  font-variant-numeric: tabular-nums; /* MANDATORY — digits keep equal width */
  display: inline-block;
  font-size: {endSize}; /* final size is static; GSAP animates scale, not font-size */
  transform-origin: center center;
}
.counter-suffix {
  opacity: 0;
  transform: translateY(20px);
}
const counter = document.getElementById("counter");
const state = { value: 0 };
const START_SCALE = START_SIZE / END_SIZE;

// Count value — onUpdate changes text only
tl.to(
  state,
  {
    value: TARGET_VALUE,
    duration: COUNT_DUR,
    ease: COUNT_EASE,
    onUpdate: () => {
      counter.textContent = Math.round(state.value).toLocaleString();
    },
  },
  0,
);

// Visual growth — compositor transform sharing the count's timing + ease
tl.fromTo(counter, { scale: START_SCALE }, { scale: 1, duration: COUNT_DUR, ease: COUNT_EASE }, 0);

// Suffix slides in AFTER the count completes
tl.to(
  ".counter-suffix",
  { opacity: 1, y: 0, duration: SUFFIX_DUR, ease: `back.out(${SUFFIX_BOUNCE_FACTOR})` },
  COUNT_DUR,
);

// Label fades in early
tl.from(".counter-label", { opacity: 0, y: 12, duration: LABEL_DUR, ease: "power2.out" }, LABEL_AT);

Variations

  • Direct innerText tween (no proxy) — GSAP can tween innerText directly for a number-only counter; keep the proxy form when you need locale formatting or suffix logic. The scale tween stays separate either way:
tl.to(
  counter,
  { innerText: TARGET_VALUE, duration: COUNT_DUR, ease: COUNT_EASE, snap: { innerText: 1 } },
  0,
);
  • 3D depth entry — add a tl.from(".counter", { z: -300, ... }, 0) push-in; requires perspective on .counter-wrap and transform-style: preserve-3d on the counter.
  • Multi-stat coordinated reveal — 3 stats counting in parallel share the SAME ease, duration, and start position so they finish together (a chord, not an arpeggio). Each stat usually also needs a paired graphic (bar / ring / stars) — don't stop at the number; see stat-bars-and-fills.md.

Values

token range notes
TARGET_VALUE 2–3 digits ideal 4+ digits needs a wider container; must fit at END_SIZE without clipping
START_SIZE / END_SIZE START ≈ 40–60% of END design inputs used once for START_SCALE; never tween either
COUNT_DUR 1.2–2.5s below ~0.8s reads as a flash — the eye must read the digits scrolling past
COUNT_EASE power2.out / power3.out ⭐ / expo.out shared by value + scale; more .out = more dramatic deceleration at the peak
SUFFIX_DUR 0.3–0.6s fires at COUNT_DUR, never during the count
SUFFIX_BOUNCE_FACTOR 1.4–2.0 overshoot is fine on the suffix (it's punctuation, not data)
LABEL_AT / LABEL_DUR AT < COUNT_DUR/2; 0.4–0.7s label arrives before the count peaks

Critical Constraints

  • tabular-nums mandatory + fixed-width container as belt-and-suspenders — without them digit-count transitions (9 → 10 → 100) jitter as glyph widths change.
  • Never set fontSize in onUpdate — final type size is static CSS; only the transform changes per frame. Keep onUpdate O(1): set text only, no style writes or DOM creation.
  • Math.round, not Math.floor — halfway through the final integer should already display the final value.
  • Avoid back.out / elastic.out on the counter itself — overshoot makes the number look unstable (it's data, not decoration). Grow in place, don't bounce.
  • Label is BIG TEXT, not a page-style caption — a tiny paragraph under a hero-size number reads as visual noise in video. Display-size, uppercase, tracked: the label is part of the headline.

See also

stat-bars-and-fills (the paired graphic — give it the same ease/duration so number and fill land as one beat) · svg-path-draw (icons drawing in around the number) · center-outward-expansion (icons bursting outward at the count peak).

Source: SKILL.md on GitHub

No alerts3d3 checks · Risk SAFE
  • Gen Agent Trust Hub3d

    The skill is a comprehensive knowledge base and utility set for HyperFrames animations. It includes an auditing tool that dynamically installs vendor-specific dependencies from the NPM registry to analyze project timelines. The behavior is documented, tested, and follows established development patterns for CLI utilities.

  • Socket3d

    No alerts

  • Snyk3d

    Risk: LOW · No issues

Signed by skilld at ff6e210. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 16 hours ago.

Activeupdated 4 days ago

README badge

README badge for heygen-com/hyperframes/hyperframes-animation