Initial commit
This commit is contained in:
17
node_modules/framer-motion/dist/es/easing/utils/create-generator-easing.mjs
generated
vendored
Normal file
17
node_modules/framer-motion/dist/es/easing/utils/create-generator-easing.mjs
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
import { calcGeneratorDuration, maxGeneratorDuration } from '../../animation/generators/utils/calc-duration.mjs';
|
||||
import { millisecondsToSeconds } from '../../utils/time-conversion.mjs';
|
||||
|
||||
/**
|
||||
* Create a progress => progress easing function from a generator.
|
||||
*/
|
||||
function createGeneratorEasing(options, scale = 100, createGenerator) {
|
||||
const generator = createGenerator({ ...options, keyframes: [0, scale] });
|
||||
const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);
|
||||
return {
|
||||
type: "keyframes",
|
||||
ease: (progress) => generator.next(duration * progress).value / scale,
|
||||
duration: millisecondsToSeconds(duration),
|
||||
};
|
||||
}
|
||||
|
||||
export { createGeneratorEasing };
|
||||
Reference in New Issue
Block a user