first commit
This commit is contained in:
12
node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs
generated
vendored
Normal file
12
node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
const generateLinearEasing = (easing, duration, // as milliseconds
|
||||
resolution = 10 // as milliseconds
|
||||
) => {
|
||||
let points = "";
|
||||
const numPoints = Math.max(Math.round(duration / resolution), 2);
|
||||
for (let i = 0; i < numPoints; i++) {
|
||||
points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + ", ";
|
||||
}
|
||||
return `linear(${points.substring(0, points.length - 2)})`;
|
||||
};
|
||||
|
||||
export { generateLinearEasing };
|
||||
Reference in New Issue
Block a user