summaryrefslogtreecommitdiff
path: root/apps/web/src/timeline
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2026-04-29 01:59:46 +0200
committerMaze Winther <mazewinther@gmail.com>2026-05-02 03:27:23 +0200
commitb8d08df244b97b1d3131cb2d076166838189eeb0 (patch)
tree01f8ea0ce75c5a8b73e4b8d64c5456f40a2ff142 /apps/web/src/timeline
parent2ee0a44735d2b930348e9774909638b2c1909738 (diff)
downloadopencut-b8d08df244b97b1d3131cb2d076166838189eeb0.tar.gz
chore: cleanup
Diffstat (limited to 'apps/web/src/timeline')
-rw-r--r--apps/web/src/timeline/animation-targets.ts40
-rw-r--r--apps/web/src/timeline/types.ts12
2 files changed, 8 insertions, 44 deletions
diff --git a/apps/web/src/timeline/animation-targets.ts b/apps/web/src/timeline/animation-targets.ts
index 8cccc78f..fcdb2915 100644
--- a/apps/web/src/timeline/animation-targets.ts
+++ b/apps/web/src/timeline/animation-targets.ts
@@ -23,9 +23,6 @@ import {
} from "@/params";
import {
getElementParam,
- readElementParamValue,
- writeElementParamValue,
- type ElementParamDefinition,
} from "@/params/registry";
import type { TimelineElement } from "@/timeline";
import { isVisualElement } from "@/timeline/element-utils";
@@ -96,35 +93,14 @@ function buildElementParamDescriptor({
return null;
}
- return buildTimelineElementParamDescriptor({ element, param });
-}
-
-function buildTimelineElementParamDescriptor({
- element,
- param,
-}: {
- element: TimelineElement;
- param: ElementParamDefinition;
-}): AnimationPathDescriptor | null {
- if (param.keyframable === false) {
- return null;
- }
-
- return {
- kind: getParamValueKind({ param }),
- defaultInterpolation: getParamDefaultInterpolation({ param }),
- numericRanges: paramNumericRanges({ param }),
- coerceValue: ({ value }) => coerceParamValue({ param, value }),
- getBaseValue: () => readElementParamValue({ element, param }),
- setBaseValue: ({ value }) => {
- const coercedValue = coerceParamValue({ param, value });
- if (coercedValue === null) {
- return element;
- }
-
- return writeElementParamValue({ element, param, value: coercedValue });
- },
- };
+ return buildParamDescriptor({
+ param,
+ baseParams: element.params,
+ setParams: (params) => ({
+ ...element,
+ params,
+ }),
+ });
}
function buildGraphicParamDescriptor({
diff --git a/apps/web/src/timeline/types.ts b/apps/web/src/timeline/types.ts
index c009bc16..5b3e4d29 100644
--- a/apps/web/src/timeline/types.ts
+++ b/apps/web/src/timeline/types.ts
@@ -117,8 +117,6 @@ interface BaseTimelineElement {
export interface VideoElement extends BaseTimelineElement {
type: "video";
mediaId: string;
- volume?: number;
- muted?: boolean;
isSourceAudioEnabled?: boolean;
hidden?: boolean;
retime?: RetimeConfig;
@@ -134,16 +132,6 @@ export interface ImageElement extends BaseTimelineElement {
masks?: Mask[];
}
-export interface TextBackground {
- enabled: boolean;
- color: string;
- cornerRadius?: number;
- paddingX?: number;
- paddingY?: number;
- offsetX?: number;
- offsetY?: number;
-}
-
export interface TextElement extends BaseTimelineElement {
type: "text";
hidden?: boolean;