Files
SnowLuma/.pnpm-store/v11/files/11/97966e573b6616631272d63f7b3c2d2841069c7bc29c76e25028e72b51455fea99200971d18696fc016d73ebbe23ee5e3626f1071d829b9fe3b0bd4706db49
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

1 line
1.2 KiB
Plaintext

{"version":3,"file":"observe.mjs","sources":["../../../src/scroll/observe.ts"],"sourcesContent":["import { ProgressTimeline } from \"../animation/types\"\nimport { cancelFrame, frame } from \"../frameloop\"\n\ntype Update = (progress: number) => void\n\nexport function observeTimeline(update: Update, timeline: ProgressTimeline) {\n let prevProgress: number\n\n const onFrame = () => {\n const { currentTime } = timeline\n const percentage = currentTime === null ? 0 : currentTime.value\n const progress = percentage / 100\n\n if (prevProgress !== progress) {\n update(progress)\n }\n\n prevProgress = progress\n }\n\n frame.preUpdate(onFrame, true)\n\n return () => cancelFrame(onFrame)\n}\n"],"names":[],"mappings":";;AAKM,SAAU,eAAe,CAAC,MAAc,EAAE,QAA0B,EAAA;AACtE,IAAA,IAAI,YAAoB;IAExB,MAAM,OAAO,GAAG,MAAK;AACjB,QAAA,MAAM,EAAE,WAAW,EAAE,GAAG,QAAQ;AAChC,QAAA,MAAM,UAAU,GAAG,WAAW,KAAK,IAAI,GAAG,CAAC,GAAG,WAAW,CAAC,KAAK;AAC/D,QAAA,MAAM,QAAQ,GAAG,UAAU,GAAG,GAAG;AAEjC,QAAA,IAAI,YAAY,KAAK,QAAQ,EAAE;YAC3B,MAAM,CAAC,QAAQ,CAAC;QACpB;QAEA,YAAY,GAAG,QAAQ;AAC3B,IAAA,CAAC;AAED,IAAA,KAAK,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC;AAE9B,IAAA,OAAO,MAAM,WAAW,CAAC,OAAO,CAAC;AACrC;;;;"}