Zoomable Canvas

This commit is contained in:
Emma
2023-02-15 17:45:37 -07:00
parent fbcffcde27
commit c767c09776
7 changed files with 623 additions and 38 deletions

2
timing/EaseInOut.ts Normal file
View File

@@ -0,0 +1,2 @@
export const easeInOut = (x: number) =>
x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2;

2
timing/Map.ts Normal file
View File

@@ -0,0 +1,2 @@
export const map = (value: number, x1: number, y1: number, x2: number, y2: number) =>
(value - x1) * (y2 - x2) / (y1 - x1) + x2;