Skip to content

The VS Code of video editing, built for agents.

TypeScript

Update color variables and improve UI consistency

konstantin-paulus86c4d961030a
diff --git a/apps/web/src/components/engine/api/world.ts b/apps/web/src/components/engine/api/world.ts
index 5ccc6ba0..a0b99c89 100644
--- a/apps/web/src/components/engine/api/world.ts
+++ b/apps/web/src/components/engine/api/world.ts
@@ -18,7 +18,7 @@ import type { FontSource } from "../font";
import type { Asset, Folder } from "../db";
import type { RuntimeMode, HitRegion, Camera2D, PointerState, SnapLine, HudMode } from "../types";
-export const DEFAULT_BACKGROUND = 0x171717;
+export const DEFAULT_BACKGROUND = 0x161616;
export function createEngineWorld(projectId: string, audioContext: AudioContext | OfflineAudioContext) {
const [timelineIndex, setTimelineIndex] = createSignal<TimelineIndexValue>({ root: null, layers: [] });
diff --git a/apps/web/src/components/engine/hooks/use-ecs.ts b/apps/web/src/components/engine/hooks/use-ecs.ts
index d8848ec2..5a912b24 100644
--- a/apps/web/src/components/engine/hooks/use-ecs.ts
+++ b/apps/web/src/components/engine/hooks/use-ecs.ts
@@ -223,7 +223,7 @@ export function useQuery(query: QueryTerm[]): Accessor<number[]> {
* Subscribe to a world-level state value via a getter. Examples:
* useWorldState(w => w.selection.scene, null)
* useWorldState(w => w.camera.a, 1)
- * useWorldState(w => w.background, 0x171717)
+ * useWorldState(w => w.background, 0x161616)
*/
export function useWorldState<T>(get: (world: EngineWorld) => T, initial: T): Accessor<T> {
const [value, setValue] = createSignal<T>(initial);
diff --git a/apps/web/src/components/engine/systems/hud.ts b/apps/web/src/components/engine/systems/hud.ts
index adc9269d..cc03ee76 100644
--- a/apps/web/src/components/engine/systems/hud.ts
+++ b/apps/web/src/components/engine/systems/hud.ts
@@ -93,7 +93,7 @@ export function hudSystem(world: EngineWorld) {
// Play/pause button (only for entities with Timeline)
if (hasTimelineComp) {
ctx.save();
- ctx.fillStyle = isSelected ? '#cce8ff' : '#9E9E9E';
+ ctx.fillStyle = isSelected ? '#cce8ff' : 'rgba(242, 242, 242, 0.64)';
if (c.Playback.playing[eid] !== 1) {
ctx.translate(2, 3);
ctx.fill(PLAY_PATH);
@@ -121,7 +121,7 @@ export function hudSystem(world: EngineWorld) {
const fittedText = fitTextToWidth(ctx, name, header.width - labelStartX - activeIndicatorWidth);
if (fittedText) {
- ctx.fillStyle = isSelected ? '#cce8ff' : '#9E9E9E';
+ ctx.fillStyle = isSelected ? '#cce8ff' : 'rgba(242, 242, 242, 0.64)';
ctx.fillText(fittedText.value, 0, 0);
const labelHitMat = multiply2D(header.mat, translate2D(labelStartX, 0));
@@ -157,7 +157,7 @@ export function hudSystem(world: EngineWorld) {
ctx.textAlign = 'left';
ctx.textBaseline = 'top';
ctx.font = '350 11px Inter, sans-serif';
- ctx.fillStyle = isSelected ? '#cce8ff' : '#9E9E9E';
+ ctx.fillStyle = isSelected ? '#cce8ff' : 'rgba(242, 242, 242, 0.64)';
ctx.fillText("Active", 0, 0);
}
@@ -180,7 +180,7 @@ export function hudSystem(world: EngineWorld) {
ctx.globalAlpha = 0.7;
ctx.fillStyle = '#cce8ff';
} else {
- ctx.fillStyle = '#666666';
+ ctx.fillStyle = 'rgba(121, 121, 121, 1)';
}
ctx.fillText(`${m}:${s}`, 0, 0);
ctx.globalAlpha = 1;
diff --git a/apps/web/src/components/engine/timeline/constants.ts b/apps/web/src/components/engine/timeline/constants.ts
index 030558a6..3c3b1bda 100644
--- a/apps/web/src/components/engine/timeline/constants.ts
+++ b/apps/web/src/components/engine/timeline/constants.ts
@@ -58,8 +58,8 @@ export const COLORS = {
scrubber: '#F43535', // ambient red
},
ruler: {
- tick: '#404040',
- text: '#505050',
+ tick: 'rgba(53, 53, 53, 1)',
+ text: 'rgba(75, 75, 75, 1)',
},
clip: {
group: {
diff --git a/apps/web/src/components/engine/timeline/render/keyframe.ts b/apps/web/src/components/engine/timeline/render/keyframe.ts
index fa20fbac..0cfac6e0 100644
--- a/apps/web/src/components/engine/timeline/render/keyframe.ts
+++ b/apps/web/src/components/engine/timeline/render/keyframe.ts
@@ -10,7 +10,7 @@ import { addComponent, clearComponent, removeComponent, setComponent } from "../
import type { EngineWorld } from "../../api/world";
import type { TimelineContext } from "../world";
-const KEYFRAME_COLOR = '#9E9E9E';
+const KEYFRAME_COLOR = 'rgba(242, 242, 242, 0.64)';
const KEYFRAME_SIZE = 8;
const KEYFRAME_HALF_SIZE = KEYFRAME_SIZE / 2;
const KEYFRAME_HITBOX_PADDING = 2;
diff --git a/apps/web/src/components/sidebar-left/asset-item.tsx b/apps/web/src/components/sidebar-left/asset-item.tsx
index a7361f01..9bd0429e 100644
--- a/apps/web/src/components/sidebar-left/asset-item.tsx
+++ b/apps/web/src/components/sidebar-left/asset-item.tsx
@@ -135,7 +135,7 @@ export function LazyAssetItem(props: LazyAssetItemProps) {
<Show
when={isRenaming()}
fallback={
- <div class="text-xs text-muted-foreground truncate select-none">
+ <div class="text-xs text-foreground truncate select-none">
{props.asset.name}
</div>
}
diff --git a/apps/web/src/components/sidebar-left/folder-item.tsx b/apps/web/src/components/sidebar-left/folder-item.tsx
index 3d126682..2ffdf76f 100644
--- a/apps/web/src/components/sidebar-left/folder-item.tsx
+++ b/apps/web/src/components/sidebar-left/folder-item.tsx
@@ -171,7 +171,7 @@ export function FolderItem(props: FolderItemProps) {
<Show
when={props.renaming}
fallback={
- <div class="text-xs text-muted-foreground truncate select-none">
+ <div class="text-xs text-foreground truncate select-none">
{props.folder.name}
</div>
}
diff --git a/apps/web/src/components/sidebar-right/inspector/time.tsx b/apps/web/src/components/sidebar-right/inspector/time.tsx
index 67fac7fc..34b35894 100644
--- a/apps/web/src/components/sidebar-right/inspector/time.tsx
+++ b/apps/web/src/components/sidebar-right/inspector/time.tsx
@@ -7,6 +7,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip
import { createMemo, Show } from "solid-js";
import { ControlRow } from "@/components/ui/control-group";
import { Icon } from "@/components/ui/icon";
+import { IncrementDecrementControl } from "@/components/ui/increment-decrement-control";
import { PanelSection } from "@/components/ui/panel-section";
import { ControlledTextField } from "@/components/ui/text-field";
import { useEngine } from "@/context/engine";
@@ -262,24 +263,12 @@ export function TimeSettings(props: TimeSettingsProps) {
limitEvents
onNumber={handleLengthChange}
/>
- <div class="flex gap-px rounded-md overflow-hidden">
- <button
- type="button"
- title="Decrease length"
- class="flex-1 h-7 bg-input flex items-center justify-center hover:bg-input/80 active:bg-muted-foreground/20 text-muted-foreground"
- onClick={() => handleLengthChange(Math.max(0.1, durationSeconds() - 0.1))}
- >
- <Icon name="minus" />
- </button>
- <button
- type="button"
- title="Increase length"
- class="flex-1 h-7 bg-input flex items-center justify-center hover:bg-input/80 active:bg-muted-foreground/20 text-muted-foreground"
- onClick={() => handleLengthChange(durationSeconds() + 0.1)}
- >
- <Icon name="plus-add" />
- </button>
- </div>
+ <IncrementDecrementControl
+ decrementLabel="Decrease length"
+ incrementLabel="Increase length"
+ onDecrement={() => handleLengthChange(Math.max(0.1, durationSeconds() - 0.1))}
+ onIncrement={() => handleLengthChange(durationSeconds() + 0.1)}
+ />
</ControlRow>
<Show when={supportsPlaybackRate() && addons().playbackRate}>
@@ -298,24 +287,12 @@ export function TimeSettings(props: TimeSettingsProps) {
limitEvents
onNumber={(value) => assignPlaybackRate(value / 100)}
/>
- <div class="flex gap-px rounded-md overflow-hidden">
- <button
- type="button"
- title="Decrease speed"
- class="flex-1 h-7 bg-input flex items-center justify-center hover:bg-input/80 active:bg-muted-foreground/20 text-muted-foreground"
- onClick={() => assignPlaybackRate(Math.max(1, Math.round(playbackRatePercent() - 10)) / 100)}
- >
- <Icon name="minus" />
- </button>
- <button
- type="button"
- title="Increase speed"
- class="flex-1 h-7 bg-input flex items-center justify-center hover:bg-input/80 active:bg-muted-foreground/20 text-muted-foreground"
- onClick={() => assignPlaybackRate(Math.round(playbackRatePercent() + 10) / 100)}
- >
- <Icon name="plus-add" />
- </button>
- </div>
+ <IncrementDecrementControl
+ decrementLabel="Decrease speed"
+ incrementLabel="Increase speed"
+ onDecrement={() => assignPlaybackRate(Math.max(1, Math.round(playbackRatePercent() - 10)) / 100)}
+ onIncrement={() => assignPlaybackRate(Math.round(playbackRatePercent() + 10) / 100)}
+ />
</ContextMenuTrigger>
<ContextMenuContent>
<ContextMenuItem onSelect={() => handleRemoveAddon("playbackRate")}>
diff --git a/apps/web/src/components/timeline/layers/keyframe.tsx b/apps/web/src/components/timeline/layers/keyframe.tsx
index 18704054..174f7037 100644
--- a/apps/web/src/components/timeline/layers/keyframe.tsx
+++ b/apps/web/src/components/timeline/layers/keyframe.tsx
@@ -118,7 +118,7 @@ export function KeyframeLayer(props: KeyframeLayerProps) {
<div class="size-4 shrink-0 mr-0.5 flex items-center justify-center overflow-clip">
<Icon name="keyframe-indicator-default" class="size-6" />
</div>
- <span class="text-xs px-0.5 shrink-0 whitespace-nowrap">
+ <span class="text-xs px-0.5 shrink-0 whitespace-nowrap text-foreground">
{formatProperty(c.KeyframeTrack.property[props.layer.eid])}
</span>
</div>
diff --git a/apps/web/src/components/timeline/layers/layers.tsx b/apps/web/src/components/timeline/layers/layers.tsx
index e6cdf2ee..5df4e340 100644
--- a/apps/web/src/components/timeline/layers/layers.tsx
+++ b/apps/web/src/components/timeline/layers/layers.tsx
@@ -98,7 +98,7 @@ export function Layers() {
return (
<div class="relative size-full">
<div
- class="grid grid-cols-1 h-full absolute inset-0 overflow-hidden"
+ class="grid grid-cols-1 h-full absolute border-b border-border inset-0 overflow-hidden"
on:wheel={timeline.scroll}
style={{ 'grid-template-rows': `${RULER_HEIGHT}px 1fr` }}
data-timeline-layers-container
diff --git a/apps/web/src/components/timeline/layers/sub-item.tsx b/apps/web/src/components/timeline/layers/sub-item.tsx
index 1849111f..b9143726 100644
--- a/apps/web/src/components/timeline/layers/sub-item.tsx
+++ b/apps/web/src/components/timeline/layers/sub-item.tsx
@@ -99,7 +99,7 @@ export function SubItemLayer(props: SubItemLayerProps) {
<Icon name={props.expanded ? "chevron-down" : "chevron-right"} class="size-6 hover:text-foreground" />
</Show>
</button>
- <span class="text-xs px-0.5 shrink-0 whitespace-nowrap">
+ <span class="text-xs px-0.5 shrink-0 whitespace-nowrap text-foreground">
{name()}
</span>
</div>
diff --git a/apps/web/src/components/ui/color-opacity-picker.tsx b/apps/web/src/components/ui/color-opacity-picker.tsx
index f87c3fff..93afc5f8 100644
--- a/apps/web/src/components/ui/color-opacity-picker.tsx
+++ b/apps/web/src/components/ui/color-opacity-picker.tsx
@@ -32,6 +32,7 @@ import {
} from "solid-js";
import { useEngine } from "@/context/engine";
import { useQuery } from "@/components/engine/hooks";
+import { DEFAULT_BACKGROUND } from "@/components/engine";
import { toast } from "somoto";
const COLOR_TYPES = ["Hex", "HSL", "RGB"] as const;
@@ -84,7 +85,7 @@ export function ColorOpacityPicker(props: ColorOpacityPickerProps) {
const documentColors = createMemo(() => {
const colors = new Set<number>();
for (const eid of colorEntities()) {
- colors.add(c.Color[eid] ?? 0x171717); // fallback is background color
+ colors.add(c.Color[eid] ?? DEFAULT_BACKGROUND); // fallback is background color
if (colors.size >= 36) break;
}
return Array.from(colors);
diff --git a/apps/web/src/components/ui/increment-decrement-control.tsx b/apps/web/src/components/ui/increment-decrement-control.tsx
index d9071b79..17b06be1 100644
--- a/apps/web/src/components/ui/increment-decrement-control.tsx
+++ b/apps/web/src/components/ui/increment-decrement-control.tsx
@@ -18,16 +18,18 @@ export function IncrementDecrementControl(props: IncrementDecrementControlProps)
<div class={cx("grid grid-cols-2 gap-px rounded-md overflow-hidden", props.class)}>
<button
type="button"
- class="flex-1 h-7 bg-input flex items-center justify-center hover:bg-input/80 active:bg-muted-foreground/20 text-muted-foreground"
+ class="flex-1 h-7 bg-input flex items-center justify-center hover:bg-input/80 active:bg-muted-foreground/20 text-foreground"
onClick={props.onDecrement}
+ title={props.decrementLabel}
aria-label={props.decrementLabel ?? "Decrease"}
>
<Icon name="minus" />
</button>
<button
type="button"
- class="flex-1 h-7 bg-input flex items-center justify-center hover:bg-input/80 active:bg-muted-foreground/20 text-muted-foreground"
+ class="flex-1 h-7 bg-input flex items-center justify-center hover:bg-input/80 active:bg-muted-foreground/20 text-foreground"
onClick={props.onIncrement}
+ title={props.incrementLabel}
aria-label={props.incrementLabel ?? "Increase"}
>
<Icon name="plus-add" />
diff --git a/apps/web/src/index.css b/apps/web/src/index.css
index f94db95f..7d4a4a13 100644
--- a/apps/web/src/index.css
+++ b/apps/web/src/index.css
@@ -156,7 +156,7 @@
--input: hsla(0, 0%, 95%, 1);
--ring: hsla(207, 100%, 50%, 1);
--canvas: hsla(0, 0%, 91%, 1);
- --overlay: hsla(0, 0%, 9%, 0.7);
+ --overlay: hsla(0, 0%, 4%, 0.8);
--overlay-soft: hsla(0, 0%, 9%, 0.4);
--selection: hsla(207, 100%, 50%, 1);
--selection-foreground: hsla(207, 100%, 90%, 1);
@@ -183,13 +183,13 @@
--primary-pressing: hsla(207, 99%, 22%, 1);
--secondary: hsla(0, 0%, 100%, 0.06);
--secondary-foreground: hsla(0, 0%, 95%, 1);
- --secondary-hover: hsla(0, 0%, 25%, 1);
+ --secondary-hover: hsla(0, 0%, 100%, 0.09);
--secondary-pressing: hsla(0, 0%, 40%, 1);
--tertiary: hsla(207, 99%, 22%, 1);
--tertiary-foreground: hsla(207, 100%, 90%, 1);
--tertiary-hover: hsla(207, 80%, 17%, 1);
--tertiary-pressing: hsla(207, 80%, 14%, 1);
- --muted: hsla(0, 0%, 25%, 1);
+ --muted: hsla(0, 0%, 100%, 0.09);
--muted-foreground: hsla(0, 0%, 95%, 0.64);
--disabled-foreground: hsla(0, 0%, 40%, 1);
--accent: hsla(0, 0%, 100%, 0.06);
@@ -204,17 +204,17 @@
--success-accent-foreground: hsla(162, 84%, 89%, 1);
--border: hsla(0, 0%, 100%, 0.03);
--border-strong: hsla(0, 0%, 100%, 0.06);
- --border-input: hsla(0, 0%, 25%, 1);
+ --border-input: hsla(0, 0%, 100%, 0.09);
--border-darker: hsla(0, 0%, 7%, 1);
--input: hsla(0, 0%, 100%, 0.06);
--ring: hsla(207, 100%, 50%, 1);
--canvas: hsla(0, 0%, 9%, 1);
- --overlay: hsla(0, 0%, 9%, 0.7);
+ --overlay: hsla(0, 0%, 4%, 0.8);
--overlay-soft: hsla(0, 0%, 9%, 0.4);
--selection: hsla(207, 99%, 22%, 1);
--selection-foreground: hsla(207, 100%, 90%, 1);
--selection-muted-foreground: hsla(0, 0%, 100%, 0.06);
- --inset: hsla(0, 0%, 25%, 1);
+ --inset: hsla(0, 0%, 100%, 0.09);
--meter-green: hsla(125, 85%, 57%, 1);
--meter-yellow: hsla(46, 90%, 62%, 1);
--meter-red: hsla(1, 90%, 62%, 1);