Skip to content

armgit / hypit

Public Imported from GitHub
0

Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.

style(studio): sharpen timeline palette and hierarchy

kashorin40b512338ef7
diff --git a/packages/studio/src/style.css b/packages/studio/src/style.css
index b8dbcb51..cb3ab65b 100644
--- a/packages/studio/src/style.css
+++ b/packages/studio/src/style.css
@@ -1,24 +1,33 @@
:root {
color-scheme: dark;
- --app: #0f1012;
- --panel: #17181b;
- --panel-raised: #1c1d21;
+ --app: #0b0c0e;
+ --panel: #141518;
+ --panel-raised: #1a1b1f;
--field: #222429;
--hover: #292b31;
- --line: #292b30;
- --line-strong: #34373d;
+ --lane: #0c0d10;
+ --line: #26282d;
+ --line-strong: #33363c;
--text: #e7e8eb;
--text-2: #a4a7ae;
--text-3: #6f737c;
--cyan: #00c8d7;
--cyan-soft: rgba(0, 200, 215, .16);
--danger: #ff646b;
- --speech: #3e9f8c;
- --media: #5176bd;
- --audio: #b69a58;
- --text-track: #6877aa;
- --caption: #8c66ae;
- --component: #a66e53;
+ --speech: #008768;
+ --speech-rail: #00d0a6;
+ --media: #3672b7;
+ --media-rail: #66b4ff;
+ --audio: #328344;
+ --audio-rail: #63cb76;
+ --text-track: #5a68b8;
+ --text-rail: #93a8ff;
+ --caption: #805bab;
+ --caption-rail: #c796ff;
+ --component: #a55a0f;
+ --component-rail: #f9953d;
+ --visual: #647280;
+ --visual-rail: #9eb4ca;
--source-width: 350px;
--workspace-width: 300px;
--timeline-height: 390px;
@@ -388,7 +397,7 @@ button:focus-visible, textarea:focus-visible {
.property-code > strong { font: 11px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; }
/* Timeline */
-.timeline { height: 100%; min-height: 0; display: flex; flex-direction: column; background: #131417; }
+.timeline { height: 100%; min-height: 0; display: flex; flex-direction: column; background: #0f1013; }
.timeline-toolbar {
height: 38px;
flex: none;
@@ -415,14 +424,14 @@ button:focus-visible, textarea:focus-visible {
overflow-x: hidden;
overflow-y: auto;
overscroll-behavior: contain;
- background: #111215;
+ background: var(--lane);
}
.timeline-labels {
position: sticky;
left: 0;
z-index: 5;
border-right: 1px solid var(--line-strong);
- background: #17181b;
+ background: var(--panel);
}
.label-corner {
position: sticky;
@@ -434,22 +443,22 @@ button:focus-visible, textarea:focus-visible {
justify-content: flex-end;
padding-right: 8px;
border-bottom: 1px solid var(--line);
- background: #17181b;
+ background: var(--panel);
color: var(--text-3);
font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.track-label {
min-width: 0;
- min-height: 52px;
+ min-height: 44px;
display: grid;
grid-template-columns: 20px minmax(0, 1fr) 18px;
align-items: center;
gap: 5px;
padding: 0 7px;
border-bottom: 1px solid var(--line);
- background: #17181b;
+ background: var(--panel);
}
-.track-icon { width: 20px; height: 20px; display: grid; place-items: center; color: var(--track); }
+.track-icon { width: 20px; height: 20px; display: grid; place-items: center; color: var(--rail, var(--track)); }
.track-icon .icon { width: 15px; height: 15px; }
.track-copy { min-width: 0; }
.track-copy strong, .track-copy small {
@@ -461,13 +470,13 @@ button:focus-visible, textarea:focus-visible {
.track-copy strong { color: #c8cad0; font-size: 11px; font-weight: 500; }
.track-copy small { margin-top: 1px; color: #62666e; font-size: 11px; }
.track-state { display: grid; place-items: center; }
-.track-media { --track: var(--media); }
-.track-speech { --track: var(--speech); }
-.track-caption { --track: var(--caption); }
-.track-component { --track: var(--component); }
-.track-audio { --track: var(--audio); }
-.track-text { --track: var(--text-track); }
-.track-visual { --track: #727882; }
+.track-media { --track: var(--media); --rail: var(--media-rail); }
+.track-speech { --track: var(--speech); --rail: var(--speech-rail); }
+.track-caption { --track: var(--caption); --rail: var(--caption-rail); }
+.track-component { --track: var(--component); --rail: var(--component-rail); }
+.track-audio { --track: var(--audio); --rail: var(--audio-rail); }
+.track-text { --track: var(--text-track); --rail: var(--text-rail); }
+.track-visual { --track: var(--visual); --rail: var(--visual-rail); }
.timeline-lanes { position: relative; min-width: 0; cursor: default; user-select: none; touch-action: pan-y; }
.ruler {
position: sticky;
@@ -476,7 +485,7 @@ button:focus-visible, textarea:focus-visible {
height: 28px;
overflow: hidden;
border-bottom: 1px solid var(--line);
- background: #17181b;
+ background: #111216;
cursor: ew-resize;
}
.tick {
@@ -484,8 +493,8 @@ button:focus-visible, textarea:focus-visible {
top: 0;
height: 14px;
padding-left: 4px;
- border-left: 1px solid #45484e;
- color: #70747c;
+ border-left: 1px solid #3c3f45;
+ color: #8b8f98;
font: 11px/14px ui-monospace, SFMono-Regular, Menlo, monospace;
white-space: nowrap;
}
@@ -496,37 +505,39 @@ button:focus-visible, textarea:focus-visible {
height: 13px;
overflow: hidden;
padding-left: 4px;
- border-left: 1px solid #656970;
- color: #737780;
+ border-left: 1px solid rgba(0, 208, 166, .45);
+ background: rgba(0, 208, 166, .09);
+ color: #7fdcc4;
font-size: 11px;
line-height: 13px;
white-space: nowrap;
}
.lanes { min-height: 100%; }
-.lane { position: relative; min-height: 52px; overflow: hidden; border-bottom: 1px solid var(--line); background: #111215; }
-.semantic-lane { background: #131a19; }
+.lane { position: relative; min-height: 44px; overflow: hidden; border-bottom: 1px solid #191b1f; background: var(--lane); }
+.semantic-lane { min-height: 52px; background: #091210; }
.semantic-segment {
position: absolute;
top: 4px;
bottom: 4px;
min-width: 2px;
overflow: hidden;
- border: 1px solid rgba(86, 162, 146, .34);
- border-radius: 3px;
- background: #1b302c;
- color: #d5ddda;
+ border: 0;
+ border-radius: 4px;
+ background: var(--speech);
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
+ color: #e4fbf4;
text-align: left;
cursor: pointer;
}
-.semantic-segment:hover { background: #203b35; border-color: rgba(97, 178, 160, .52); }
-.semantic-segment.live { border-color: rgba(104, 195, 174, .68); }
+.semantic-segment:hover { background: color-mix(in srgb, var(--speech) 88%, white); }
+.semantic-segment.live { box-shadow: inset 0 0 0 1px rgba(0, 208, 166, .8), inset 0 1px 0 rgba(255, 255, 255, .14); }
.semantic-segment-label {
position: absolute;
top: 3px;
left: 5px;
right: 5px;
overflow: hidden;
- color: #b3c8c2;
+ color: #c6f5e7;
font-size: 11px;
font-weight: 500;
white-space: nowrap;
@@ -540,17 +551,17 @@ button:focus-visible, textarea:focus-visible {
overflow: hidden;
padding: 0 3px;
border: 0;
- border-left: 1px solid rgba(135, 186, 175, .22);
+ border-left: 1px solid rgba(255, 255, 255, .16);
background: transparent;
- color: #aebcb8;
+ color: #e4fbf4;
text-align: left;
cursor: pointer;
}
-.semantic-word:hover { background: rgba(255, 255, 255, .05); color: #fff; }
+.semantic-word:hover { background: rgba(255, 255, 255, .10); color: #fff; }
.semantic-word.current { background: var(--cyan); color: #071214; }
.semantic-word-label { display: block; overflow: hidden; font-size: 11px; line-height: 22px; white-space: nowrap; }
-.semantic-anchor { position: absolute; bottom: 3px; width: 1px; height: 7px; background: rgba(143, 195, 183, .32); pointer-events: none; }
-.semantic-anchor-segment-start, .semantic-anchor-segment-end { top: 0; bottom: 0; height: auto; background: rgba(117, 185, 169, .66); }
+.semantic-anchor { position: absolute; bottom: 3px; width: 1px; height: 7px; background: rgba(255, 255, 255, .22); pointer-events: none; }
+.semantic-anchor-segment-start, .semantic-anchor-segment-end { top: 0; bottom: 0; height: auto; background: rgba(255, 255, 255, .45); }
.label-hidden .semantic-word-label, .label-hidden.semantic-segment > .semantic-segment-label { display: none; }
.semantic-coarse .semantic-words,
.semantic-coarse .semantic-anchor:not(.semantic-anchor-segment-start):not(.semantic-anchor-segment-end) { display: none; }
@@ -567,55 +578,60 @@ button:focus-visible, textarea:focus-visible {
}
.track-fold:hover { background: #303238; color: #fff; }
.clip {
- --track: #727882;
+ --track: var(--visual);
position: absolute;
top: 0;
- height: 42px;
+ height: calc(var(--lane-height, 52px) - 12px);
min-width: 2px;
- margin-top: 5px;
+ margin-top: 6px;
overflow: hidden;
display: flex;
align-items: center;
- padding: 0 7px;
- border: 1px solid color-mix(in srgb, var(--track) 65%, #25272b);
- border-radius: 3px;
- background: color-mix(in srgb, var(--track) 38%, #1b1d20);
- color: #d6d8dc;
+ padding: 0 8px;
+ border: 0;
+ border-radius: 4px;
+ background: var(--track);
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13);
+ color: #fff;
text-align: left;
cursor: pointer;
}
-.clip:hover { filter: brightness(1.09); }
+.clip:hover { filter: brightness(1.12); }
.clip.selected {
z-index: 4;
- border-color: var(--cyan);
- box-shadow: inset 0 0 0 1px var(--cyan), 0 0 0 1px rgba(0, 200, 215, .22);
+ box-shadow: inset 0 0 0 2px var(--cyan), inset 0 1px 0 rgba(255, 255, 255, .13);
color: #fff;
}
-.clip.live:not(.selected) { filter: brightness(1.05); }
+.clip.live:not(.selected) { filter: brightness(1.06); }
.clip-copy { position: relative; z-index: 2; min-width: 0; display: block; }
.clip-material { position: absolute; z-index: 0; inset: 0; pointer-events: none; }
.clip-material-image {
- background-position: center;
+ background-repeat: no-repeat;
+ background-position: left center;
background-size: auto 100%;
- opacity: .7;
+ opacity: 1;
+ -webkit-mask-image: linear-gradient(90deg, #000 0, #000 38px, transparent 94px);
+ mask-image: linear-gradient(90deg, #000 0, #000 38px, transparent 94px);
}
.clip-material-image::after {
content: "";
position: absolute;
inset: 0;
- background: rgba(8, 10, 12, .28);
+ background: linear-gradient(180deg, rgba(4, 6, 8, .52), rgba(4, 6, 8, 0) 78%);
}
+.clip-has-material:not(.clip-preview-wide) .clip-material { display: none; }
+.clip-preview-wide .clip-copy { margin-left: 54px; }
.clip-phases { position: absolute; z-index: 1; inset: 0; overflow: hidden; pointer-events: none; }
.clip-phase { position: absolute; bottom: 0; height: 3px; border-left: 1px solid rgba(255, 255, 255, .17); }
.clip-phase-active, .clip-phase-enter, .clip-phase-exit { background: rgba(255, 255, 255, .24); }
.clip-phase-settled, .clip-phase-body { background: rgba(255, 255, 255, .10); }
.clip-phase-preferred { border-top: 1px dashed rgba(255, 255, 255, .48); background: transparent; }
.clip-name, .clip-meta { display: block; overflow: hidden; text-overflow: clip; white-space: nowrap; }
-.clip-name { font-size: 11px; font-weight: 500; }
+.clip-name { color: #fff; font-size: 11px; font-weight: 500; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.clip-meta {
display: none;
margin-top: 2px;
- color: rgba(255, 255, 255, .54);
+ color: rgba(255, 255, 255, .75);
font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
font-variant-numeric: tabular-nums;
}
@@ -626,7 +642,7 @@ button:focus-visible, textarea:focus-visible {
.clip-text { --track: var(--text-track); }
.clip-caption { --track: var(--caption); }
.clip-component { --track: var(--component); }
-.clip-visual { --track: #727882; }
+.clip-visual { --track: var(--visual); }
.clip-facet-audio::after {
content: "";
position: absolute;
@@ -641,23 +657,22 @@ button:focus-visible, textarea:focus-visible {
}
.clip-facet-audio .clip-copy { transform: translateY(-9px); }
.clip-shape-group {
- border-style: dashed;
- background: color-mix(in srgb, var(--track) 10%, #111215);
+ border: 0;
+ background: rgba(255, 255, 255, .05);
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--track) 55%, transparent);
}
.clip-shape-group > .clip-copy { align-self: flex-start; margin-top: 4px; }
.clip-shape-group > .clip-copy .clip-meta { display: none; }
-.clip-shape-window { height: 22px; margin-top: 15px; border-style: dashed; background: transparent; }
+.clip-shape-window { height: 22px; margin-top: 15px; border: 0; border-radius: 3px; background: var(--track); }
.clip-nested-child {
z-index: 2;
min-height: 3px;
margin-top: 0;
padding: 0;
- border-width: 0 1px 0 2px;
- border-style: solid;
- border-color: color-mix(in srgb, var(--track) 42%, var(--line));
- border-left-color: var(--track);
- border-radius: 1px;
- background: color-mix(in srgb, var(--track) 24%, #1b1d20);
+ border: 0;
+ border-radius: 2px;
+ background: color-mix(in srgb, var(--track) 80%, #000);
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
}
.clip-nested-child .clip-copy { display: none; }
.clip-nested-child .clip-phase { height: 100%; opacity: .7; }
@@ -676,20 +691,20 @@ button:focus-visible, textarea:focus-visible {
stroke-dasharray: 4 4;
vector-effect: non-scaling-stroke;
}
-.projection-point { fill: #111215; stroke: var(--cyan); stroke-width: 1.25; vector-effect: non-scaling-stroke; }
+.projection-point { fill: var(--lane); stroke: var(--cyan); stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.playhead {
position: absolute;
top: 0;
bottom: 0;
left: 0;
z-index: 8;
- width: 1px;
- background: var(--cyan);
+ width: 2px;
+ background: #fff;
pointer-events: none;
will-change: transform;
}
.playhead.outside { display: none; }
-.playhead-grip { position: absolute; top: 0; left: -4px; width: 9px; height: 7px; border-radius: 0 0 3px 3px; background: var(--cyan); }
+.playhead-grip { position: absolute; top: 0; left: -5px; width: 11px; height: 9px; border-radius: 2px 2px 0 0; background: #fff; }
.timeline-zoom {
height: 20px;
flex: none;
diff --git a/packages/studio/src/ui/timeline.ts b/packages/studio/src/ui/timeline.ts
index 868de7d4..e2958659 100644
--- a/packages/studio/src/ui/timeline.ts
+++ b/packages/studio/src/ui/timeline.ts
@@ -10,10 +10,17 @@ import { createZoom } from "./zoom.js";
export type Timeline = { readonly element: HTMLElement };
-const LANE_HEIGHT = 52;
+const SEMANTIC_LANE_HEIGHT = 52;
const opened = new Set<string>();
let speechExpanded = false;
+function trackLaneHeight(track: StudioSnapshot["tracks"][number]): number {
+ if (track.binding.facet === "audio") return 44;
+ if (track.binding.family === "media" || track.binding.family === "speech") return 56;
+ if (track.binding.family === "caption") return 46;
+ return 48;
+}
+
function tickSeconds(durationSec: number, widthPx: number): number {
for (const step of [1, 2, 5, 10, 15, 30, 60]) {
if (durationSec / step <= Math.max(2, widthPx / 72)) return step;
@@ -184,7 +191,7 @@ export function createTimeline(store: Store): Timeline {
kind: string,
iconName: string,
detail: string,
- height = LANE_HEIGHT,
+ height = SEMANTIC_LANE_HEIGHT,
): HTMLElement => {
const label = document.createElement("div");
label.className = `track-label track-${kind}`;
@@ -227,7 +234,7 @@ export function createTimeline(store: Store): Timeline {
const lane = document.createElement("div");
lane.className = "lane semantic-lane track-speech";
- lane.style.height = `${LANE_HEIGHT}px`;
+ lane.style.height = `${SEMANTIC_LANE_HEIGHT}px`;
semanticLane = lane;
const tokensBySegment = new Map<string, SemanticToken[]>();
for (const token of snapshot.semantic.tokens) {
@@ -358,6 +365,7 @@ export function createTimeline(store: Store): Timeline {
const depth = Math.max(1, freeFrom.length);
const folded = depth > 1 && !opened.has(track.id);
const shownRows = folded ? 1 : depth;
+ const laneHeight = trackLaneHeight(track);
const nestedItems = track.clips.filter((clip) => clip.presentation.parentId !== undefined).length;
const displayedItems = nestedItems > 0 ? nestedItems : track.clips.length;
const label = createTrackLabel(
@@ -365,7 +373,7 @@ export function createTimeline(store: Store): Timeline {
kind,
track.binding.icon,
`${displayedItems} item${displayedItems === 1 ? "" : "s"}`,
- shownRows * LANE_HEIGHT,
+ shownRows * laneHeight,
);
label.classList.add(`track-facet-${track.binding.facet}`);
if (depth > 1) {
@@ -388,7 +396,8 @@ export function createTimeline(store: Store): Timeline {
const lane = document.createElement("div");
lane.className = `lane track-${kind} track-facet-${track.binding.facet}`;
- lane.style.height = `${shownRows * LANE_HEIGHT}px`;
+ lane.style.height = `${shownRows * laneHeight}px`;
+ lane.style.setProperty("--lane-height", `${laneHeight}px`);
for (const clip of track.clips) {
const from = place(clip.startFrame, snapshot.space.frameCount, zoom.window());
const to = place(clip.endFrameExclusive, snapshot.space.frameCount, zoom.window());
@@ -402,22 +411,23 @@ export function createTimeline(store: Store): Timeline {
node.className = `clip clip-${kind} clip-facet-${track.binding.facet} clip-shape-${clip.presentation.shape}`;
node.dataset.clip = clip.id;
node.style.left = `${visibleFrom * 100}%`;
- node.style.width = `${Math.max(0, visibleTo - visibleFrom) * 100}%`;
+ node.style.width = `max(2px, calc(${Math.max(0, visibleTo - visibleFrom) * 100}% - 2px))`;
const parentId = clip.presentation.parentId;
if (parentId === undefined) {
- node.style.top = `${row * LANE_HEIGHT}px`;
+ node.style.top = `${row * laneHeight}px`;
} else {
const siblings = childrenByParent.get(parentId) ?? [];
const index = Math.max(0, siblings.findIndex((candidate) => candidate.id === clip.id));
- const slot = 34 / Math.max(1, siblings.length);
+ const slot = (laneHeight - 18) / Math.max(1, siblings.length);
node.classList.add("clip-nested-child");
- node.style.top = `${row * LANE_HEIGHT + 9 + index * slot}px`;
+ node.style.top = `${row * laneHeight + 9 + index * slot}px`;
node.style.height = `${Math.max(3, slot - 2)}px`;
}
node.title = `${clip.label} · ${clip.startFrame}-${clip.endFrameExclusive}f`;
node.innerHTML = `<span class="clip-material" aria-hidden="true"></span><span class="clip-phases"></span><span class="clip-copy"><span class="clip-name"></span><span class="clip-meta"></span></span>`;
const material = node.querySelector<HTMLElement>(".clip-material")!;
if (clip.preview?.kind === "image") {
+ node.classList.add("clip-has-material");
material.classList.add("clip-material-image");
material.style.backgroundImage = `url(${JSON.stringify(clip.preview.url)})`;
}
@@ -438,7 +448,10 @@ export function createTimeline(store: Store): Timeline {
});
nextClipNodes.push({ node, start: clip.startFrame, end: clip.endFrameExclusive, id: clip.id });
lane.append(node);
- requestAnimationFrame(() => node.classList.toggle("clip-wide", node.clientWidth >= 110));
+ requestAnimationFrame(() => {
+ node.classList.toggle("clip-wide", node.clientWidth >= 110);
+ node.classList.toggle("clip-preview-wide", node.clientWidth >= 92);
+ });
}
rows.append(lane);
};