summaryrefslogtreecommitdiff
path: root/apps/web/src/timeline/defaults.ts
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2026-04-29 01:28:50 +0200
committerMaze Winther <mazewinther@gmail.com>2026-05-02 03:27:23 +0200
commit2ee0a44735d2b930348e9774909638b2c1909738 (patch)
treee73e60097338ed411739f3b04808dad86f7bb192 /apps/web/src/timeline/defaults.ts
parenta9b9cf6bf50f08723896659634f2e6afc17bcd42 (diff)
downloadopencut-2ee0a44735d2b930348e9774909638b2c1909738.tar.gz
refactor: unify element params
Diffstat (limited to 'apps/web/src/timeline/defaults.ts')
-rw-r--r--apps/web/src/timeline/defaults.ts40
1 files changed, 25 insertions, 15 deletions
diff --git a/apps/web/src/timeline/defaults.ts b/apps/web/src/timeline/defaults.ts
index 3b47b4f4..d32fb649 100644
--- a/apps/web/src/timeline/defaults.ts
+++ b/apps/web/src/timeline/defaults.ts
@@ -31,26 +31,36 @@ const defaultTextBackground = {
const defaultTextElement: Omit<TextElement, "id"> = {
type: "text",
name: "Text",
- content: "Default text",
- fontSize: 15,
- fontFamily: "Arial",
- color: "#ffffff",
- background: { ...defaultTextBackground },
- textAlign: "center",
- fontWeight: "normal",
- fontStyle: "normal",
- textDecoration: "none",
- letterSpacing: defaultTextLetterSpacing,
- lineHeight: defaultTextLineHeight,
duration: DEFAULT_NEW_ELEMENT_DURATION,
startTime: ZERO_MEDIA_TIME,
trimStart: ZERO_MEDIA_TIME,
trimEnd: ZERO_MEDIA_TIME,
- transform: {
- ...defaultTransform,
- position: { ...defaultTransform.position },
+ params: {
+ content: "Default text",
+ fontSize: 15,
+ fontFamily: "Arial",
+ color: "#ffffff",
+ textAlign: "center",
+ fontWeight: "normal",
+ fontStyle: "normal",
+ textDecoration: "none",
+ letterSpacing: defaultTextLetterSpacing,
+ lineHeight: defaultTextLineHeight,
+ "background.enabled": defaultTextBackground.enabled,
+ "background.color": defaultTextBackground.color,
+ "background.cornerRadius": defaultTextBackground.cornerRadius,
+ "background.paddingX": defaultTextBackground.paddingX,
+ "background.paddingY": defaultTextBackground.paddingY,
+ "background.offsetX": defaultTextBackground.offsetX,
+ "background.offsetY": defaultTextBackground.offsetY,
+ "transform.positionX": defaultTransform.position.x,
+ "transform.positionY": defaultTransform.position.y,
+ "transform.scaleX": defaultTransform.scaleX,
+ "transform.scaleY": defaultTransform.scaleY,
+ "transform.rotate": defaultTransform.rotate,
+ opacity: defaultOpacity,
+ blendMode: defaultBlendMode,
},
- opacity: defaultOpacity,
};
const defaultTimelineViewState: TTimelineViewState = {