From 6de6c7fd95de1de9d8d3107eaf7ce1dd150ed094 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Tue, 14 Apr 2026 18:17:14 +0200 Subject: refactor: move constants to domain modules --- apps/web/src/lib/text/background.ts | 2 ++ apps/web/src/lib/text/constants.ts | 12 ------------ apps/web/src/lib/text/measure-element.ts | 6 ++---- apps/web/src/lib/text/typography.ts | 9 +++++++++ 4 files changed, 13 insertions(+), 16 deletions(-) create mode 100644 apps/web/src/lib/text/background.ts delete mode 100644 apps/web/src/lib/text/constants.ts create mode 100644 apps/web/src/lib/text/typography.ts (limited to 'apps/web/src/lib/text') diff --git a/apps/web/src/lib/text/background.ts b/apps/web/src/lib/text/background.ts new file mode 100644 index 00000000..be5ab6f5 --- /dev/null +++ b/apps/web/src/lib/text/background.ts @@ -0,0 +1,2 @@ +export const CORNER_RADIUS_MIN = 0; +export const CORNER_RADIUS_MAX = 100; diff --git a/apps/web/src/lib/text/constants.ts b/apps/web/src/lib/text/constants.ts deleted file mode 100644 index a101f209..00000000 --- a/apps/web/src/lib/text/constants.ts +++ /dev/null @@ -1,12 +0,0 @@ -export const MIN_FONT_SIZE = 5; -export const MAX_FONT_SIZE = 300; -export const DEFAULT_TEXT_COLOR = "#000000"; - -/** - * higher value: smaller font size - * lower value: larger font size - */ -export const FONT_SIZE_SCALE_REFERENCE = 90; - -export const CORNER_RADIUS_MIN = 0; -export const CORNER_RADIUS_MAX = 100; diff --git a/apps/web/src/lib/text/measure-element.ts b/apps/web/src/lib/text/measure-element.ts index 99b8a7ba..213682ab 100644 --- a/apps/web/src/lib/text/measure-element.ts +++ b/apps/web/src/lib/text/measure-element.ts @@ -1,7 +1,5 @@ -import { - CORNER_RADIUS_MIN, - FONT_SIZE_SCALE_REFERENCE, -} from "@/constants/text-constants"; +import { CORNER_RADIUS_MIN } from "@/lib/text/background"; +import { FONT_SIZE_SCALE_REFERENCE } from "@/lib/text/typography"; import { resolveNumberAtTime } from "@/lib/animation"; import { DEFAULTS } from "@/lib/timeline/defaults"; import type { TextBackground, TextElement } from "@/lib/timeline"; diff --git a/apps/web/src/lib/text/typography.ts b/apps/web/src/lib/text/typography.ts new file mode 100644 index 00000000..837236ab --- /dev/null +++ b/apps/web/src/lib/text/typography.ts @@ -0,0 +1,9 @@ +export const MIN_FONT_SIZE = 5; +export const MAX_FONT_SIZE = 300; +export const DEFAULT_TEXT_COLOR = "#000000"; + +/** + * higher value: smaller font size + * lower value: larger font size + */ +export const FONT_SIZE_SCALE_REFERENCE = 90; -- cgit v1.3.1