Files
NapCatQQ/.pnpm-store/v3/files/e1/8a31bdccccee50c8d8179df7d7d257a4f08153f841bca4a3299d71a40f0f7cc99a33e81cc0b8562a1c2a9459518bb0257aadea3c8a5c3d8d4d56b5bb50091a
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

13 lines
431 B
Plaintext

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 };