summaryrefslogtreecommitdiff
path: root/apps/web/src/lib/animation/resolve.ts
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2026-03-02 16:36:10 +0100
committerMaze Winther <mazewinther@gmail.com>2026-03-02 16:36:10 +0100
commita526066b61f18b082adf6faeaf3e19f3d13cd77d (patch)
treed4a67b7f6177080eae32787967d7a3c166c703b9 /apps/web/src/lib/animation/resolve.ts
parentb0165da764971b8e7f37c9657d0aa81f9bc2dcc9 (diff)
downloadopencut-a526066b61f18b082adf6faeaf3e19f3d13cd77d.tar.gz
feat: wire ui to have keyframes for: opacity, text color, and all background properties
Diffstat (limited to 'apps/web/src/lib/animation/resolve.ts')
-rw-r--r--apps/web/src/lib/animation/resolve.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/web/src/lib/animation/resolve.ts b/apps/web/src/lib/animation/resolve.ts
index 450ae983..147be1b3 100644
--- a/apps/web/src/lib/animation/resolve.ts
+++ b/apps/web/src/lib/animation/resolve.ts
@@ -92,6 +92,24 @@ export function resolveOpacityAtTime({
});
}
+export function resolveNumberAtTime({
+ baseValue,
+ animations,
+ propertyPath,
+ localTime,
+}: {
+ baseValue: number;
+ animations: ElementAnimations | undefined;
+ propertyPath: AnimationPropertyPath;
+ localTime: number;
+}): number {
+ return getNumberChannelValueAtTime({
+ channel: getNumberChannelForPath({ animations, propertyPath }),
+ time: Math.max(0, localTime),
+ fallbackValue: baseValue,
+ });
+}
+
export function resolveColorAtTime({
baseColor,
animations,