main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

23
node_modules/framer-motion/dist/es/utils/delay.mjs generated vendored Normal file
View File

@@ -0,0 +1,23 @@
import { time, frame, cancelFrame } from 'motion-dom';
import { secondsToMilliseconds } from 'motion-utils';
/**
* Timeout defined in ms
*/
function delay(callback, timeout) {
const start = time.now();
const checkElapsed = ({ timestamp }) => {
const elapsed = timestamp - start;
if (elapsed >= timeout) {
cancelFrame(checkElapsed);
callback(elapsed - timeout);
}
};
frame.setup(checkElapsed, true);
return () => cancelFrame(checkElapsed);
}
function delayInSeconds(callback, timeout) {
return delay(callback, secondsToMilliseconds(timeout));
}
export { delay, delayInSeconds };