summaryrefslogtreecommitdiff
path: root/apps/web/src/lib/animation/binding-values.ts
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2026-04-13 04:40:38 +0200
committerMaze Winther <mazewinther@gmail.com>2026-04-13 05:01:51 +0200
commit108d3f4ecad4c0ead14941c2067a21546750fedc (patch)
tree8969775b3292ac2570b95e7848774958caadbc8b /apps/web/src/lib/animation/binding-values.ts
parent8230faf082c405c9fd0fa640f4ce2284315782ae (diff)
downloadopencut-108d3f4ecad4c0ead14941c2067a21546750fedc.tar.gz
feat: position animated independently per axis
Made-with: Cursor
Diffstat (limited to 'apps/web/src/lib/animation/binding-values.ts')
-rw-r--r--apps/web/src/lib/animation/binding-values.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/web/src/lib/animation/binding-values.ts b/apps/web/src/lib/animation/binding-values.ts
index 344fd776..66fb2b5d 100644
--- a/apps/web/src/lib/animation/binding-values.ts
+++ b/apps/web/src/lib/animation/binding-values.ts
@@ -47,6 +47,18 @@ export function isVectorValue(value: unknown): value is VectorValue {
return isRecord(value) && typeof value.x === "number" && typeof value.y === "number";
}
+export type EasingMode = "independent" | "shared";
+
+/**
+ * Declares how easing curves apply to a binding's components.
+ * "shared" means all components always use the same curve (e.g. color — you never
+ * want to ease R independently from G/B/A). "independent" means each component
+ * can have its own curve.
+ */
+export function getEasingModeForKind(kind: AnimationBindingKind): EasingMode {
+ return kind === "color" ? "shared" : "independent";
+}
+
export function getBindingComponentKeys({
kind,
}: {