MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / buildAddGsapTweenSection

Function buildAddGsapTweenSection

packages/sdk-playground/src/main.ts:779–809  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

777}
778
779function buildAddGsapTweenSection(): HTMLDivElement {
780 const target = mkInput("target id", selectedId ?? "hf-badge");
781 target.style.width = "110px";
782 const dur = mkNumInput("dur", "0.8");
783 const ease = mkInput("ease", "power2.out");
784 ease.style.width = "110px";
785 const propKey = mkInput("prop", "x");
786 propKey.style.width = "60px";
787 const propVal = mkInput("val", "200");
788 propVal.style.width = "60px";
789 tweenIdDisplay = document.createElement("div");
790 tweenIdDisplay.id = "anim-id-display";
791 tweenIdDisplay.textContent = lastTweenId || "no tween added yet";
792 const add = mkBtn("Add →", "primary", () => {
793 const tween: GsapTweenSpec = {
794 method: "to",
795 duration: numOr(dur.value, 0.5),
796 ease: ease.value || "power2.out",
797 properties: { [propKey.value.trim()]: coerceNum(propVal.value) },
798 };
799 lastTweenId = comp!.addGsapTween(target.value.trim(), tween);
800 tweenIdDisplay.textContent = lastTweenId;
801 logEntry("op", { addGsapTween: { target: target.value, tween, id: lastTweenId } });
802 });
803 return opSection(
804 "addGsapTween",
805 opRow(target, dur, ease),
806 opRow(propKey, propVal, add),
807 tweenIdDisplay,
808 );
809}
810
811function needTween(): boolean {
812 if (lastTweenId) return true;

Callers

nothing calls this directly

Calls 9

mkInputFunction · 0.85
mkNumInputFunction · 0.85
mkBtnFunction · 0.85
numOrFunction · 0.85
coerceNumFunction · 0.85
logEntryFunction · 0.85
opSectionFunction · 0.85
opRowFunction · 0.85
addGsapTweenMethod · 0.65

Tested by

no test coverage detected