()
| 777 | } |
| 778 | |
| 779 | function 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 | |
| 811 | function needTween(): boolean { |
| 812 | if (lastTweenId) return true; |
nothing calls this directly
no test coverage detected