Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

refactor(desktop): migrate timeline tracks to shared color tokens

Richie McIlroy7bc0b8b7ac95
diff --git a/apps/desktop/src/routes/editor/Timeline/CaptionsTrack.tsx b/apps/desktop/src/routes/editor/Timeline/CaptionsTrack.tsx
index 2f5cba2bc..c50fc63b4 100644
--- a/apps/desktop/src/routes/editor/Timeline/CaptionsTrack.tsx
+++ b/apps/desktop/src/routes/editor/Timeline/CaptionsTrack.tsx
@@ -168,9 +168,9 @@ export function CaptionsTrack(props: {
<SegmentRoot
data-caption-segment
data-index={i()}
+ segColor="var(--track-caption)"
class={cx(
- "border duration-200 hover:border-green-6 transition-colors group",
- "bg-linear-to-r from-[#0d1f12] via-[#162618] to-[#0d1f12]",
+ "border duration-200 transition-colors group",
isSelected() ? "border-green-7" : "border-transparent",
)}
innerClass="ring-green-6"
diff --git a/apps/desktop/src/routes/editor/Timeline/ClipTrack.tsx b/apps/desktop/src/routes/editor/Timeline/ClipTrack.tsx
index cdeef7f13..4122059f0 100644
--- a/apps/desktop/src/routes/editor/Timeline/ClipTrack.tsx
+++ b/apps/desktop/src/routes/editor/Timeline/ClipTrack.tsx
@@ -547,9 +547,9 @@ export function ClipTrack(
)}
</Show>
<SegmentRoot
+ segColor="var(--track-clip)"
class={cx(
- "border transition-colors duration-200 group hover:border-gray-12",
- "bg-linear-to-r from-[#2675DB] via-[#4FA0FF] to-[#2675DB] shadow-[inset_0_5px_10px_5px_rgba(255,255,255,0.2)]",
+ "border transition-colors duration-200 group",
isSelected() ? "border-gray-12" : "border-transparent",
)}
innerClass="ring-blue-9"
diff --git a/apps/desktop/src/routes/editor/Timeline/KeyboardTrack.tsx b/apps/desktop/src/routes/editor/Timeline/KeyboardTrack.tsx
index 660ec2c33..c8e8cd083 100644
--- a/apps/desktop/src/routes/editor/Timeline/KeyboardTrack.tsx
+++ b/apps/desktop/src/routes/editor/Timeline/KeyboardTrack.tsx
@@ -160,9 +160,9 @@ export function KeyboardTrack(props: {
<SegmentRoot
data-keyboard-segment
data-index={i()}
+ segColor="var(--track-keyboard)"
class={cx(
- "border duration-200 hover:border-sky-6 transition-colors group",
- "bg-linear-to-r from-[#0d1830] via-[#142445] to-[#0d1830] shadow-[inset_0_8px_12px_3px_rgba(120,180,255,0.16)]",
+ "border duration-200 transition-colors group",
isSelected() ? "border-sky-7" : "border-transparent",
)}
innerClass="ring-sky-6"
diff --git a/apps/desktop/src/routes/editor/Timeline/MaskTrack.tsx b/apps/desktop/src/routes/editor/Timeline/MaskTrack.tsx
index 9ce8fefbb..31b4edeb1 100644
--- a/apps/desktop/src/routes/editor/Timeline/MaskTrack.tsx
+++ b/apps/desktop/src/routes/editor/Timeline/MaskTrack.tsx
@@ -332,12 +332,12 @@ export function MaskTrack(props: {
<SegmentRoot
data-mask-segment
data-index={index}
+ segColor="var(--track-mask)"
class={cx(
"duration-200 transition-colors group",
- "bg-linear-to-r from-[#1f2022] via-[#2c2d30] to-[#1f2022]",
isSelected()
? "border border-gray-12"
- : "border-0! hover:border! hover:border-gray-12",
+ : "border border-transparent",
)}
innerClass="ring-red-5"
segment={segment}
@@ -503,9 +503,10 @@ export function MaskTrack(props: {
<SegmentRoot
class="pointer-events-none z-10 border border-transparent"
innerClass="ring-red-300"
+ segColor="var(--track-mask)"
segment={details()}
>
- <SegmentContent class="bg-linear-to-r from-[#1f2022] via-[#2c2d30] to-[#1f2022] shadow-[inset_0_8px_12px_3px_rgba(255,255,255,0.16)]">
+ <SegmentContent>
<p class="w-full text-center text-gray-1 dark:text-gray-12 text-md">
+
</p>
diff --git a/apps/desktop/src/routes/editor/Timeline/SceneTrack.tsx b/apps/desktop/src/routes/editor/Timeline/SceneTrack.tsx
index 284a26f01..ac6facf39 100644
--- a/apps/desktop/src/routes/editor/Timeline/SceneTrack.tsx
+++ b/apps/desktop/src/routes/editor/Timeline/SceneTrack.tsx
@@ -414,9 +414,9 @@ export function SceneTrack(props: {
return (
<SegmentRoot
+ segColor="var(--track-scene)"
class={cx(
- "border transition-colors duration-200 hover:border-gray-12 group",
- `bg-linear-to-r from-[#5C1BC4] via-[#975CFA] to-[#5C1BC4] shadow-[inset_0_8px_12px_3px_rgba(255,255,255,0.2)]`,
+ "border transition-colors duration-200 group",
isSelected() ? "border-gray-12" : "border-transparent",
)}
innerClass="ring-blue-5"
@@ -627,12 +627,13 @@ export function SceneTrack(props: {
<SegmentRoot
class="pointer-events-none"
innerClass="ring-blue-300"
+ segColor="var(--track-scene)"
segment={{
start: time(),
end: time() + maxAvailableDuration(),
}}
>
- <SegmentContent class="bg-linear-to-r hover:border duration-200 hover:border-gray-500 from-[#5C1BC4] via-[#975CFA] to-[#5C1BC4] transition-colors group shadow-[inset_0_8px_12px_3px_rgba(255,255,255,0.2)]">
+ <SegmentContent class="group">
<p class="w-full text-center text-gray-1 dark:text-gray-12 text-md text-primary">
+
</p>
diff --git a/apps/desktop/src/routes/editor/Timeline/TextTrack.tsx b/apps/desktop/src/routes/editor/Timeline/TextTrack.tsx
index 70334a112..92e291c55 100644
--- a/apps/desktop/src/routes/editor/Timeline/TextTrack.tsx
+++ b/apps/desktop/src/routes/editor/Timeline/TextTrack.tsx
@@ -302,9 +302,9 @@ export function TextTrack(props: {
<SegmentRoot
data-text-segment
data-index={index}
+ segColor="var(--track-text)"
class={cx(
- "border duration-200 hover:border-blue-6 transition-colors group",
- "bg-linear-to-r from-[#111826] via-[#1c2232] to-[#111826]",
+ "border duration-200 transition-colors group",
isSelected() ? "border-blue-7" : "border-transparent",
!segment.enabled && "opacity-60",
)}
@@ -446,9 +446,10 @@ export function TextTrack(props: {
<SegmentRoot
class="pointer-events-none z-10 border border-transparent"
innerClass="ring-blue-300"
+ segColor="var(--track-text)"
segment={details()}
>
- <SegmentContent class="bg-linear-to-r from-[#111826] via-[#1c2232] to-[#111826] shadow-[inset_0_8px_12px_3px_rgba(255,255,255,0.16)]">
+ <SegmentContent>
<p class="w-full text-center text-gray-1 dark:text-gray-12 text-md">
+
</p>
diff --git a/apps/desktop/src/routes/editor/Timeline/ZoomTrack.tsx b/apps/desktop/src/routes/editor/Timeline/ZoomTrack.tsx
index de8fb4808..ee42d8387 100644
--- a/apps/desktop/src/routes/editor/Timeline/ZoomTrack.tsx
+++ b/apps/desktop/src/routes/editor/Timeline/ZoomTrack.tsx
@@ -519,9 +519,9 @@ export function ZoomTrack(props: {
return (
<SegmentRoot
+ segColor="var(--track-zoom)"
class={cx(
- "border duration-200 hover:border-gray-12 transition-colors group",
- "bg-linear-to-r from-[#292929] via-[#434343] to-[#292929] shadow-[inset_0_8px_12px_3px_rgba(255,255,255,0.2)]",
+ "border duration-200 transition-colors group",
isSelected() ? "border-gray-12" : "border-transparent",
)}
innerClass="ring-red-5"
@@ -732,9 +732,10 @@ export function ZoomTrack(props: {
<SegmentRoot
class="pointer-events-none z-0"
innerClass="ring-red-300"
+ segColor="var(--track-zoom)"
segment={details()}
>
- <SegmentContent class="bg-linear-to-r hover:border duration-200 hover:border-gray-500 from-[#292929] via-[#434343] to-[#292929] transition-colors group shadow-[inset_0_8px_12px_3px_rgba(255,255,255,0.2)]">
+ <SegmentContent class="group">
<p class="w-full text-center text-gray-1 dark:text-gray-12 text-md text-primary">
+
</p>