Initial commit
This commit is contained in:
17
node_modules/framer-motion/dist/es/animation/generators/utils/calc-duration.mjs
generated
vendored
Normal file
17
node_modules/framer-motion/dist/es/animation/generators/utils/calc-duration.mjs
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Implement a practical max duration for keyframe generation
|
||||
* to prevent infinite loops
|
||||
*/
|
||||
const maxGeneratorDuration = 20000;
|
||||
function calcGeneratorDuration(generator) {
|
||||
let duration = 0;
|
||||
const timeStep = 50;
|
||||
let state = generator.next(duration);
|
||||
while (!state.done && duration < maxGeneratorDuration) {
|
||||
duration += timeStep;
|
||||
state = generator.next(duration);
|
||||
}
|
||||
return duration >= maxGeneratorDuration ? Infinity : duration;
|
||||
}
|
||||
|
||||
export { calcGeneratorDuration, maxGeneratorDuration };
|
||||
5
node_modules/framer-motion/dist/es/animation/generators/utils/is-generator.mjs
generated
vendored
Normal file
5
node_modules/framer-motion/dist/es/animation/generators/utils/is-generator.mjs
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
function isGenerator(type) {
|
||||
return typeof type === "function";
|
||||
}
|
||||
|
||||
export { isGenerator };
|
||||
9
node_modules/framer-motion/dist/es/animation/generators/utils/velocity.mjs
generated
vendored
Normal file
9
node_modules/framer-motion/dist/es/animation/generators/utils/velocity.mjs
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import { velocityPerSecond } from '../../../utils/velocity-per-second.mjs';
|
||||
|
||||
const velocitySampleDuration = 5; // ms
|
||||
function calcGeneratorVelocity(resolveValue, t, current) {
|
||||
const prevT = Math.max(t - velocitySampleDuration, 0);
|
||||
return velocityPerSecond(current - resolveValue(prevT), t - prevT);
|
||||
}
|
||||
|
||||
export { calcGeneratorVelocity };
|
||||
Reference in New Issue
Block a user