Files
SnowLuma/.pnpm-store/v11/files/cf/d7ce2b6e5dedf8310734c471984e0ac953e0bdcc5cef8a3d6b69862fec9ff90a437b76c6a4dab32e06f09d31f4540803e44d4c3ac159bf76a60bde5396d90d
T
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

21 lines
749 B
Plaintext

import { millisecondsToSeconds } from 'motion-utils';
import { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.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) => {
return generator.next(duration * progress).value / scale;
},
duration: millisecondsToSeconds(duration),
};
}
export { createGeneratorEasing };
//# sourceMappingURL=create-generator-easing.mjs.map