Mission Control Dashboard - Initial implementation
This commit is contained in:
19
node_modules/motion-dom/dist/es/scroll/observe.mjs
generated
vendored
Normal file
19
node_modules/motion-dom/dist/es/scroll/observe.mjs
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { frame, cancelFrame } from '../frameloop/frame.mjs';
|
||||
|
||||
function observeTimeline(update, timeline) {
|
||||
let prevProgress;
|
||||
const onFrame = () => {
|
||||
const { currentTime } = timeline;
|
||||
const percentage = currentTime === null ? 0 : currentTime.value;
|
||||
const progress = percentage / 100;
|
||||
if (prevProgress !== progress) {
|
||||
update(progress);
|
||||
}
|
||||
prevProgress = progress;
|
||||
};
|
||||
frame.preUpdate(onFrame, true);
|
||||
return () => cancelFrame(onFrame);
|
||||
}
|
||||
|
||||
export { observeTimeline };
|
||||
//# sourceMappingURL=observe.mjs.map
|
||||
1
node_modules/motion-dom/dist/es/scroll/observe.mjs.map
generated
vendored
Normal file
1
node_modules/motion-dom/dist/es/scroll/observe.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"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;;;;"}
|
||||
Reference in New Issue
Block a user