设计与多媒体

countdown-video

iart-ai/tiktok-…o-skills

This skill should be used when the user asks to "make a countdown timer video", "create a countdown animation", "build a stream starting soon countdown", "do an event/launch/sale countdown", "animate a mm:ss or dd:hh:mm:ss timer", "add digit roll/flip transitions to a counter", or "loop a countdown background". Covers frame-accurate (drift-free) timers, digit flip/roll motion, time formatting, and a configurable duration prop.

  • 1895 次安装
  • 18 星标
  • 收录于

安装命令

npx skills add https://github.com/iart-ai/tiktok-video-skills --skill countdown-video

SKILL.md

Countdown Video

Make a countdown that ends exactly when it should. The whole craft is one idea: derive the remaining time from the frame (or a monotonic timestamp), then format and animate that number — never count down with a setInterval. Covers livestream "starting soon" screens, launch/sale countdowns, and looping backgrounds.

When to use

  • "Starting soon" / "be right back" livestream screens with a 5–10 min timer.
  • Launch and flash-sale countdowns (dd:hh:mm:ss down to a target date; mm:ss for urgency).
  • Any animated counter where the number must land on zero on the exact frame.

The one rule: drive the number from the clock, never a tick

A setInterval(fn, 1000) countdown drifts — the callback fires at least 1000 ms later, never exactly, and stacks up when the tab is throttled or a render frame is slow. Reports of ~1 second lost per minute are common. The fix is the same for rendered video and live web: compute remaining time as a pure function of an authoritative clock, so a late frame self-corrects on the next frame instead of accumulating error.

Context Authoritative clock Remaining time
Remotion render useCurrentFrame() total − frame/fps
Web (live page) performance.now() or Date.now() targetMs − now
To a fixed date Date.now() targetTimestamp − Date.now()