| 123456789101112 |
- 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 += easing(i / (numPoints - 1)) + ", ";
- }
- return `linear(${points.substring(0, points.length - 2)})`;
- };
- export { generateLinearEasing };
|