Skip to content

The open-source full-stack studio for Opus 5.5 motion video. Reverse engineering for any video. Code video with HTML: recreate, edit and render. BYOA + BYOK · Motion.md · Images, Video, Music & Voice.

631 B
Raw Blame
import { usePlayerStore, type KeyframeCacheEntry } from "../store/playerStore";
import type { GsapAnimation } from "@hyperframes/core/gsap-parser";

const HIDDEN = {
  gsapAnimations: new Map<string, GsapAnimation[]>(),
  keyframeCache: new Map<string, KeyframeCacheEntry>(),
};

/** The keyframe data the timeline draws, or none when the host hides keyframes. */
export function useTimelineKeyframeData(showKeyframes: boolean) {
  const gsapAnimations = usePlayerStore((s) => s.gsapAnimations);
  const keyframeCache = usePlayerStore((s) => s.keyframeCache);
  return showKeyframes ? { gsapAnimations, keyframeCache } : HIDDEN;
}