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

Function readTweenSpecFromForm

packages/sdk-playground/src/main.ts:678–688  ·  view source on GitHub ↗
(f: TweenFormInputs)

Source from the content-addressed store, hash-verified

676}
677
678function readTweenSpecFromForm(f: TweenFormInputs): GsapTweenSpec {
679 const propKey = f.prop.value.trim() || "x";
680 const tween: GsapTweenSpec = {
681 method: (f.method.value || "to") as "to" | "from" | "fromTo",
682 duration: numOr(f.dur.value, 0.5),
683 ease: f.ease.value || "power2.out",
684 properties: { [propKey]: coerceNum(f.val.value.trim()) },
685 };
686 applyTweenPosition(tween, f.pos.value.trim());
687 return tween;
688}
689
690function buildAddTweenForm(form: HTMLElement) {
691 form.innerHTML = "";

Callers 1

submitAddTweenFunction · 0.85

Calls 3

numOrFunction · 0.85
coerceNumFunction · 0.85
applyTweenPositionFunction · 0.85

Tested by

no test coverage detected