JakgritB commited on
Commit ·
461d333
1
Parent(s): 5dadf47
feat(frontend): redesign product demo workspace
Browse filesAdd a polished responsive dashboard, light/dark mode, multilingual UI, richer profile controls, clip count selection, improved clip cards, and a full clip editor view.
- frontend/src/App.jsx +1008 -218
- frontend/src/styles.css +723 -154
frontend/src/App.jsx
CHANGED
|
@@ -1,53 +1,418 @@
|
|
| 1 |
import {
|
|
|
|
|
|
|
| 2 |
Check,
|
|
|
|
| 3 |
Download,
|
| 4 |
Film,
|
|
|
|
|
|
|
| 5 |
Link as LinkIcon,
|
| 6 |
Loader2,
|
|
|
|
|
|
|
| 7 |
RefreshCcw,
|
| 8 |
Scissors,
|
|
|
|
|
|
|
|
|
|
| 9 |
Trash2,
|
| 10 |
Upload,
|
|
|
|
| 11 |
} from "lucide-react";
|
| 12 |
import React, { useEffect, useMemo, useState } from "react";
|
| 13 |
|
| 14 |
const API_BASE = import.meta.env.VITE_API_BASE_URL || "http://localhost:8000";
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
const defaultProfile = {
|
| 17 |
niche: "education",
|
|
|
|
|
|
|
| 18 |
clip_style: "informative",
|
| 19 |
clip_length_seconds: 60,
|
|
|
|
| 20 |
primary_language: "Thai",
|
| 21 |
target_platform: "tiktok",
|
| 22 |
};
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
function App() {
|
| 25 |
const [profile, setProfile] = useState(defaultProfile);
|
| 26 |
const [sourceMode, setSourceMode] = useState("youtube");
|
| 27 |
const [youtubeUrl, setYoutubeUrl] = useState("");
|
| 28 |
const [file, setFile] = useState(null);
|
| 29 |
const [job, setJob] = useState(null);
|
|
|
|
| 30 |
const [error, setError] = useState("");
|
| 31 |
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
const activeClips = useMemo(
|
| 34 |
() => (job?.clips || []).filter((clip) => !clip.deleted),
|
| 35 |
[job?.clips]
|
| 36 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
useEffect(() => {
|
| 39 |
if (!job || !["queued", "running"].includes(job.status)) return;
|
| 40 |
const timer = window.setInterval(async () => {
|
| 41 |
const next = await fetchJson(`/api/jobs/${job.id}`);
|
| 42 |
setJob(next);
|
| 43 |
-
},
|
| 44 |
return () => window.clearInterval(timer);
|
| 45 |
}, [job]);
|
| 46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
async function submitJob(event) {
|
| 48 |
event.preventDefault();
|
| 49 |
setError("");
|
| 50 |
setIsSubmitting(true);
|
|
|
|
| 51 |
try {
|
| 52 |
if (sourceMode === "youtube") {
|
| 53 |
const next = await fetchJson("/api/jobs/youtube", {
|
|
@@ -98,156 +463,319 @@ function App() {
|
|
| 98 |
}));
|
| 99 |
}
|
| 100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
return (
|
| 102 |
-
<main className="
|
| 103 |
-
<
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
</div>
|
| 113 |
-
</div>
|
| 114 |
-
<StatusPill job={job} />
|
| 115 |
-
</div>
|
| 116 |
-
</header>
|
| 117 |
|
| 118 |
-
|
| 119 |
-
<
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
label="Platform"
|
| 149 |
-
value={profile.target_platform}
|
| 150 |
-
onChange={setProfileValue("target_platform")}
|
| 151 |
-
options={["tiktok", "youtube_shorts", "instagram_reels"]}
|
| 152 |
-
/>
|
| 153 |
-
</div>
|
| 154 |
-
</div>
|
| 155 |
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
type="button"
|
| 161 |
-
className={sourceMode === "youtube" ? "active" : ""}
|
| 162 |
-
onClick={() => setSourceMode("youtube")}
|
| 163 |
-
>
|
| 164 |
-
<LinkIcon size={16} />
|
| 165 |
-
YouTube
|
| 166 |
-
</button>
|
| 167 |
-
<button
|
| 168 |
-
type="button"
|
| 169 |
-
className={sourceMode === "upload" ? "active" : ""}
|
| 170 |
-
onClick={() => setSourceMode("upload")}
|
| 171 |
-
>
|
| 172 |
-
<Upload size={16} />
|
| 173 |
-
Upload
|
| 174 |
-
</button>
|
| 175 |
-
</div>
|
| 176 |
-
<div className="mt-3">
|
| 177 |
-
{sourceMode === "youtube" ? (
|
| 178 |
-
<TextField
|
| 179 |
-
label="YouTube URL"
|
| 180 |
-
value={youtubeUrl}
|
| 181 |
-
onChange={setYoutubeUrl}
|
| 182 |
-
placeholder="https://www.youtube.com/watch?v=..."
|
| 183 |
-
/>
|
| 184 |
-
) : (
|
| 185 |
-
<label className="block">
|
| 186 |
-
<span className="field-label">Video file</span>
|
| 187 |
-
<input
|
| 188 |
-
className="file-input"
|
| 189 |
-
type="file"
|
| 190 |
-
accept="video/mp4,video/quicktime,video/*"
|
| 191 |
-
onChange={(event) => setFile(event.target.files?.[0] || null)}
|
| 192 |
-
/>
|
| 193 |
-
</label>
|
| 194 |
-
)}
|
| 195 |
-
</div>
|
| 196 |
-
</div>
|
| 197 |
|
| 198 |
-
|
| 199 |
-
<
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
{
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
<
|
|
|
|
|
|
|
|
|
|
| 221 |
</div>
|
| 222 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 223 |
);
|
|
|
|
| 224 |
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 228 |
}
|
| 229 |
|
| 230 |
-
function StatusPill({
|
| 231 |
-
|
| 232 |
-
return <span className={`status-pill ${status}`}>{status}</span>;
|
| 233 |
}
|
| 234 |
|
| 235 |
-
function ProgressPanel({ job }) {
|
| 236 |
const progress = Math.round((job?.progress || 0) * 100);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 237 |
return (
|
| 238 |
-
<section className="panel">
|
| 239 |
-
<div className="
|
| 240 |
<div>
|
| 241 |
-
<h2
|
| 242 |
-
<p
|
| 243 |
</div>
|
| 244 |
-
<
|
| 245 |
</div>
|
| 246 |
-
<div className="progress-track
|
| 247 |
<div className="progress-bar" style={{ width: `${progress}%` }} />
|
| 248 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 249 |
{job?.timings && Object.keys(job.timings).length > 0 && (
|
| 250 |
-
<div className="timing-grid
|
| 251 |
{Object.entries(job.timings).map(([name, value]) => (
|
| 252 |
<div key={name}>
|
| 253 |
<span>{name.replaceAll("_", " ")}</span>
|
|
@@ -256,124 +784,134 @@ function ProgressPanel({ job }) {
|
|
| 256 |
))}
|
| 257 |
</div>
|
| 258 |
)}
|
| 259 |
-
{job?.error && <div className="error-box
|
| 260 |
</section>
|
| 261 |
);
|
| 262 |
}
|
| 263 |
|
| 264 |
-
function TranscriptPanel({ job }) {
|
| 265 |
-
if (!job?.transcript?.length) return null;
|
| 266 |
return (
|
| 267 |
-
<section className="panel">
|
| 268 |
-
<
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
</span>
|
| 275 |
-
<p>{segment.text}</p>
|
| 276 |
-
</div>
|
| 277 |
-
))}
|
| 278 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 279 |
</section>
|
| 280 |
);
|
| 281 |
}
|
| 282 |
|
| 283 |
-
function ClipsPanel({ clips, onPatch, onDelete, onApprove, onRegenerate }) {
|
| 284 |
return (
|
| 285 |
-
<section className="panel">
|
| 286 |
-
<div className="
|
| 287 |
-
<
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
clip={clip}
|
| 295 |
-
onPatch={onPatch}
|
| 296 |
-
onDelete={onDelete}
|
| 297 |
-
onApprove={onApprove}
|
| 298 |
-
onRegenerate={onRegenerate}
|
| 299 |
-
/>
|
| 300 |
-
))}
|
| 301 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 302 |
</section>
|
| 303 |
);
|
| 304 |
}
|
| 305 |
|
| 306 |
-
function
|
| 307 |
const duration = Math.max(1, clip.end_seconds - clip.start_seconds);
|
| 308 |
return (
|
| 309 |
<article className="clip-card">
|
| 310 |
<div className="clip-video">
|
| 311 |
-
{clip.video_url ?
|
| 312 |
-
<video controls src={`${API_BASE}${clip.video_url}`} />
|
| 313 |
-
) : (
|
| 314 |
-
<Film size={34} />
|
| 315 |
-
)}
|
| 316 |
</div>
|
| 317 |
<div className="clip-body">
|
| 318 |
-
<div className="
|
| 319 |
<div>
|
| 320 |
<h3>{clip.title}</h3>
|
| 321 |
<p>{clip.reason}</p>
|
| 322 |
</div>
|
| 323 |
-
<span className="score">
|
|
|
|
|
|
|
|
|
|
| 324 |
</div>
|
| 325 |
|
| 326 |
-
<div className="
|
| 327 |
-
<
|
| 328 |
-
<
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
onChange={(event) =>
|
| 335 |
-
onPatch(clip.id, { start_seconds: Number(event.target.value) })
|
| 336 |
-
}
|
| 337 |
-
/>
|
| 338 |
-
</div>
|
| 339 |
-
<div>
|
| 340 |
-
<label>End</label>
|
| 341 |
-
<input
|
| 342 |
-
type="number"
|
| 343 |
-
min="1"
|
| 344 |
-
step="0.5"
|
| 345 |
-
value={Number(clip.end_seconds).toFixed(1)}
|
| 346 |
-
onChange={(event) => onPatch(clip.id, { end_seconds: Number(event.target.value) })}
|
| 347 |
-
/>
|
| 348 |
-
</div>
|
| 349 |
-
<strong>{duration.toFixed(1)}s</strong>
|
| 350 |
</div>
|
| 351 |
|
| 352 |
<textarea
|
| 353 |
-
|
| 354 |
-
|
| 355 |
rows={3}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 356 |
/>
|
| 357 |
|
| 358 |
<div className="clip-actions">
|
| 359 |
-
<button type="button" title="
|
| 360 |
-
<
|
| 361 |
-
{
|
| 362 |
</button>
|
| 363 |
-
<button type="button" title="
|
| 364 |
-
<
|
| 365 |
-
|
| 366 |
</button>
|
| 367 |
-
<button type="button" title="
|
| 368 |
-
<
|
|
|
|
|
|
|
|
|
|
| 369 |
</button>
|
| 370 |
{clip.download_url && (
|
| 371 |
-
<a
|
| 372 |
-
|
| 373 |
-
href={`${API_BASE}${clip.download_url}`}
|
| 374 |
-
title="Download"
|
| 375 |
-
>
|
| 376 |
-
<Download size={17} />
|
| 377 |
</a>
|
| 378 |
)}
|
| 379 |
</div>
|
|
@@ -382,9 +920,178 @@ function ClipEditor({ clip, onPatch, onDelete, onApprove, onRegenerate }) {
|
|
| 382 |
);
|
| 383 |
}
|
| 384 |
|
| 385 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 386 |
return (
|
| 387 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 388 |
<span className="field-label">{label}</span>
|
| 389 |
<input
|
| 390 |
className="text-input"
|
|
@@ -392,21 +1099,53 @@ function TextField({ label, value, onChange, placeholder }) {
|
|
| 392 |
placeholder={placeholder}
|
| 393 |
onChange={(event) => onChange(event.target.value)}
|
| 394 |
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 395 |
</label>
|
| 396 |
);
|
| 397 |
}
|
| 398 |
|
| 399 |
-
function SelectField({ label, value, onChange, options }) {
|
| 400 |
return (
|
| 401 |
-
<label className="block">
|
| 402 |
<span className="field-label">{label}</span>
|
| 403 |
<select className="text-input" value={value} onChange={(event) => onChange(event.target.value)}>
|
| 404 |
{options.map((option) => (
|
| 405 |
-
<option key={option} value={option}>
|
| 406 |
-
{
|
| 407 |
</option>
|
| 408 |
))}
|
| 409 |
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 410 |
</label>
|
| 411 |
);
|
| 412 |
}
|
|
@@ -426,9 +1165,60 @@ async function fetchJson(path, options) {
|
|
| 426 |
return response.json();
|
| 427 |
}
|
| 428 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 429 |
function formatTime(value) {
|
| 430 |
-
const
|
| 431 |
-
const
|
|
|
|
| 432 |
return `${minutes}:${String(seconds).padStart(2, "0")}`;
|
| 433 |
}
|
| 434 |
|
|
|
|
| 1 |
import {
|
| 2 |
+
ArrowLeft,
|
| 3 |
+
Captions,
|
| 4 |
Check,
|
| 5 |
+
Clock3,
|
| 6 |
Download,
|
| 7 |
Film,
|
| 8 |
+
Gauge,
|
| 9 |
+
Languages,
|
| 10 |
Link as LinkIcon,
|
| 11 |
Loader2,
|
| 12 |
+
Moon,
|
| 13 |
+
PanelRightOpen,
|
| 14 |
RefreshCcw,
|
| 15 |
Scissors,
|
| 16 |
+
SlidersHorizontal,
|
| 17 |
+
Sparkles,
|
| 18 |
+
Sun,
|
| 19 |
Trash2,
|
| 20 |
Upload,
|
| 21 |
+
Wand2,
|
| 22 |
} from "lucide-react";
|
| 23 |
import React, { useEffect, useMemo, useState } from "react";
|
| 24 |
|
| 25 |
const API_BASE = import.meta.env.VITE_API_BASE_URL || "http://localhost:8000";
|
| 26 |
|
| 27 |
+
const LANGUAGES = [
|
| 28 |
+
{ code: "en", label: "EN", name: "English" },
|
| 29 |
+
{ code: "th", label: "TH", name: "ไทย" },
|
| 30 |
+
{ code: "ja", label: "JP", name: "日本語" },
|
| 31 |
+
{ code: "zh", label: "ZH", name: "中文" },
|
| 32 |
+
{ code: "ko", label: "KO", name: "한국어" },
|
| 33 |
+
];
|
| 34 |
+
|
| 35 |
+
const NICHES = [
|
| 36 |
+
"education",
|
| 37 |
+
"gaming",
|
| 38 |
+
"podcast",
|
| 39 |
+
"commentary",
|
| 40 |
+
"cars",
|
| 41 |
+
"beauty",
|
| 42 |
+
"fitness",
|
| 43 |
+
"finance",
|
| 44 |
+
"tech",
|
| 45 |
+
"lifestyle",
|
| 46 |
+
"music",
|
| 47 |
+
"other",
|
| 48 |
+
];
|
| 49 |
+
|
| 50 |
+
const CLIP_STYLES = ["informative", "funny", "dramatic", "educational", "commentary"];
|
| 51 |
+
const LANGUAGE_OPTIONS = ["Thai", "English", "Japanese", "Chinese", "Korean", "Auto"];
|
| 52 |
+
const PLATFORM_OPTIONS = ["tiktok", "youtube_shorts", "instagram_reels"];
|
| 53 |
+
|
| 54 |
const defaultProfile = {
|
| 55 |
niche: "education",
|
| 56 |
+
niche_custom: "",
|
| 57 |
+
channel_description: "",
|
| 58 |
clip_style: "informative",
|
| 59 |
clip_length_seconds: 60,
|
| 60 |
+
clip_count: 5,
|
| 61 |
primary_language: "Thai",
|
| 62 |
target_platform: "tiktok",
|
| 63 |
};
|
| 64 |
|
| 65 |
+
const en = {
|
| 66 |
+
appSubtitle: "Creator clipping workspace for AMD ROCm demos",
|
| 67 |
+
idle: "Idle",
|
| 68 |
+
queued: "Queued",
|
| 69 |
+
running: "Running",
|
| 70 |
+
completed: "Completed",
|
| 71 |
+
failed: "Failed",
|
| 72 |
+
demoMode: "Demo mode",
|
| 73 |
+
productionMode: "Production mode",
|
| 74 |
+
theme: "Theme",
|
| 75 |
+
language: "Language",
|
| 76 |
+
startPipeline: "Start pipeline",
|
| 77 |
+
channelProfile: "Channel profile",
|
| 78 |
+
channelProfileText: "Tell the AI what kind of creator you are before it scores highlights.",
|
| 79 |
+
videoInput: "Video input",
|
| 80 |
+
niche: "Niche",
|
| 81 |
+
nicheHelp: "Choose the closest category. Pick Other if your channel is more specific.",
|
| 82 |
+
customNiche: "Custom niche",
|
| 83 |
+
customNichePlaceholder: "Example: Thai AI tutorials for beginners",
|
| 84 |
+
channelDescription: "Channel description",
|
| 85 |
+
channelDescriptionHelp: "Write naturally. The AI will use this to judge what feels on-brand.",
|
| 86 |
+
channelDescriptionPlaceholder:
|
| 87 |
+
"Example: I explain AI tools in Thai with simple examples and a little humor.",
|
| 88 |
+
clipStyle: "Clip style",
|
| 89 |
+
clipLength: "Clip length (seconds)",
|
| 90 |
+
clipCount: "Number of clips",
|
| 91 |
+
clipCountHelp: "How many clip candidates should the AI generate from this video.",
|
| 92 |
+
primaryLanguage: "Primary language",
|
| 93 |
+
platform: "Platform",
|
| 94 |
+
youtube: "YouTube",
|
| 95 |
+
upload: "Upload",
|
| 96 |
+
youtubeUrl: "YouTube URL",
|
| 97 |
+
youtubePlaceholder: "https://www.youtube.com/watch?v=...",
|
| 98 |
+
videoFile: "Video file",
|
| 99 |
+
pipeline: "Pipeline",
|
| 100 |
+
ready: "Ready",
|
| 101 |
+
progressNote: "Progress is updated by backend steps. Rendering shows clip-by-clip status.",
|
| 102 |
+
currentStep: "Current step",
|
| 103 |
+
timing: "Timing",
|
| 104 |
+
transcript: "Transcript",
|
| 105 |
+
transcriptEmpty: "Transcript will appear after transcription finishes.",
|
| 106 |
+
clips: "Clips",
|
| 107 |
+
noClips: "No clips yet",
|
| 108 |
+
noClipsText: "Start the pipeline to generate profile-aware clip candidates.",
|
| 109 |
+
readyClips: "ready",
|
| 110 |
+
score: "Score",
|
| 111 |
+
reason: "Reason",
|
| 112 |
+
duration: "Duration",
|
| 113 |
+
start: "Start",
|
| 114 |
+
end: "End",
|
| 115 |
+
subtitles: "Subtitles",
|
| 116 |
+
openEditor: "Open editor",
|
| 117 |
+
approve: "Approve",
|
| 118 |
+
approved: "Approved",
|
| 119 |
+
regenerate: "Regenerate",
|
| 120 |
+
delete: "Delete",
|
| 121 |
+
download: "Download",
|
| 122 |
+
backToDashboard: "Back to dashboard",
|
| 123 |
+
editor: "Clip editor",
|
| 124 |
+
editorText: "Fine-tune timing, subtitles, and final approval for this clip.",
|
| 125 |
+
preview: "Preview",
|
| 126 |
+
clipRange: "Clip range",
|
| 127 |
+
subtitleCues: "Subtitle cues",
|
| 128 |
+
subtitleCueHelp: "Short cues read better on TikTok, Reels, and Shorts.",
|
| 129 |
+
inspector: "Inspector",
|
| 130 |
+
title: "Title",
|
| 131 |
+
status: "Status",
|
| 132 |
+
notApproved: "Not approved",
|
| 133 |
+
model: "Model",
|
| 134 |
+
source: "Source",
|
| 135 |
+
settings: "Settings",
|
| 136 |
+
stepInput: "Input",
|
| 137 |
+
stepTranscription: "Transcription",
|
| 138 |
+
stepHighlights: "Highlights",
|
| 139 |
+
stepVisual: "Visual check",
|
| 140 |
+
stepRender: "Render",
|
| 141 |
+
stepFinal: "Finalize",
|
| 142 |
+
renderProgress: "Rendering clip {{current}}/{{total}}",
|
| 143 |
+
appCta: "Generate clips",
|
| 144 |
+
niche_education: "Education",
|
| 145 |
+
niche_gaming: "Gaming",
|
| 146 |
+
niche_podcast: "Podcast",
|
| 147 |
+
niche_commentary: "Commentary",
|
| 148 |
+
niche_cars: "Cars",
|
| 149 |
+
niche_beauty: "Beauty",
|
| 150 |
+
niche_fitness: "Fitness",
|
| 151 |
+
niche_finance: "Finance",
|
| 152 |
+
niche_tech: "Tech",
|
| 153 |
+
niche_lifestyle: "Lifestyle",
|
| 154 |
+
niche_music: "Music",
|
| 155 |
+
niche_other: "Other",
|
| 156 |
+
style_informative: "Informative",
|
| 157 |
+
style_funny: "Funny",
|
| 158 |
+
style_dramatic: "Dramatic",
|
| 159 |
+
style_educational: "Educational",
|
| 160 |
+
style_commentary: "Commentary",
|
| 161 |
+
platform_tiktok: "TikTok",
|
| 162 |
+
platform_youtube_shorts: "YouTube Shorts",
|
| 163 |
+
platform_instagram_reels: "Instagram Reels",
|
| 164 |
+
};
|
| 165 |
+
|
| 166 |
+
const translations = {
|
| 167 |
+
en,
|
| 168 |
+
th: {
|
| 169 |
+
...en,
|
| 170 |
+
appSubtitle: "พื้นที่ทำคลิปสั้นสำหรับเดโม AMD ROCm",
|
| 171 |
+
idle: "ว่าง",
|
| 172 |
+
queued: "รอคิว",
|
| 173 |
+
running: "กำลังทำงาน",
|
| 174 |
+
completed: "เสร็จแล้ว",
|
| 175 |
+
failed: "ล้มเหลว",
|
| 176 |
+
demoMode: "โหมดเดโม",
|
| 177 |
+
productionMode: "โหมดจริง",
|
| 178 |
+
theme: "ธีม",
|
| 179 |
+
language: "ภาษา",
|
| 180 |
+
startPipeline: "เริ่มประมวลผล",
|
| 181 |
+
channelProfile: "โปรไฟล์ช่อง",
|
| 182 |
+
channelProfileText: "บอก AI ว่าช่องของคุณเป็นแนวไหน ก่อนให้มันเลือกไฮไลต์",
|
| 183 |
+
videoInput: "วิดีโอ",
|
| 184 |
+
niche: "หมวดช่อง",
|
| 185 |
+
nicheHelp: "เลือกหมวดที่ใกล้ที่สุด ถ้าเฉพาะทางมากให้เลือกอื่น ๆ",
|
| 186 |
+
customNiche: "หมวดช่องของคุณ",
|
| 187 |
+
customNichePlaceholder: "เช่น สอน AI ภาษาไทยสำหรับมือใหม่",
|
| 188 |
+
channelDescription: "อธิบายช่อง",
|
| 189 |
+
channelDescriptionHelp: "เขียนเป็นภาษาพูดได้เลย AI จะใช้ดูว่าอะไรเข้ากับแบรนด์ช่อง",
|
| 190 |
+
channelDescriptionPlaceholder: "เช่น ช่องผมสอนใช้ AI แบบง่าย ๆ มีมุกนิดหน่อย",
|
| 191 |
+
clipStyle: "สไตล์คลิป",
|
| 192 |
+
clipLength: "ความยาวคลิป (วินาที)",
|
| 193 |
+
clipCount: "จำนวนคลิป",
|
| 194 |
+
clipCountHelp: "จำนวนคลิปที่อยากให้ AI สร้างจากวิดีโอนี้",
|
| 195 |
+
primaryLanguage: "ภาษาหลัก",
|
| 196 |
+
platform: "แพลตฟอร์ม",
|
| 197 |
+
youtubeUrl: "ลิงก์ YouTube",
|
| 198 |
+
videoFile: "ไฟล์วิดีโอ",
|
| 199 |
+
pipeline: "ขั้นตอนประมวลผล",
|
| 200 |
+
ready: "พร้อม",
|
| 201 |
+
progressNote: "แถบนี้อัปเดตตามขั้นตอน backend และตอน render จะแสดงทีละคลิป",
|
| 202 |
+
currentStep: "ขั้นตอนปัจจุบัน",
|
| 203 |
+
timing: "เวลา",
|
| 204 |
+
transcript: "ถอดเสียง",
|
| 205 |
+
transcriptEmpty: "ข้อความถอดเสียงจะแสดงหลังประมวลผลเสร็จ",
|
| 206 |
+
clips: "คลิป",
|
| 207 |
+
noClips: "ยังไม่มีคลิป",
|
| 208 |
+
noClipsText: "เริ่ม pipeline เพื่อให้ AI สร้างคลิปตามโปรไฟล์ช่อง",
|
| 209 |
+
readyClips: "พร้อม",
|
| 210 |
+
score: "คะแนน",
|
| 211 |
+
reason: "เหตุผล",
|
| 212 |
+
duration: "ความยาว",
|
| 213 |
+
start: "เริ่ม",
|
| 214 |
+
end: "จบ",
|
| 215 |
+
subtitles: "ซับไตเติล",
|
| 216 |
+
openEditor: "เปิดตัวแก้ไข",
|
| 217 |
+
approve: "อนุมัติ",
|
| 218 |
+
approved: "อนุมัติแล้ว",
|
| 219 |
+
regenerate: "สร้างใหม่",
|
| 220 |
+
delete: "ลบ",
|
| 221 |
+
download: "ดาวน์โหลด",
|
| 222 |
+
backToDashboard: "กลับหน้า dashboard",
|
| 223 |
+
editor: "ตัวแก้ไขคลิป",
|
| 224 |
+
editorText: "ปรับเวลา ซับไตเติล และอนุมัติคลิปสุดท้าย",
|
| 225 |
+
preview: "พรีวิว",
|
| 226 |
+
clipRange: "ช่วงคลิป",
|
| 227 |
+
subtitleCues: "จังหวะซับ",
|
| 228 |
+
subtitleCueHelp: "ซับสั้น ๆ อ่านง่ายกว่าสำหรับ TikTok, Reels และ Shorts",
|
| 229 |
+
inspector: "รายละเอียด",
|
| 230 |
+
title: "ชื่อคลิป",
|
| 231 |
+
status: "สถานะ",
|
| 232 |
+
notApproved: "ยังไม่อนุมัติ",
|
| 233 |
+
model: "โมเดล",
|
| 234 |
+
source: "แหล่งที่มา",
|
| 235 |
+
settings: "ตั้งค่า",
|
| 236 |
+
stepInput: "รับวิดีโอ",
|
| 237 |
+
stepTranscription: "ถอดเสียง",
|
| 238 |
+
stepHighlights: "หาไฮไลต์",
|
| 239 |
+
stepVisual: "ตรวจภาพ",
|
| 240 |
+
stepRender: "เรนเดอร์",
|
| 241 |
+
stepFinal: "สรุปผล",
|
| 242 |
+
appCta: "สร้างคลิป",
|
| 243 |
+
niche_education: "การศึกษา",
|
| 244 |
+
niche_gaming: "เกม",
|
| 245 |
+
niche_podcast: "พอดแคสต์",
|
| 246 |
+
niche_commentary: "คอมเมนต์/วิเคราะห์",
|
| 247 |
+
niche_cars: "รถยนต์",
|
| 248 |
+
niche_beauty: "ความงาม",
|
| 249 |
+
niche_fitness: "ฟิตเนส",
|
| 250 |
+
niche_finance: "การเงิน",
|
| 251 |
+
niche_tech: "เทคโนโลยี",
|
| 252 |
+
niche_lifestyle: "ไลฟ์สไตล์",
|
| 253 |
+
niche_music: "ดนตรี",
|
| 254 |
+
niche_other: "อื่น ๆ",
|
| 255 |
+
style_informative: "ให้ข้อมูล",
|
| 256 |
+
style_funny: "ตลก",
|
| 257 |
+
style_dramatic: "ดราม่า",
|
| 258 |
+
style_educational: "สอน/ให้ความรู้",
|
| 259 |
+
style_commentary: "วิเคร��ะห์",
|
| 260 |
+
platform_youtube_shorts: "YouTube Shorts",
|
| 261 |
+
platform_instagram_reels: "Instagram Reels",
|
| 262 |
+
},
|
| 263 |
+
ja: {
|
| 264 |
+
...en,
|
| 265 |
+
appSubtitle: "AMD ROCm デモ向けクリエイター用クリップ制作ワークスペース",
|
| 266 |
+
channelProfile: "チャンネル設定",
|
| 267 |
+
videoInput: "動画入力",
|
| 268 |
+
niche: "ジャンル",
|
| 269 |
+
customNiche: "カスタムジャンル",
|
| 270 |
+
channelDescription: "チャンネル説明",
|
| 271 |
+
clipStyle: "クリップスタイル",
|
| 272 |
+
clipLength: "クリップ長(秒)",
|
| 273 |
+
clipCount: "クリップ数",
|
| 274 |
+
primaryLanguage: "主な言語",
|
| 275 |
+
platform: "プラットフォーム",
|
| 276 |
+
startPipeline: "パイプライン開始",
|
| 277 |
+
pipeline: "パイプライン",
|
| 278 |
+
transcript: "文字起こし",
|
| 279 |
+
clips: "クリップ",
|
| 280 |
+
noClips: "まだクリップがありません",
|
| 281 |
+
openEditor: "エディターを開く",
|
| 282 |
+
editor: "クリップエディター",
|
| 283 |
+
subtitles: "字幕",
|
| 284 |
+
subtitleCues: "字幕キュー",
|
| 285 |
+
approve: "承認",
|
| 286 |
+
approved: "承認済み",
|
| 287 |
+
regenerate: "再生成",
|
| 288 |
+
delete: "削除",
|
| 289 |
+
download: "ダウンロード",
|
| 290 |
+
backToDashboard: "ダッシュボードへ戻る",
|
| 291 |
+
},
|
| 292 |
+
zh: {
|
| 293 |
+
...en,
|
| 294 |
+
appSubtitle: "面向 AMD ROCm 演示的创作者剪辑工作台",
|
| 295 |
+
channelProfile: "频道资料",
|
| 296 |
+
videoInput: "视频输入",
|
| 297 |
+
niche: "频道领域",
|
| 298 |
+
customNiche: "自定义领域",
|
| 299 |
+
channelDescription: "频道描述",
|
| 300 |
+
clipStyle: "剪辑风格",
|
| 301 |
+
clipLength: "剪辑长度(秒)",
|
| 302 |
+
clipCount: "剪辑数量",
|
| 303 |
+
primaryLanguage: "主要语言",
|
| 304 |
+
platform: "平台",
|
| 305 |
+
startPipeline: "开始处理",
|
| 306 |
+
pipeline: "处理流程",
|
| 307 |
+
transcript: "转录文本",
|
| 308 |
+
clips: "剪辑",
|
| 309 |
+
noClips: "还没有剪辑",
|
| 310 |
+
openEditor: "打开编辑器",
|
| 311 |
+
editor: "剪辑编辑器",
|
| 312 |
+
subtitles: "字幕",
|
| 313 |
+
subtitleCues: "字幕片段",
|
| 314 |
+
approve: "批准",
|
| 315 |
+
approved: "已批准",
|
| 316 |
+
regenerate: "重新生成",
|
| 317 |
+
delete: "删除",
|
| 318 |
+
download: "下载",
|
| 319 |
+
backToDashboard: "返回仪表盘",
|
| 320 |
+
},
|
| 321 |
+
ko: {
|
| 322 |
+
...en,
|
| 323 |
+
appSubtitle: "AMD ROCm 데모를 위한 크리에이터 클립 작업 공간",
|
| 324 |
+
channelProfile: "채널 프로필",
|
| 325 |
+
videoInput: "비디오 입력",
|
| 326 |
+
niche: "채널 분야",
|
| 327 |
+
customNiche: "사용자 분야",
|
| 328 |
+
channelDescription: "채널 설명",
|
| 329 |
+
clipStyle: "클립 스타일",
|
| 330 |
+
clipLength: "클립 길이(초)",
|
| 331 |
+
clipCount: "클립 개수",
|
| 332 |
+
primaryLanguage: "기본 언어",
|
| 333 |
+
platform: "플랫폼",
|
| 334 |
+
startPipeline: "파이프라인 시작",
|
| 335 |
+
pipeline: "파이프라인",
|
| 336 |
+
transcript: "전사",
|
| 337 |
+
clips: "클립",
|
| 338 |
+
noClips: "아직 클립이 없습니다",
|
| 339 |
+
openEditor: "편집기 열기",
|
| 340 |
+
editor: "클립 편집기",
|
| 341 |
+
subtitles: "자막",
|
| 342 |
+
subtitleCues: "자막 큐",
|
| 343 |
+
approve: "승인",
|
| 344 |
+
approved: "승인됨",
|
| 345 |
+
regenerate: "다시 생성",
|
| 346 |
+
delete: "삭제",
|
| 347 |
+
download: "다운로드",
|
| 348 |
+
backToDashboard: "대시보드로 돌아가기",
|
| 349 |
+
},
|
| 350 |
+
};
|
| 351 |
+
|
| 352 |
function App() {
|
| 353 |
const [profile, setProfile] = useState(defaultProfile);
|
| 354 |
const [sourceMode, setSourceMode] = useState("youtube");
|
| 355 |
const [youtubeUrl, setYoutubeUrl] = useState("");
|
| 356 |
const [file, setFile] = useState(null);
|
| 357 |
const [job, setJob] = useState(null);
|
| 358 |
+
const [health, setHealth] = useState(null);
|
| 359 |
const [error, setError] = useState("");
|
| 360 |
const [isSubmitting, setIsSubmitting] = useState(false);
|
| 361 |
+
const [editorClipId, setEditorClipId] = useState(null);
|
| 362 |
+
const [language, setLanguage] = useState(() => localStorage.getItem("elevenclip.language") || "en");
|
| 363 |
+
const [theme, setTheme] = useState(() => {
|
| 364 |
+
const saved = localStorage.getItem("elevenclip.theme");
|
| 365 |
+
if (saved) return saved;
|
| 366 |
+
return window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
| 367 |
+
});
|
| 368 |
+
|
| 369 |
+
const t = (key, params) => {
|
| 370 |
+
let value = translations[language]?.[key] ?? translations.en[key] ?? key;
|
| 371 |
+
if (params) {
|
| 372 |
+
Object.entries(params).forEach(([name, replacement]) => {
|
| 373 |
+
value = value.replaceAll(`{{${name}}}`, String(replacement));
|
| 374 |
+
});
|
| 375 |
+
}
|
| 376 |
+
return value;
|
| 377 |
+
};
|
| 378 |
|
| 379 |
const activeClips = useMemo(
|
| 380 |
() => (job?.clips || []).filter((clip) => !clip.deleted),
|
| 381 |
[job?.clips]
|
| 382 |
);
|
| 383 |
+
const editorClip = activeClips.find((clip) => clip.id === editorClipId);
|
| 384 |
+
|
| 385 |
+
useEffect(() => {
|
| 386 |
+
document.documentElement.dataset.theme = theme;
|
| 387 |
+
localStorage.setItem("elevenclip.theme", theme);
|
| 388 |
+
}, [theme]);
|
| 389 |
+
|
| 390 |
+
useEffect(() => {
|
| 391 |
+
localStorage.setItem("elevenclip.language", language);
|
| 392 |
+
}, [language]);
|
| 393 |
+
|
| 394 |
+
useEffect(() => {
|
| 395 |
+
fetchJson("/health").then(setHealth).catch(() => setHealth(null));
|
| 396 |
+
}, []);
|
| 397 |
|
| 398 |
useEffect(() => {
|
| 399 |
if (!job || !["queued", "running"].includes(job.status)) return;
|
| 400 |
const timer = window.setInterval(async () => {
|
| 401 |
const next = await fetchJson(`/api/jobs/${job.id}`);
|
| 402 |
setJob(next);
|
| 403 |
+
}, 1200);
|
| 404 |
return () => window.clearInterval(timer);
|
| 405 |
}, [job]);
|
| 406 |
|
| 407 |
+
useEffect(() => {
|
| 408 |
+
if (editorClipId && !editorClip) setEditorClipId(null);
|
| 409 |
+
}, [editorClip, editorClipId]);
|
| 410 |
+
|
| 411 |
async function submitJob(event) {
|
| 412 |
event.preventDefault();
|
| 413 |
setError("");
|
| 414 |
setIsSubmitting(true);
|
| 415 |
+
setEditorClipId(null);
|
| 416 |
try {
|
| 417 |
if (sourceMode === "youtube") {
|
| 418 |
const next = await fetchJson("/api/jobs/youtube", {
|
|
|
|
| 463 |
}));
|
| 464 |
}
|
| 465 |
|
| 466 |
+
function setProfileValue(key) {
|
| 467 |
+
return (value) => setProfile((current) => ({ ...current, [key]: value }));
|
| 468 |
+
}
|
| 469 |
+
|
| 470 |
return (
|
| 471 |
+
<main className="app-shell">
|
| 472 |
+
<AppHeader
|
| 473 |
+
job={job}
|
| 474 |
+
health={health}
|
| 475 |
+
language={language}
|
| 476 |
+
setLanguage={setLanguage}
|
| 477 |
+
theme={theme}
|
| 478 |
+
setTheme={setTheme}
|
| 479 |
+
t={t}
|
| 480 |
+
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 481 |
|
| 482 |
+
{editorClip ? (
|
| 483 |
+
<ClipEditorPage
|
| 484 |
+
clip={editorClip}
|
| 485 |
+
job={job}
|
| 486 |
+
t={t}
|
| 487 |
+
onBack={() => setEditorClipId(null)}
|
| 488 |
+
onPatch={patchClip}
|
| 489 |
+
onDelete={(clip) => patchClip(clip.id, { deleted: true })}
|
| 490 |
+
onApprove={(clip) => patchClip(clip.id, { approved: !clip.approved })}
|
| 491 |
+
onRegenerate={regenerateClip}
|
| 492 |
+
/>
|
| 493 |
+
) : (
|
| 494 |
+
<div className="workspace-grid">
|
| 495 |
+
<section className="panel input-panel">
|
| 496 |
+
<ProfileForm
|
| 497 |
+
t={t}
|
| 498 |
+
profile={profile}
|
| 499 |
+
setProfile={setProfile}
|
| 500 |
+
setProfileValue={setProfileValue}
|
| 501 |
+
sourceMode={sourceMode}
|
| 502 |
+
setSourceMode={setSourceMode}
|
| 503 |
+
youtubeUrl={youtubeUrl}
|
| 504 |
+
setYoutubeUrl={setYoutubeUrl}
|
| 505 |
+
file={file}
|
| 506 |
+
setFile={setFile}
|
| 507 |
+
error={error}
|
| 508 |
+
isSubmitting={isSubmitting}
|
| 509 |
+
submitJob={submitJob}
|
| 510 |
+
/>
|
| 511 |
+
</section>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 512 |
|
| 513 |
+
<section className="center-column">
|
| 514 |
+
<ProgressPanel job={job} t={t} />
|
| 515 |
+
<TranscriptPanel job={job} t={t} />
|
| 516 |
+
</section>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 517 |
|
| 518 |
+
<section className="results-column">
|
| 519 |
+
<ClipsPanel
|
| 520 |
+
clips={activeClips}
|
| 521 |
+
t={t}
|
| 522 |
+
onOpenEditor={(clip) => setEditorClipId(clip.id)}
|
| 523 |
+
onPatch={patchClip}
|
| 524 |
+
onDelete={(clip) => patchClip(clip.id, { deleted: true })}
|
| 525 |
+
onApprove={(clip) => patchClip(clip.id, { approved: !clip.approved })}
|
| 526 |
+
onRegenerate={regenerateClip}
|
| 527 |
+
/>
|
| 528 |
+
</section>
|
| 529 |
+
</div>
|
| 530 |
+
)}
|
| 531 |
+
</main>
|
| 532 |
+
);
|
| 533 |
+
}
|
| 534 |
|
| 535 |
+
function AppHeader({ job, health, language, setLanguage, theme, setTheme, t }) {
|
| 536 |
+
const status = job?.status || "idle";
|
| 537 |
+
const modeLabel = health ? (health.demo_mode ? t("demoMode") : t("productionMode")) : "API";
|
| 538 |
+
const modeClass = health ? (health.demo_mode ? "demo" : "prod") : "";
|
| 539 |
+
return (
|
| 540 |
+
<header className="app-header">
|
| 541 |
+
<div className="brand-block">
|
| 542 |
+
<div className="brand-mark">
|
| 543 |
+
<Scissors size={22} />
|
| 544 |
+
</div>
|
| 545 |
+
<div>
|
| 546 |
+
<h1>ElevenClip.AI</h1>
|
| 547 |
+
<p>{t("appSubtitle")}</p>
|
| 548 |
+
</div>
|
| 549 |
</div>
|
| 550 |
+
|
| 551 |
+
<div className="header-actions">
|
| 552 |
+
<span className={`mode-pill ${modeClass}`}>{modeLabel}</span>
|
| 553 |
+
<StatusPill status={status} t={t} />
|
| 554 |
+
<label className="toolbar-select" title={t("language")}>
|
| 555 |
+
<Languages size={16} />
|
| 556 |
+
<select value={language} onChange={(event) => setLanguage(event.target.value)}>
|
| 557 |
+
{LANGUAGES.map((item) => (
|
| 558 |
+
<option key={item.code} value={item.code}>
|
| 559 |
+
{item.label}
|
| 560 |
+
</option>
|
| 561 |
+
))}
|
| 562 |
+
</select>
|
| 563 |
+
</label>
|
| 564 |
+
<button
|
| 565 |
+
className="icon-button"
|
| 566 |
+
type="button"
|
| 567 |
+
title={t("theme")}
|
| 568 |
+
onClick={() => setTheme(theme === "dark" ? "light" : "dark")}
|
| 569 |
+
>
|
| 570 |
+
{theme === "dark" ? <Sun size={17} /> : <Moon size={17} />}
|
| 571 |
+
</button>
|
| 572 |
+
</div>
|
| 573 |
+
</header>
|
| 574 |
);
|
| 575 |
+
}
|
| 576 |
|
| 577 |
+
function ProfileForm({
|
| 578 |
+
t,
|
| 579 |
+
profile,
|
| 580 |
+
setProfile,
|
| 581 |
+
setProfileValue,
|
| 582 |
+
sourceMode,
|
| 583 |
+
setSourceMode,
|
| 584 |
+
youtubeUrl,
|
| 585 |
+
setYoutubeUrl,
|
| 586 |
+
file,
|
| 587 |
+
setFile,
|
| 588 |
+
error,
|
| 589 |
+
isSubmitting,
|
| 590 |
+
submitJob,
|
| 591 |
+
}) {
|
| 592 |
+
return (
|
| 593 |
+
<form className="form-stack" onSubmit={submitJob}>
|
| 594 |
+
<div className="panel-heading">
|
| 595 |
+
<div>
|
| 596 |
+
<h2>{t("channelProfile")}</h2>
|
| 597 |
+
<p>{t("channelProfileText")}</p>
|
| 598 |
+
</div>
|
| 599 |
+
<SlidersHorizontal size={18} />
|
| 600 |
+
</div>
|
| 601 |
+
|
| 602 |
+
<SelectField
|
| 603 |
+
label={t("niche")}
|
| 604 |
+
helper={t("nicheHelp")}
|
| 605 |
+
value={profile.niche}
|
| 606 |
+
onChange={setProfileValue("niche")}
|
| 607 |
+
options={NICHES.map((value) => ({ value, label: t(`niche_${value}`) }))}
|
| 608 |
+
/>
|
| 609 |
+
{profile.niche === "other" && (
|
| 610 |
+
<TextField
|
| 611 |
+
label={t("customNiche")}
|
| 612 |
+
value={profile.niche_custom}
|
| 613 |
+
onChange={setProfileValue("niche_custom")}
|
| 614 |
+
placeholder={t("customNichePlaceholder")}
|
| 615 |
+
/>
|
| 616 |
+
)}
|
| 617 |
+
<TextAreaField
|
| 618 |
+
label={t("channelDescription")}
|
| 619 |
+
helper={t("channelDescriptionHelp")}
|
| 620 |
+
value={profile.channel_description}
|
| 621 |
+
onChange={setProfileValue("channel_description")}
|
| 622 |
+
placeholder={t("channelDescriptionPlaceholder")}
|
| 623 |
+
rows={4}
|
| 624 |
+
/>
|
| 625 |
+
|
| 626 |
+
<div className="form-grid-two">
|
| 627 |
+
<SelectField
|
| 628 |
+
label={t("clipStyle")}
|
| 629 |
+
value={profile.clip_style}
|
| 630 |
+
onChange={setProfileValue("clip_style")}
|
| 631 |
+
options={CLIP_STYLES.map((value) => ({ value, label: t(`style_${value}`) }))}
|
| 632 |
+
/>
|
| 633 |
+
<SelectField
|
| 634 |
+
label={t("clipLength")}
|
| 635 |
+
value={profile.clip_length_seconds}
|
| 636 |
+
onChange={(value) =>
|
| 637 |
+
setProfile((current) => ({ ...current, clip_length_seconds: Number(value) }))
|
| 638 |
+
}
|
| 639 |
+
options={[30, 45, 60, 90, 120].map((value) => ({ value, label: String(value) }))}
|
| 640 |
+
/>
|
| 641 |
+
</div>
|
| 642 |
+
|
| 643 |
+
<SelectField
|
| 644 |
+
label={t("clipCount")}
|
| 645 |
+
helper={t("clipCountHelp")}
|
| 646 |
+
value={profile.clip_count}
|
| 647 |
+
onChange={(value) => setProfile((current) => ({ ...current, clip_count: Number(value) }))}
|
| 648 |
+
options={[3, 5, 10].map((value) => ({ value, label: String(value) }))}
|
| 649 |
+
/>
|
| 650 |
+
|
| 651 |
+
<div className="form-grid-two">
|
| 652 |
+
<SelectField
|
| 653 |
+
label={t("primaryLanguage")}
|
| 654 |
+
value={profile.primary_language}
|
| 655 |
+
onChange={setProfileValue("primary_language")}
|
| 656 |
+
options={LANGUAGE_OPTIONS.map((value) => ({ value, label: value }))}
|
| 657 |
+
/>
|
| 658 |
+
<SelectField
|
| 659 |
+
label={t("platform")}
|
| 660 |
+
value={profile.target_platform}
|
| 661 |
+
onChange={setProfileValue("target_platform")}
|
| 662 |
+
options={PLATFORM_OPTIONS.map((value) => ({ value, label: t(`platform_${value}`) }))}
|
| 663 |
+
/>
|
| 664 |
+
</div>
|
| 665 |
+
|
| 666 |
+
<div className="divider" />
|
| 667 |
+
|
| 668 |
+
<div className="panel-heading compact">
|
| 669 |
+
<div>
|
| 670 |
+
<h2>{t("videoInput")}</h2>
|
| 671 |
+
</div>
|
| 672 |
+
<Film size={18} />
|
| 673 |
+
</div>
|
| 674 |
+
|
| 675 |
+
<div className="segmented">
|
| 676 |
+
<button
|
| 677 |
+
type="button"
|
| 678 |
+
className={sourceMode === "youtube" ? "active" : ""}
|
| 679 |
+
onClick={() => setSourceMode("youtube")}
|
| 680 |
+
>
|
| 681 |
+
<LinkIcon size={16} />
|
| 682 |
+
{t("youtube")}
|
| 683 |
+
</button>
|
| 684 |
+
<button
|
| 685 |
+
type="button"
|
| 686 |
+
className={sourceMode === "upload" ? "active" : ""}
|
| 687 |
+
onClick={() => setSourceMode("upload")}
|
| 688 |
+
>
|
| 689 |
+
<Upload size={16} />
|
| 690 |
+
{t("upload")}
|
| 691 |
+
</button>
|
| 692 |
+
</div>
|
| 693 |
+
|
| 694 |
+
{sourceMode === "youtube" ? (
|
| 695 |
+
<TextField
|
| 696 |
+
label={t("youtubeUrl")}
|
| 697 |
+
value={youtubeUrl}
|
| 698 |
+
onChange={setYoutubeUrl}
|
| 699 |
+
placeholder={t("youtubePlaceholder")}
|
| 700 |
+
/>
|
| 701 |
+
) : (
|
| 702 |
+
<label className="field-block">
|
| 703 |
+
<span className="field-label">{t("videoFile")}</span>
|
| 704 |
+
<input
|
| 705 |
+
className="file-input"
|
| 706 |
+
type="file"
|
| 707 |
+
accept="video/mp4,video/quicktime,video/*"
|
| 708 |
+
onChange={(event) => setFile(event.target.files?.[0] || null)}
|
| 709 |
+
/>
|
| 710 |
+
{file && <span className="file-name">{file.name}</span>}
|
| 711 |
+
</label>
|
| 712 |
+
)}
|
| 713 |
+
|
| 714 |
+
{error && <div className="error-box">{error}</div>}
|
| 715 |
+
<button
|
| 716 |
+
className="primary-button"
|
| 717 |
+
disabled={isSubmitting || (sourceMode === "youtube" ? !youtubeUrl : !file)}
|
| 718 |
+
type="submit"
|
| 719 |
+
>
|
| 720 |
+
{isSubmitting ? <Loader2 className="spin" size={18} /> : <Wand2 size={18} />}
|
| 721 |
+
{t("startPipeline")}
|
| 722 |
+
</button>
|
| 723 |
+
</form>
|
| 724 |
+
);
|
| 725 |
}
|
| 726 |
|
| 727 |
+
function StatusPill({ status, t }) {
|
| 728 |
+
return <span className={`status-pill ${status}`}>{t(status)}</span>;
|
|
|
|
| 729 |
}
|
| 730 |
|
| 731 |
+
function ProgressPanel({ job, t }) {
|
| 732 |
const progress = Math.round((job?.progress || 0) * 100);
|
| 733 |
+
const steps = [
|
| 734 |
+
["input", t("stepInput")],
|
| 735 |
+
["transcription", t("stepTranscription")],
|
| 736 |
+
["highlight_detection", t("stepHighlights")],
|
| 737 |
+
["multimodal_analysis", t("stepVisual")],
|
| 738 |
+
["clip_generation", t("stepRender")],
|
| 739 |
+
["finalizing", t("stepFinal")],
|
| 740 |
+
];
|
| 741 |
+
const stepIndex = Math.max(0, (job?.step_index || 0) - 1);
|
| 742 |
+
const message =
|
| 743 |
+
job?.current_step === "clip_generation" && job.active_clip_total
|
| 744 |
+
? t("renderProgress", {
|
| 745 |
+
current: job.active_clip_index || 1,
|
| 746 |
+
total: job.active_clip_total,
|
| 747 |
+
})
|
| 748 |
+
: job?.message || t("ready");
|
| 749 |
+
|
| 750 |
return (
|
| 751 |
+
<section className="panel progress-panel">
|
| 752 |
+
<div className="panel-heading">
|
| 753 |
<div>
|
| 754 |
+
<h2>{t("pipeline")}</h2>
|
| 755 |
+
<p>{message}</p>
|
| 756 |
</div>
|
| 757 |
+
<strong className="progress-percent">{progress}%</strong>
|
| 758 |
</div>
|
| 759 |
+
<div className="progress-track">
|
| 760 |
<div className="progress-bar" style={{ width: `${progress}%` }} />
|
| 761 |
</div>
|
| 762 |
+
<div className="step-list" aria-label={t("currentStep")}>
|
| 763 |
+
{steps.map(([id, label], index) => (
|
| 764 |
+
<div
|
| 765 |
+
key={id}
|
| 766 |
+
className={`step-item ${index < stepIndex ? "done" : ""} ${
|
| 767 |
+
index === stepIndex ? "active" : ""
|
| 768 |
+
}`}
|
| 769 |
+
>
|
| 770 |
+
<span>{index + 1}</span>
|
| 771 |
+
<p>{label}</p>
|
| 772 |
+
</div>
|
| 773 |
+
))}
|
| 774 |
+
</div>
|
| 775 |
+
<p className="helper-text">{t("progressNote")}</p>
|
| 776 |
+
|
| 777 |
{job?.timings && Object.keys(job.timings).length > 0 && (
|
| 778 |
+
<div className="timing-grid">
|
| 779 |
{Object.entries(job.timings).map(([name, value]) => (
|
| 780 |
<div key={name}>
|
| 781 |
<span>{name.replaceAll("_", " ")}</span>
|
|
|
|
| 784 |
))}
|
| 785 |
</div>
|
| 786 |
)}
|
| 787 |
+
{job?.error && <div className="error-box">{job.error}</div>}
|
| 788 |
</section>
|
| 789 |
);
|
| 790 |
}
|
| 791 |
|
| 792 |
+
function TranscriptPanel({ job, t }) {
|
|
|
|
| 793 |
return (
|
| 794 |
+
<section className="panel transcript-panel">
|
| 795 |
+
<div className="panel-heading compact">
|
| 796 |
+
<div>
|
| 797 |
+
<h2>{t("transcript")}</h2>
|
| 798 |
+
{!job?.transcript?.length && <p>{t("transcriptEmpty")}</p>}
|
| 799 |
+
</div>
|
| 800 |
+
<Captions size={18} />
|
|
|
|
|
|
|
|
|
|
|
|
|
| 801 |
</div>
|
| 802 |
+
{job?.transcript?.length > 0 && (
|
| 803 |
+
<div className="transcript-list">
|
| 804 |
+
{job.transcript.map((segment) => (
|
| 805 |
+
<div key={segment.id} className="transcript-row">
|
| 806 |
+
<span>
|
| 807 |
+
{formatTime(segment.start_seconds)} - {formatTime(segment.end_seconds)}
|
| 808 |
+
</span>
|
| 809 |
+
<p>{segment.text}</p>
|
| 810 |
+
</div>
|
| 811 |
+
))}
|
| 812 |
+
</div>
|
| 813 |
+
)}
|
| 814 |
</section>
|
| 815 |
);
|
| 816 |
}
|
| 817 |
|
| 818 |
+
function ClipsPanel({ clips, t, onOpenEditor, onPatch, onDelete, onApprove, onRegenerate }) {
|
| 819 |
return (
|
| 820 |
+
<section className="panel clips-panel">
|
| 821 |
+
<div className="panel-heading">
|
| 822 |
+
<div>
|
| 823 |
+
<h2>{t("clips")}</h2>
|
| 824 |
+
<p>
|
| 825 |
+
{clips.length} {t("readyClips")}
|
| 826 |
+
</p>
|
| 827 |
+
</div>
|
| 828 |
+
<PanelRightOpen size={18} />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 829 |
</div>
|
| 830 |
+
|
| 831 |
+
{clips.length === 0 ? (
|
| 832 |
+
<div className="empty-state">
|
| 833 |
+
<Film size={34} />
|
| 834 |
+
<h3>{t("noClips")}</h3>
|
| 835 |
+
<p>{t("noClipsText")}</p>
|
| 836 |
+
</div>
|
| 837 |
+
) : (
|
| 838 |
+
<div className="clip-grid">
|
| 839 |
+
{clips.map((clip) => (
|
| 840 |
+
<ClipCard
|
| 841 |
+
key={clip.id}
|
| 842 |
+
clip={clip}
|
| 843 |
+
t={t}
|
| 844 |
+
onOpenEditor={onOpenEditor}
|
| 845 |
+
onPatch={onPatch}
|
| 846 |
+
onDelete={onDelete}
|
| 847 |
+
onApprove={onApprove}
|
| 848 |
+
onRegenerate={onRegenerate}
|
| 849 |
+
/>
|
| 850 |
+
))}
|
| 851 |
+
</div>
|
| 852 |
+
)}
|
| 853 |
</section>
|
| 854 |
);
|
| 855 |
}
|
| 856 |
|
| 857 |
+
function ClipCard({ clip, t, onOpenEditor, onPatch, onDelete, onApprove, onRegenerate }) {
|
| 858 |
const duration = Math.max(1, clip.end_seconds - clip.start_seconds);
|
| 859 |
return (
|
| 860 |
<article className="clip-card">
|
| 861 |
<div className="clip-video">
|
| 862 |
+
{clip.video_url ? <video controls src={`${API_BASE}${clip.video_url}`} /> : <Film size={34} />}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 863 |
</div>
|
| 864 |
<div className="clip-body">
|
| 865 |
+
<div className="clip-title-row">
|
| 866 |
<div>
|
| 867 |
<h3>{clip.title}</h3>
|
| 868 |
<p>{clip.reason}</p>
|
| 869 |
</div>
|
| 870 |
+
<span className="score">
|
| 871 |
+
<Gauge size={14} />
|
| 872 |
+
{Math.round(clip.score)}
|
| 873 |
+
</span>
|
| 874 |
</div>
|
| 875 |
|
| 876 |
+
<div className="metric-row">
|
| 877 |
+
<span>
|
| 878 |
+
<Clock3 size={14} />
|
| 879 |
+
{duration.toFixed(1)}s
|
| 880 |
+
</span>
|
| 881 |
+
<span>
|
| 882 |
+
{formatTime(clip.start_seconds)} - {formatTime(clip.end_seconds)}
|
| 883 |
+
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 884 |
</div>
|
| 885 |
|
| 886 |
<textarea
|
| 887 |
+
defaultValue={clip.subtitle_text}
|
| 888 |
+
aria-label={t("subtitles")}
|
| 889 |
rows={3}
|
| 890 |
+
onBlur={(event) => {
|
| 891 |
+
if (event.target.value !== clip.subtitle_text) {
|
| 892 |
+
onPatch(clip.id, { subtitle_text: event.target.value });
|
| 893 |
+
}
|
| 894 |
+
}}
|
| 895 |
/>
|
| 896 |
|
| 897 |
<div className="clip-actions">
|
| 898 |
+
<button type="button" title={t("openEditor")} onClick={() => onOpenEditor(clip)}>
|
| 899 |
+
<PanelRightOpen size={16} />
|
| 900 |
+
{t("openEditor")}
|
| 901 |
</button>
|
| 902 |
+
<button type="button" title={t("approve")} onClick={() => onApprove(clip)}>
|
| 903 |
+
<Check size={16} />
|
| 904 |
+
{clip.approved ? t("approved") : t("approve")}
|
| 905 |
</button>
|
| 906 |
+
<button type="button" title={t("regenerate")} onClick={() => onRegenerate(clip)}>
|
| 907 |
+
<RefreshCcw size={16} />
|
| 908 |
+
</button>
|
| 909 |
+
<button type="button" title={t("delete")} onClick={() => onDelete(clip)}>
|
| 910 |
+
<Trash2 size={16} />
|
| 911 |
</button>
|
| 912 |
{clip.download_url && (
|
| 913 |
+
<a className="download-button" href={`${API_BASE}${clip.download_url}`} title={t("download")}>
|
| 914 |
+
<Download size={16} />
|
|
|
|
|
|
|
|
|
|
|
|
|
| 915 |
</a>
|
| 916 |
)}
|
| 917 |
</div>
|
|
|
|
| 920 |
);
|
| 921 |
}
|
| 922 |
|
| 923 |
+
function ClipEditorPage({ clip, job, t, onBack, onPatch, onDelete, onApprove, onRegenerate }) {
|
| 924 |
+
const duration = Math.max(1, clip.end_seconds - clip.start_seconds);
|
| 925 |
+
const cues = getSubtitleCues(clip, duration);
|
| 926 |
+
const metadataModel = clip.metadata?.model || "unknown";
|
| 927 |
+
|
| 928 |
+
function patchCue(index, text) {
|
| 929 |
+
const next = cues.map((cue, cueIndex) => (cueIndex === index ? { ...cue, text } : cue));
|
| 930 |
+
onPatch(clip.id, { subtitle_text: next.map((cue) => cue.text).join(" ") });
|
| 931 |
+
}
|
| 932 |
+
|
| 933 |
return (
|
| 934 |
+
<div className="editor-shell">
|
| 935 |
+
<div className="editor-topbar">
|
| 936 |
+
<button className="ghost-button" type="button" onClick={onBack}>
|
| 937 |
+
<ArrowLeft size={17} />
|
| 938 |
+
{t("backToDashboard")}
|
| 939 |
+
</button>
|
| 940 |
+
<div>
|
| 941 |
+
<h2>{t("editor")}</h2>
|
| 942 |
+
<p>{t("editorText")}</p>
|
| 943 |
+
</div>
|
| 944 |
+
</div>
|
| 945 |
+
|
| 946 |
+
<div className="editor-grid">
|
| 947 |
+
<section className="panel editor-main">
|
| 948 |
+
<div className="panel-heading compact">
|
| 949 |
+
<div>
|
| 950 |
+
<h2>{t("preview")}</h2>
|
| 951 |
+
<p>
|
| 952 |
+
{formatTime(clip.start_seconds)} - {formatTime(clip.end_seconds)}
|
| 953 |
+
</p>
|
| 954 |
+
</div>
|
| 955 |
+
<Film size={18} />
|
| 956 |
+
</div>
|
| 957 |
+
<div className="editor-preview">
|
| 958 |
+
{clip.video_url ? <video controls src={`${API_BASE}${clip.video_url}`} /> : <Film size={44} />}
|
| 959 |
+
</div>
|
| 960 |
+
|
| 961 |
+
<div className="range-editor">
|
| 962 |
+
<div className="timeline-visual">
|
| 963 |
+
<div className="timeline-fill" />
|
| 964 |
+
<div className="timeline-window" style={{ left: "18%", width: "46%" }} />
|
| 965 |
+
{Array.from({ length: 9 }).map((_, index) => (
|
| 966 |
+
<span key={index} style={{ left: `${index * 12.5}%` }} />
|
| 967 |
+
))}
|
| 968 |
+
</div>
|
| 969 |
+
<div className="timeline">
|
| 970 |
+
<NumberField
|
| 971 |
+
label={t("start")}
|
| 972 |
+
value={Number(clip.start_seconds).toFixed(1)}
|
| 973 |
+
onChange={(value) => onPatch(clip.id, { start_seconds: Number(value) })}
|
| 974 |
+
/>
|
| 975 |
+
<NumberField
|
| 976 |
+
label={t("end")}
|
| 977 |
+
value={Number(clip.end_seconds).toFixed(1)}
|
| 978 |
+
onChange={(value) => onPatch(clip.id, { end_seconds: Number(value) })}
|
| 979 |
+
/>
|
| 980 |
+
<strong>{duration.toFixed(1)}s</strong>
|
| 981 |
+
</div>
|
| 982 |
+
</div>
|
| 983 |
+
|
| 984 |
+
<div className="subtitle-editor">
|
| 985 |
+
<div className="panel-heading compact">
|
| 986 |
+
<div>
|
| 987 |
+
<h2>{t("subtitleCues")}</h2>
|
| 988 |
+
<p>{t("subtitleCueHelp")}</p>
|
| 989 |
+
</div>
|
| 990 |
+
<Captions size={18} />
|
| 991 |
+
</div>
|
| 992 |
+
<div className="cue-list">
|
| 993 |
+
{cues.map((cue, index) => (
|
| 994 |
+
<div className="cue-row" key={`${cue.start_seconds}-${index}`}>
|
| 995 |
+
<span>
|
| 996 |
+
{formatTime(cue.start_seconds)} - {formatTime(cue.end_seconds)}
|
| 997 |
+
</span>
|
| 998 |
+
<textarea
|
| 999 |
+
defaultValue={cue.text}
|
| 1000 |
+
rows={2}
|
| 1001 |
+
onBlur={(event) => {
|
| 1002 |
+
if (event.target.value !== cue.text) patchCue(index, event.target.value);
|
| 1003 |
+
}}
|
| 1004 |
+
/>
|
| 1005 |
+
</div>
|
| 1006 |
+
))}
|
| 1007 |
+
</div>
|
| 1008 |
+
</div>
|
| 1009 |
+
</section>
|
| 1010 |
+
|
| 1011 |
+
<aside className="panel inspector-panel">
|
| 1012 |
+
<div className="panel-heading compact">
|
| 1013 |
+
<div>
|
| 1014 |
+
<h2>{t("inspector")}</h2>
|
| 1015 |
+
</div>
|
| 1016 |
+
<Sparkles size={18} />
|
| 1017 |
+
</div>
|
| 1018 |
+
<dl className="inspector-list">
|
| 1019 |
+
<div>
|
| 1020 |
+
<dt>{t("title")}</dt>
|
| 1021 |
+
<dd>{clip.title}</dd>
|
| 1022 |
+
</div>
|
| 1023 |
+
<div>
|
| 1024 |
+
<dt>{t("reason")}</dt>
|
| 1025 |
+
<dd>{clip.reason}</dd>
|
| 1026 |
+
</div>
|
| 1027 |
+
<div>
|
| 1028 |
+
<dt>{t("score")}</dt>
|
| 1029 |
+
<dd>{Math.round(clip.score)}</dd>
|
| 1030 |
+
</div>
|
| 1031 |
+
<div>
|
| 1032 |
+
<dt>{t("status")}</dt>
|
| 1033 |
+
<dd>{clip.approved ? t("approved") : t("notApproved")}</dd>
|
| 1034 |
+
</div>
|
| 1035 |
+
<div>
|
| 1036 |
+
<dt>{t("model")}</dt>
|
| 1037 |
+
<dd>{metadataModel}</dd>
|
| 1038 |
+
</div>
|
| 1039 |
+
<div>
|
| 1040 |
+
<dt>{t("source")}</dt>
|
| 1041 |
+
<dd>{job?.source?.kind || "video"}</dd>
|
| 1042 |
+
</div>
|
| 1043 |
+
</dl>
|
| 1044 |
+
|
| 1045 |
+
<div className="inspector-actions">
|
| 1046 |
+
<button type="button" onClick={() => onApprove(clip)}>
|
| 1047 |
+
<Check size={16} />
|
| 1048 |
+
{clip.approved ? t("approved") : t("approve")}
|
| 1049 |
+
</button>
|
| 1050 |
+
<button type="button" onClick={() => onRegenerate(clip)}>
|
| 1051 |
+
<RefreshCcw size={16} />
|
| 1052 |
+
{t("regenerate")}
|
| 1053 |
+
</button>
|
| 1054 |
+
{clip.download_url && (
|
| 1055 |
+
<a href={`${API_BASE}${clip.download_url}`}>
|
| 1056 |
+
<Download size={16} />
|
| 1057 |
+
{t("download")}
|
| 1058 |
+
</a>
|
| 1059 |
+
)}
|
| 1060 |
+
<button className="danger" type="button" onClick={() => onDelete(clip)}>
|
| 1061 |
+
<Trash2 size={16} />
|
| 1062 |
+
{t("delete")}
|
| 1063 |
+
</button>
|
| 1064 |
+
</div>
|
| 1065 |
+
|
| 1066 |
+
<TranscriptMini transcript={job?.transcript || []} clip={clip} t={t} />
|
| 1067 |
+
</aside>
|
| 1068 |
+
</div>
|
| 1069 |
+
</div>
|
| 1070 |
+
);
|
| 1071 |
+
}
|
| 1072 |
+
|
| 1073 |
+
function TranscriptMini({ transcript, clip, t }) {
|
| 1074 |
+
const rows = transcript.filter(
|
| 1075 |
+
(segment) => segment.end_seconds >= clip.start_seconds && segment.start_seconds <= clip.end_seconds
|
| 1076 |
+
);
|
| 1077 |
+
return (
|
| 1078 |
+
<div className="mini-transcript">
|
| 1079 |
+
<h3>{t("transcript")}</h3>
|
| 1080 |
+
{rows.map((segment) => (
|
| 1081 |
+
<div key={segment.id}>
|
| 1082 |
+
<span>
|
| 1083 |
+
{formatTime(segment.start_seconds)} - {formatTime(segment.end_seconds)}
|
| 1084 |
+
</span>
|
| 1085 |
+
<p>{segment.text}</p>
|
| 1086 |
+
</div>
|
| 1087 |
+
))}
|
| 1088 |
+
</div>
|
| 1089 |
+
);
|
| 1090 |
+
}
|
| 1091 |
+
|
| 1092 |
+
function TextField({ label, value, onChange, placeholder, helper }) {
|
| 1093 |
+
return (
|
| 1094 |
+
<label className="field-block">
|
| 1095 |
<span className="field-label">{label}</span>
|
| 1096 |
<input
|
| 1097 |
className="text-input"
|
|
|
|
| 1099 |
placeholder={placeholder}
|
| 1100 |
onChange={(event) => onChange(event.target.value)}
|
| 1101 |
/>
|
| 1102 |
+
{helper && <span className="helper-text">{helper}</span>}
|
| 1103 |
+
</label>
|
| 1104 |
+
);
|
| 1105 |
+
}
|
| 1106 |
+
|
| 1107 |
+
function TextAreaField({ label, value, onChange, placeholder, helper, rows = 3 }) {
|
| 1108 |
+
return (
|
| 1109 |
+
<label className="field-block">
|
| 1110 |
+
<span className="field-label">{label}</span>
|
| 1111 |
+
<textarea
|
| 1112 |
+
value={value}
|
| 1113 |
+
placeholder={placeholder}
|
| 1114 |
+
onChange={(event) => onChange(event.target.value)}
|
| 1115 |
+
rows={rows}
|
| 1116 |
+
/>
|
| 1117 |
+
{helper && <span className="helper-text">{helper}</span>}
|
| 1118 |
</label>
|
| 1119 |
);
|
| 1120 |
}
|
| 1121 |
|
| 1122 |
+
function SelectField({ label, value, onChange, options, helper }) {
|
| 1123 |
return (
|
| 1124 |
+
<label className="field-block">
|
| 1125 |
<span className="field-label">{label}</span>
|
| 1126 |
<select className="text-input" value={value} onChange={(event) => onChange(event.target.value)}>
|
| 1127 |
{options.map((option) => (
|
| 1128 |
+
<option key={option.value} value={option.value}>
|
| 1129 |
+
{option.label}
|
| 1130 |
</option>
|
| 1131 |
))}
|
| 1132 |
</select>
|
| 1133 |
+
{helper && <span className="helper-text">{helper}</span>}
|
| 1134 |
+
</label>
|
| 1135 |
+
);
|
| 1136 |
+
}
|
| 1137 |
+
|
| 1138 |
+
function NumberField({ label, value, onChange }) {
|
| 1139 |
+
return (
|
| 1140 |
+
<label>
|
| 1141 |
+
<span>{label}</span>
|
| 1142 |
+
<input
|
| 1143 |
+
type="number"
|
| 1144 |
+
min="0"
|
| 1145 |
+
step="0.5"
|
| 1146 |
+
value={value}
|
| 1147 |
+
onChange={(event) => onChange(event.target.value)}
|
| 1148 |
+
/>
|
| 1149 |
</label>
|
| 1150 |
);
|
| 1151 |
}
|
|
|
|
| 1165 |
return response.json();
|
| 1166 |
}
|
| 1167 |
|
| 1168 |
+
function getSubtitleCues(clip, duration) {
|
| 1169 |
+
const fromMetadata = clip.metadata?.subtitle_cues;
|
| 1170 |
+
if (Array.isArray(fromMetadata) && fromMetadata.length > 0) {
|
| 1171 |
+
return fromMetadata.map((cue) => ({
|
| 1172 |
+
start_seconds: Number(cue.start_seconds || 0),
|
| 1173 |
+
end_seconds: Number(cue.end_seconds || cue.start_seconds || 0),
|
| 1174 |
+
text: cue.text || "",
|
| 1175 |
+
}));
|
| 1176 |
+
}
|
| 1177 |
+
return splitSubtitleText(clip.subtitle_text || "").map((text, index, all) => {
|
| 1178 |
+
const cueDuration = duration / Math.max(all.length, 1);
|
| 1179 |
+
return {
|
| 1180 |
+
start_seconds: roundTime(index * cueDuration),
|
| 1181 |
+
end_seconds: roundTime((index + 1) * cueDuration),
|
| 1182 |
+
text,
|
| 1183 |
+
};
|
| 1184 |
+
});
|
| 1185 |
+
}
|
| 1186 |
+
|
| 1187 |
+
function splitSubtitleText(text) {
|
| 1188 |
+
const clean = text.trim().replace(/\s+/g, " ");
|
| 1189 |
+
if (!clean) return [""];
|
| 1190 |
+
const words = clean.split(" ");
|
| 1191 |
+
if (words.length <= 1) {
|
| 1192 |
+
const chunks = [];
|
| 1193 |
+
for (let index = 0; index < clean.length; index += 38) {
|
| 1194 |
+
chunks.push(clean.slice(index, index + 38));
|
| 1195 |
+
}
|
| 1196 |
+
return chunks;
|
| 1197 |
+
}
|
| 1198 |
+
const chunks = [];
|
| 1199 |
+
let current = [];
|
| 1200 |
+
words.forEach((word) => {
|
| 1201 |
+
const candidate = [...current, word].join(" ");
|
| 1202 |
+
const punctuationBreak = current.length > 0 && /[,.!?;:]$/.test(current[current.length - 1]);
|
| 1203 |
+
if (current.length > 0 && (candidate.length > 42 || current.length >= 7 || punctuationBreak)) {
|
| 1204 |
+
chunks.push(current.join(" "));
|
| 1205 |
+
current = [word];
|
| 1206 |
+
} else {
|
| 1207 |
+
current.push(word);
|
| 1208 |
+
}
|
| 1209 |
+
});
|
| 1210 |
+
if (current.length) chunks.push(current.join(" "));
|
| 1211 |
+
return chunks;
|
| 1212 |
+
}
|
| 1213 |
+
|
| 1214 |
+
function roundTime(value) {
|
| 1215 |
+
return Math.round(value * 10) / 10;
|
| 1216 |
+
}
|
| 1217 |
+
|
| 1218 |
function formatTime(value) {
|
| 1219 |
+
const safeValue = Number.isFinite(Number(value)) ? Number(value) : 0;
|
| 1220 |
+
const minutes = Math.floor(safeValue / 60);
|
| 1221 |
+
const seconds = Math.floor(safeValue % 60);
|
| 1222 |
return `${minutes}:${String(seconds).padStart(2, "0")}`;
|
| 1223 |
}
|
| 1224 |
|
frontend/src/styles.css
CHANGED
|
@@ -5,10 +5,55 @@
|
|
| 5 |
:root {
|
| 6 |
color-scheme: light;
|
| 7 |
font-family: Inter, ui-sans-serif, system-ui, sans-serif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
}
|
| 9 |
|
| 10 |
body {
|
| 11 |
margin: 0;
|
|
|
|
|
|
|
| 12 |
}
|
| 13 |
|
| 14 |
button,
|
|
@@ -18,315 +63,839 @@ textarea {
|
|
| 18 |
font: inherit;
|
| 19 |
}
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
background: white;
|
| 25 |
-
padding: 20px;
|
| 26 |
-
box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
|
| 27 |
}
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
letter-spacing: 0;
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
text-transform: uppercase;
|
| 35 |
}
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
.field-label {
|
| 38 |
-
|
| 39 |
-
margin-bottom: 6px;
|
| 40 |
font-size: 0.82rem;
|
| 41 |
-
font-weight:
|
| 42 |
-
color: rgb(71 85 105);
|
| 43 |
}
|
| 44 |
|
| 45 |
.text-input,
|
| 46 |
-
.file-input
|
|
|
|
|
|
|
| 47 |
width: 100%;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
min-height: 42px;
|
| 49 |
-
border: 1px solid rgb(203 213 225);
|
| 50 |
-
border-radius: 6px;
|
| 51 |
-
background: white;
|
| 52 |
padding: 9px 11px;
|
| 53 |
-
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
}
|
| 56 |
|
| 57 |
.text-input:focus,
|
| 58 |
.file-input:focus,
|
| 59 |
-
textarea:focus
|
| 60 |
-
|
| 61 |
-
|
|
|
|
| 62 |
}
|
| 63 |
|
| 64 |
.segmented {
|
| 65 |
display: grid;
|
| 66 |
grid-template-columns: 1fr 1fr;
|
| 67 |
gap: 4px;
|
| 68 |
-
border-radius:
|
| 69 |
-
background:
|
| 70 |
padding: 4px;
|
| 71 |
}
|
| 72 |
|
| 73 |
.segmented button {
|
| 74 |
display: flex;
|
| 75 |
-
min-height:
|
| 76 |
align-items: center;
|
| 77 |
justify-content: center;
|
| 78 |
gap: 8px;
|
| 79 |
border: 0;
|
| 80 |
-
border-radius:
|
| 81 |
-
|
|
|
|
| 82 |
}
|
| 83 |
|
| 84 |
.segmented button.active {
|
| 85 |
-
background:
|
| 86 |
-
color:
|
| 87 |
-
box-shadow: 0 1px 2px rgb(15 23 42 / 0.
|
| 88 |
}
|
| 89 |
|
| 90 |
-
.primary-button
|
| 91 |
-
|
| 92 |
-
.download-button {
|
| 93 |
-
display: inline-flex;
|
| 94 |
-
min-height: 40px;
|
| 95 |
-
align-items: center;
|
| 96 |
justify-content: center;
|
| 97 |
-
gap:
|
| 98 |
-
border
|
| 99 |
-
border:
|
| 100 |
-
|
| 101 |
-
color:
|
| 102 |
-
|
| 103 |
}
|
| 104 |
|
| 105 |
-
.primary-button {
|
| 106 |
-
|
| 107 |
-
border-color: rgb(15 23 42);
|
| 108 |
-
background: rgb(15 23 42);
|
| 109 |
-
color: white;
|
| 110 |
-
font-weight: 700;
|
| 111 |
}
|
| 112 |
|
| 113 |
.primary-button:disabled {
|
| 114 |
-
cursor: not-allowed;
|
| 115 |
opacity: 0.55;
|
| 116 |
}
|
| 117 |
|
| 118 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
border-radius: 999px;
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
font-size: 0.78rem;
|
| 123 |
-
font-weight: 800;
|
| 124 |
-
text-transform: uppercase;
|
| 125 |
}
|
| 126 |
|
| 127 |
-
.
|
| 128 |
-
|
| 129 |
-
border-
|
| 130 |
-
background:
|
| 131 |
-
|
| 132 |
}
|
| 133 |
|
| 134 |
-
.
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
|
|
|
| 138 |
}
|
| 139 |
|
| 140 |
-
.
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
|
|
|
|
|
|
|
|
|
| 144 |
}
|
| 145 |
|
| 146 |
-
.
|
| 147 |
-
|
| 148 |
-
|
|
|
|
|
|
|
|
|
|
| 149 |
border-radius: 999px;
|
| 150 |
-
background:
|
|
|
|
| 151 |
}
|
| 152 |
|
| 153 |
-
.
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
}
|
| 159 |
|
| 160 |
.timing-grid {
|
| 161 |
display: grid;
|
| 162 |
-
grid-template-columns: repeat(auto-fit, minmax(
|
| 163 |
gap: 10px;
|
|
|
|
| 164 |
}
|
| 165 |
|
| 166 |
.timing-grid div {
|
| 167 |
-
border: 1px solid
|
| 168 |
-
border-radius:
|
|
|
|
| 169 |
padding: 10px;
|
| 170 |
}
|
| 171 |
|
| 172 |
-
.timing-grid span
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
}
|
| 177 |
|
| 178 |
.timing-grid strong {
|
| 179 |
display: block;
|
| 180 |
margin-top: 4px;
|
| 181 |
-
|
|
|
|
|
|
|
| 182 |
}
|
| 183 |
|
| 184 |
.transcript-list {
|
| 185 |
display: grid;
|
| 186 |
-
max-height:
|
| 187 |
overflow: auto;
|
| 188 |
gap: 8px;
|
|
|
|
| 189 |
}
|
| 190 |
|
| 191 |
.transcript-row {
|
| 192 |
display: grid;
|
| 193 |
-
grid-template-columns:
|
| 194 |
gap: 12px;
|
| 195 |
-
border-bottom: 1px solid
|
| 196 |
padding-bottom: 8px;
|
| 197 |
}
|
| 198 |
|
| 199 |
-
.transcript-row
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 203 |
}
|
| 204 |
|
| 205 |
-
.
|
| 206 |
margin: 0;
|
| 207 |
-
color:
|
| 208 |
-
font-size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
}
|
| 210 |
|
| 211 |
.clip-card {
|
| 212 |
overflow: hidden;
|
| 213 |
-
border: 1px solid
|
| 214 |
-
border-radius:
|
| 215 |
-
background:
|
| 216 |
}
|
| 217 |
|
| 218 |
.clip-video {
|
| 219 |
display: grid;
|
| 220 |
aspect-ratio: 9 / 16;
|
| 221 |
-
max-height:
|
| 222 |
place-items: center;
|
| 223 |
-
background:
|
| 224 |
color: white;
|
| 225 |
}
|
| 226 |
|
| 227 |
.clip-video video {
|
| 228 |
-
height: 100%;
|
| 229 |
width: 100%;
|
|
|
|
| 230 |
object-fit: contain;
|
| 231 |
}
|
| 232 |
|
| 233 |
.clip-body {
|
| 234 |
display: grid;
|
| 235 |
-
gap:
|
| 236 |
-
padding:
|
| 237 |
}
|
| 238 |
|
| 239 |
-
.clip-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240 |
margin: 0;
|
| 241 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
font-weight: 750;
|
| 243 |
}
|
| 244 |
|
| 245 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 246 |
margin: 4px 0 0;
|
| 247 |
-
color:
|
| 248 |
-
font-size: 0.86rem;
|
| 249 |
}
|
| 250 |
|
| 251 |
-
.
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 259 |
}
|
| 260 |
|
| 261 |
.timeline {
|
| 262 |
display: grid;
|
| 263 |
-
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr)
|
| 264 |
align-items: end;
|
| 265 |
-
gap:
|
| 266 |
}
|
| 267 |
|
| 268 |
.timeline label {
|
| 269 |
-
display:
|
| 270 |
-
|
| 271 |
-
color:
|
| 272 |
font-size: 0.76rem;
|
| 273 |
-
font-weight:
|
| 274 |
}
|
| 275 |
|
| 276 |
.timeline input {
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
border: 1px solid rgb(203 213 225);
|
| 280 |
-
border-radius: 6px;
|
| 281 |
-
padding: 6px 8px;
|
| 282 |
}
|
| 283 |
|
| 284 |
.timeline strong {
|
| 285 |
-
min-height:
|
| 286 |
-
border-radius:
|
| 287 |
-
background:
|
| 288 |
-
padding: 8px;
|
|
|
|
| 289 |
text-align: center;
|
| 290 |
font-variant-numeric: tabular-nums;
|
| 291 |
}
|
| 292 |
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
border: 1px solid rgb(203 213 225);
|
| 297 |
-
border-radius: 6px;
|
| 298 |
-
padding: 9px 10px;
|
| 299 |
-
color: rgb(15 23 42);
|
| 300 |
}
|
| 301 |
|
| 302 |
-
.
|
| 303 |
-
display:
|
| 304 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 305 |
gap: 8px;
|
| 306 |
}
|
| 307 |
|
| 308 |
-
.
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 313 |
}
|
| 314 |
|
| 315 |
.error-box {
|
| 316 |
-
border: 1px solid
|
| 317 |
-
border-radius:
|
| 318 |
-
background:
|
| 319 |
padding: 10px;
|
| 320 |
-
color:
|
| 321 |
font-size: 0.9rem;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 322 |
}
|
| 323 |
|
| 324 |
-
@media (max-width:
|
| 325 |
-
.
|
| 326 |
-
|
|
|
|
|
|
|
| 327 |
}
|
| 328 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 329 |
.transcript-row {
|
| 330 |
grid-template-columns: 1fr;
|
| 331 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 332 |
}
|
|
|
|
| 5 |
:root {
|
| 6 |
color-scheme: light;
|
| 7 |
font-family: Inter, ui-sans-serif, system-ui, sans-serif;
|
| 8 |
+
--bg: #f6f7f9;
|
| 9 |
+
--surface: #ffffff;
|
| 10 |
+
--surface-muted: #eef2f6;
|
| 11 |
+
--surface-strong: #e2e8f0;
|
| 12 |
+
--text: #111827;
|
| 13 |
+
--text-muted: #64748b;
|
| 14 |
+
--text-soft: #94a3b8;
|
| 15 |
+
--border: #d9e2ec;
|
| 16 |
+
--border-strong: #b7c4d4;
|
| 17 |
+
--primary: #0f766e;
|
| 18 |
+
--primary-strong: #115e59;
|
| 19 |
+
--primary-soft: #ccfbf1;
|
| 20 |
+
--accent: #d97706;
|
| 21 |
+
--accent-soft: #fef3c7;
|
| 22 |
+
--danger: #be123c;
|
| 23 |
+
--danger-soft: #ffe4e6;
|
| 24 |
+
--shadow: 0 18px 40px rgb(15 23 42 / 0.08);
|
| 25 |
+
--radius: 8px;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
:root[data-theme="dark"] {
|
| 29 |
+
color-scheme: dark;
|
| 30 |
+
--bg: #09111f;
|
| 31 |
+
--surface: #111827;
|
| 32 |
+
--surface-muted: #172033;
|
| 33 |
+
--surface-strong: #243044;
|
| 34 |
+
--text: #f8fafc;
|
| 35 |
+
--text-muted: #a8b3c7;
|
| 36 |
+
--text-soft: #748198;
|
| 37 |
+
--border: #28364d;
|
| 38 |
+
--border-strong: #3b4d67;
|
| 39 |
+
--primary: #2dd4bf;
|
| 40 |
+
--primary-strong: #5eead4;
|
| 41 |
+
--primary-soft: #133b3b;
|
| 42 |
+
--accent: #fbbf24;
|
| 43 |
+
--accent-soft: #3d2e12;
|
| 44 |
+
--danger: #fb7185;
|
| 45 |
+
--danger-soft: #3d1723;
|
| 46 |
+
--shadow: 0 20px 44px rgb(0 0 0 / 0.26);
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
* {
|
| 50 |
+
box-sizing: border-box;
|
| 51 |
}
|
| 52 |
|
| 53 |
body {
|
| 54 |
margin: 0;
|
| 55 |
+
background: var(--bg);
|
| 56 |
+
color: var(--text);
|
| 57 |
}
|
| 58 |
|
| 59 |
button,
|
|
|
|
| 63 |
font: inherit;
|
| 64 |
}
|
| 65 |
|
| 66 |
+
button,
|
| 67 |
+
select {
|
| 68 |
+
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
| 69 |
}
|
| 70 |
|
| 71 |
+
button:disabled {
|
| 72 |
+
cursor: not-allowed;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
.app-shell {
|
| 76 |
+
min-height: 100vh;
|
| 77 |
+
background:
|
| 78 |
+
linear-gradient(180deg, color-mix(in srgb, var(--surface-muted) 60%, transparent), transparent 360px),
|
| 79 |
+
var(--bg);
|
| 80 |
+
color: var(--text);
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
.app-header {
|
| 84 |
+
position: sticky;
|
| 85 |
+
top: 0;
|
| 86 |
+
z-index: 20;
|
| 87 |
+
display: flex;
|
| 88 |
+
min-height: 76px;
|
| 89 |
+
align-items: center;
|
| 90 |
+
justify-content: space-between;
|
| 91 |
+
gap: 20px;
|
| 92 |
+
border-bottom: 1px solid var(--border);
|
| 93 |
+
background: color-mix(in srgb, var(--surface) 92%, transparent);
|
| 94 |
+
padding: 14px clamp(16px, 4vw, 44px);
|
| 95 |
+
backdrop-filter: blur(18px);
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
.brand-block,
|
| 99 |
+
.header-actions,
|
| 100 |
+
.clip-actions,
|
| 101 |
+
.metric-row,
|
| 102 |
+
.editor-topbar,
|
| 103 |
+
.panel-heading,
|
| 104 |
+
.toolbar-select,
|
| 105 |
+
.mode-pill,
|
| 106 |
+
.status-pill,
|
| 107 |
+
.icon-button,
|
| 108 |
+
.ghost-button,
|
| 109 |
+
.primary-button,
|
| 110 |
+
.inspector-actions a,
|
| 111 |
+
.inspector-actions button {
|
| 112 |
+
display: flex;
|
| 113 |
+
align-items: center;
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
.brand-block {
|
| 117 |
+
min-width: 0;
|
| 118 |
+
gap: 12px;
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
.brand-mark {
|
| 122 |
+
display: grid;
|
| 123 |
+
width: 44px;
|
| 124 |
+
height: 44px;
|
| 125 |
+
flex: 0 0 auto;
|
| 126 |
+
place-items: center;
|
| 127 |
+
border-radius: var(--radius);
|
| 128 |
+
background: #020617;
|
| 129 |
+
color: white;
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
.brand-block h1,
|
| 133 |
+
.panel-heading h2,
|
| 134 |
+
.editor-topbar h2,
|
| 135 |
+
.mini-transcript h3 {
|
| 136 |
+
margin: 0;
|
| 137 |
+
color: var(--text);
|
| 138 |
letter-spacing: 0;
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
.brand-block h1 {
|
| 142 |
+
font-size: 1.2rem;
|
| 143 |
+
font-weight: 800;
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
.brand-block p,
|
| 147 |
+
.panel-heading p,
|
| 148 |
+
.helper-text,
|
| 149 |
+
.file-name {
|
| 150 |
+
margin: 2px 0 0;
|
| 151 |
+
color: var(--text-muted);
|
| 152 |
+
font-size: 0.86rem;
|
| 153 |
+
line-height: 1.5;
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
.header-actions {
|
| 157 |
+
flex-wrap: wrap;
|
| 158 |
+
justify-content: flex-end;
|
| 159 |
+
gap: 8px;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
.mode-pill,
|
| 163 |
+
.status-pill {
|
| 164 |
+
min-height: 34px;
|
| 165 |
+
border-radius: 999px;
|
| 166 |
+
border: 1px solid var(--border);
|
| 167 |
+
padding: 0 10px;
|
| 168 |
+
color: var(--text-muted);
|
| 169 |
+
font-size: 0.76rem;
|
| 170 |
+
font-weight: 800;
|
| 171 |
+
text-transform: uppercase;
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
.mode-pill.prod,
|
| 175 |
+
.status-pill.completed {
|
| 176 |
+
border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
|
| 177 |
+
background: var(--primary-soft);
|
| 178 |
+
color: var(--primary-strong);
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
.mode-pill.demo,
|
| 182 |
+
.status-pill.running,
|
| 183 |
+
.status-pill.queued {
|
| 184 |
+
border-color: color-mix(in srgb, #0ea5e9 45%, var(--border));
|
| 185 |
+
background: color-mix(in srgb, #e0f2fe 70%, var(--surface));
|
| 186 |
+
color: #0369a1;
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
:root[data-theme="dark"] .mode-pill.demo,
|
| 190 |
+
:root[data-theme="dark"] .status-pill.running,
|
| 191 |
+
:root[data-theme="dark"] .status-pill.queued {
|
| 192 |
+
background: #102a3d;
|
| 193 |
+
color: #7dd3fc;
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
.status-pill.failed {
|
| 197 |
+
border-color: color-mix(in srgb, var(--danger) 50%, var(--border));
|
| 198 |
+
background: var(--danger-soft);
|
| 199 |
+
color: var(--danger);
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
.toolbar-select,
|
| 203 |
+
.icon-button,
|
| 204 |
+
.ghost-button,
|
| 205 |
+
.clip-actions button,
|
| 206 |
+
.download-button,
|
| 207 |
+
.inspector-actions a,
|
| 208 |
+
.inspector-actions button {
|
| 209 |
+
min-height: 36px;
|
| 210 |
+
justify-content: center;
|
| 211 |
+
gap: 8px;
|
| 212 |
+
border: 1px solid var(--border);
|
| 213 |
+
border-radius: 7px;
|
| 214 |
+
background: var(--surface);
|
| 215 |
+
color: var(--text);
|
| 216 |
+
text-decoration: none;
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
.toolbar-select {
|
| 220 |
+
padding: 0 8px;
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
.toolbar-select select {
|
| 224 |
+
border: 0;
|
| 225 |
+
background: transparent;
|
| 226 |
+
color: var(--text);
|
| 227 |
+
outline: none;
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
.icon-button {
|
| 231 |
+
width: 36px;
|
| 232 |
+
padding: 0;
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
.workspace-grid {
|
| 236 |
+
display: grid;
|
| 237 |
+
grid-template-columns: minmax(300px, 360px) minmax(360px, 1fr) minmax(340px, 460px);
|
| 238 |
+
gap: 18px;
|
| 239 |
+
padding: 20px clamp(16px, 4vw, 44px) 44px;
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
.center-column,
|
| 243 |
+
.results-column,
|
| 244 |
+
.form-stack {
|
| 245 |
+
display: grid;
|
| 246 |
+
align-content: start;
|
| 247 |
+
gap: 16px;
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
.panel {
|
| 251 |
+
border: 1px solid var(--border);
|
| 252 |
+
border-radius: var(--radius);
|
| 253 |
+
background: color-mix(in srgb, var(--surface) 96%, transparent);
|
| 254 |
+
box-shadow: var(--shadow);
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
.input-panel,
|
| 258 |
+
.progress-panel,
|
| 259 |
+
.transcript-panel,
|
| 260 |
+
.clips-panel,
|
| 261 |
+
.editor-main,
|
| 262 |
+
.inspector-panel {
|
| 263 |
+
padding: 18px;
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
.input-panel {
|
| 267 |
+
position: sticky;
|
| 268 |
+
top: 96px;
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
.panel-heading {
|
| 272 |
+
justify-content: space-between;
|
| 273 |
+
gap: 12px;
|
| 274 |
+
}
|
| 275 |
+
|
| 276 |
+
.panel-heading.compact {
|
| 277 |
+
margin-bottom: 12px;
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
.panel-heading h2,
|
| 281 |
+
.editor-topbar h2,
|
| 282 |
+
.mini-transcript h3 {
|
| 283 |
+
font-size: 0.92rem;
|
| 284 |
+
font-weight: 850;
|
| 285 |
text-transform: uppercase;
|
| 286 |
}
|
| 287 |
|
| 288 |
+
.divider {
|
| 289 |
+
height: 1px;
|
| 290 |
+
background: var(--border);
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
.form-grid-two {
|
| 294 |
+
display: grid;
|
| 295 |
+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
| 296 |
+
gap: 12px;
|
| 297 |
+
}
|
| 298 |
+
|
| 299 |
+
.field-block {
|
| 300 |
+
display: grid;
|
| 301 |
+
gap: 6px;
|
| 302 |
+
}
|
| 303 |
+
|
| 304 |
.field-label {
|
| 305 |
+
color: var(--text);
|
|
|
|
| 306 |
font-size: 0.82rem;
|
| 307 |
+
font-weight: 750;
|
|
|
|
| 308 |
}
|
| 309 |
|
| 310 |
.text-input,
|
| 311 |
+
.file-input,
|
| 312 |
+
textarea,
|
| 313 |
+
.timeline input {
|
| 314 |
width: 100%;
|
| 315 |
+
border: 1px solid var(--border-strong);
|
| 316 |
+
border-radius: 7px;
|
| 317 |
+
background: var(--surface);
|
| 318 |
+
color: var(--text);
|
| 319 |
+
outline: none;
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
+
.text-input,
|
| 323 |
+
.file-input {
|
| 324 |
min-height: 42px;
|
|
|
|
|
|
|
|
|
|
| 325 |
padding: 9px 11px;
|
| 326 |
+
}
|
| 327 |
+
|
| 328 |
+
textarea {
|
| 329 |
+
resize: vertical;
|
| 330 |
+
padding: 10px 11px;
|
| 331 |
+
line-height: 1.5;
|
| 332 |
}
|
| 333 |
|
| 334 |
.text-input:focus,
|
| 335 |
.file-input:focus,
|
| 336 |
+
textarea:focus,
|
| 337 |
+
.timeline input:focus {
|
| 338 |
+
border-color: var(--primary);
|
| 339 |
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
|
| 340 |
}
|
| 341 |
|
| 342 |
.segmented {
|
| 343 |
display: grid;
|
| 344 |
grid-template-columns: 1fr 1fr;
|
| 345 |
gap: 4px;
|
| 346 |
+
border-radius: var(--radius);
|
| 347 |
+
background: var(--surface-muted);
|
| 348 |
padding: 4px;
|
| 349 |
}
|
| 350 |
|
| 351 |
.segmented button {
|
| 352 |
display: flex;
|
| 353 |
+
min-height: 40px;
|
| 354 |
align-items: center;
|
| 355 |
justify-content: center;
|
| 356 |
gap: 8px;
|
| 357 |
border: 0;
|
| 358 |
+
border-radius: 6px;
|
| 359 |
+
background: transparent;
|
| 360 |
+
color: var(--text-muted);
|
| 361 |
}
|
| 362 |
|
| 363 |
.segmented button.active {
|
| 364 |
+
background: var(--surface);
|
| 365 |
+
color: var(--text);
|
| 366 |
+
box-shadow: 0 1px 2px rgb(15 23 42 / 0.10);
|
| 367 |
}
|
| 368 |
|
| 369 |
+
.primary-button {
|
| 370 |
+
min-height: 44px;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 371 |
justify-content: center;
|
| 372 |
+
gap: 10px;
|
| 373 |
+
border: 1px solid var(--primary-strong);
|
| 374 |
+
border-radius: 7px;
|
| 375 |
+
background: var(--primary-strong);
|
| 376 |
+
color: white;
|
| 377 |
+
font-weight: 850;
|
| 378 |
}
|
| 379 |
|
| 380 |
+
:root[data-theme="dark"] .primary-button {
|
| 381 |
+
color: #042f2e;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 382 |
}
|
| 383 |
|
| 384 |
.primary-button:disabled {
|
|
|
|
| 385 |
opacity: 0.55;
|
| 386 |
}
|
| 387 |
|
| 388 |
+
.progress-percent {
|
| 389 |
+
color: var(--text);
|
| 390 |
+
font-size: 2rem;
|
| 391 |
+
font-variant-numeric: tabular-nums;
|
| 392 |
+
}
|
| 393 |
+
|
| 394 |
+
.progress-track {
|
| 395 |
+
height: 12px;
|
| 396 |
+
overflow: hidden;
|
| 397 |
border-radius: 999px;
|
| 398 |
+
background: var(--surface-strong);
|
| 399 |
+
margin-top: 16px;
|
|
|
|
|
|
|
|
|
|
| 400 |
}
|
| 401 |
|
| 402 |
+
.progress-bar {
|
| 403 |
+
height: 100%;
|
| 404 |
+
border-radius: 999px;
|
| 405 |
+
background: linear-gradient(90deg, var(--primary), var(--accent));
|
| 406 |
+
transition: width 260ms ease;
|
| 407 |
}
|
| 408 |
|
| 409 |
+
.step-list {
|
| 410 |
+
display: grid;
|
| 411 |
+
grid-template-columns: repeat(6, minmax(0, 1fr));
|
| 412 |
+
gap: 8px;
|
| 413 |
+
margin-top: 16px;
|
| 414 |
}
|
| 415 |
|
| 416 |
+
.step-item {
|
| 417 |
+
display: grid;
|
| 418 |
+
gap: 6px;
|
| 419 |
+
min-width: 0;
|
| 420 |
+
color: var(--text-soft);
|
| 421 |
+
font-size: 0.75rem;
|
| 422 |
+
font-weight: 750;
|
| 423 |
}
|
| 424 |
|
| 425 |
+
.step-item span {
|
| 426 |
+
display: grid;
|
| 427 |
+
width: 28px;
|
| 428 |
+
height: 28px;
|
| 429 |
+
place-items: center;
|
| 430 |
+
border: 1px solid var(--border);
|
| 431 |
border-radius: 999px;
|
| 432 |
+
background: var(--surface);
|
| 433 |
+
font-variant-numeric: tabular-nums;
|
| 434 |
}
|
| 435 |
|
| 436 |
+
.step-item p {
|
| 437 |
+
margin: 0;
|
| 438 |
+
overflow-wrap: anywhere;
|
| 439 |
+
}
|
| 440 |
+
|
| 441 |
+
.step-item.done,
|
| 442 |
+
.step-item.active {
|
| 443 |
+
color: var(--text);
|
| 444 |
+
}
|
| 445 |
+
|
| 446 |
+
.step-item.done span,
|
| 447 |
+
.step-item.active span {
|
| 448 |
+
border-color: var(--primary);
|
| 449 |
+
background: var(--primary-soft);
|
| 450 |
+
color: var(--primary-strong);
|
| 451 |
}
|
| 452 |
|
| 453 |
.timing-grid {
|
| 454 |
display: grid;
|
| 455 |
+
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
|
| 456 |
gap: 10px;
|
| 457 |
+
margin-top: 16px;
|
| 458 |
}
|
| 459 |
|
| 460 |
.timing-grid div {
|
| 461 |
+
border: 1px solid var(--border);
|
| 462 |
+
border-radius: 7px;
|
| 463 |
+
background: var(--surface-muted);
|
| 464 |
padding: 10px;
|
| 465 |
}
|
| 466 |
|
| 467 |
+
.timing-grid span,
|
| 468 |
+
.inspector-list dt,
|
| 469 |
+
.cue-row span,
|
| 470 |
+
.transcript-row span,
|
| 471 |
+
.mini-transcript span {
|
| 472 |
+
color: var(--text-muted);
|
| 473 |
+
font-size: 0.76rem;
|
| 474 |
+
font-weight: 750;
|
| 475 |
}
|
| 476 |
|
| 477 |
.timing-grid strong {
|
| 478 |
display: block;
|
| 479 |
margin-top: 4px;
|
| 480 |
+
color: var(--text);
|
| 481 |
+
font-size: 1.02rem;
|
| 482 |
+
font-variant-numeric: tabular-nums;
|
| 483 |
}
|
| 484 |
|
| 485 |
.transcript-list {
|
| 486 |
display: grid;
|
| 487 |
+
max-height: 420px;
|
| 488 |
overflow: auto;
|
| 489 |
gap: 8px;
|
| 490 |
+
padding-right: 6px;
|
| 491 |
}
|
| 492 |
|
| 493 |
.transcript-row {
|
| 494 |
display: grid;
|
| 495 |
+
grid-template-columns: 112px 1fr;
|
| 496 |
gap: 12px;
|
| 497 |
+
border-bottom: 1px solid var(--border);
|
| 498 |
padding-bottom: 8px;
|
| 499 |
}
|
| 500 |
|
| 501 |
+
.transcript-row p,
|
| 502 |
+
.mini-transcript p {
|
| 503 |
+
margin: 0;
|
| 504 |
+
color: var(--text);
|
| 505 |
+
font-size: 0.9rem;
|
| 506 |
+
line-height: 1.55;
|
| 507 |
+
}
|
| 508 |
+
|
| 509 |
+
.empty-state {
|
| 510 |
+
display: grid;
|
| 511 |
+
min-height: 280px;
|
| 512 |
+
place-items: center;
|
| 513 |
+
align-content: center;
|
| 514 |
+
gap: 10px;
|
| 515 |
+
border: 1px dashed var(--border-strong);
|
| 516 |
+
border-radius: var(--radius);
|
| 517 |
+
background: var(--surface-muted);
|
| 518 |
+
color: var(--text-muted);
|
| 519 |
+
text-align: center;
|
| 520 |
}
|
| 521 |
|
| 522 |
+
.empty-state h3 {
|
| 523 |
margin: 0;
|
| 524 |
+
color: var(--text);
|
| 525 |
+
font-size: 1rem;
|
| 526 |
+
}
|
| 527 |
+
|
| 528 |
+
.empty-state p {
|
| 529 |
+
max-width: 270px;
|
| 530 |
+
margin: 0;
|
| 531 |
+
line-height: 1.5;
|
| 532 |
+
}
|
| 533 |
+
|
| 534 |
+
.clip-grid {
|
| 535 |
+
display: grid;
|
| 536 |
+
gap: 14px;
|
| 537 |
}
|
| 538 |
|
| 539 |
.clip-card {
|
| 540 |
overflow: hidden;
|
| 541 |
+
border: 1px solid var(--border);
|
| 542 |
+
border-radius: var(--radius);
|
| 543 |
+
background: var(--surface-muted);
|
| 544 |
}
|
| 545 |
|
| 546 |
.clip-video {
|
| 547 |
display: grid;
|
| 548 |
aspect-ratio: 9 / 16;
|
| 549 |
+
max-height: 390px;
|
| 550 |
place-items: center;
|
| 551 |
+
background: #050b16;
|
| 552 |
color: white;
|
| 553 |
}
|
| 554 |
|
| 555 |
.clip-video video {
|
|
|
|
| 556 |
width: 100%;
|
| 557 |
+
height: 100%;
|
| 558 |
object-fit: contain;
|
| 559 |
}
|
| 560 |
|
| 561 |
.clip-body {
|
| 562 |
display: grid;
|
| 563 |
+
gap: 12px;
|
| 564 |
+
padding: 13px;
|
| 565 |
}
|
| 566 |
|
| 567 |
+
.clip-title-row {
|
| 568 |
+
display: flex;
|
| 569 |
+
align-items: flex-start;
|
| 570 |
+
justify-content: space-between;
|
| 571 |
+
gap: 10px;
|
| 572 |
+
}
|
| 573 |
+
|
| 574 |
+
.clip-title-row h3 {
|
| 575 |
margin: 0;
|
| 576 |
+
color: var(--text);
|
| 577 |
+
font-size: 0.96rem;
|
| 578 |
+
font-weight: 850;
|
| 579 |
+
line-height: 1.35;
|
| 580 |
+
}
|
| 581 |
+
|
| 582 |
+
.clip-title-row p {
|
| 583 |
+
margin: 5px 0 0;
|
| 584 |
+
color: var(--text-muted);
|
| 585 |
+
font-size: 0.82rem;
|
| 586 |
+
line-height: 1.45;
|
| 587 |
+
}
|
| 588 |
+
|
| 589 |
+
.score {
|
| 590 |
+
display: inline-flex;
|
| 591 |
+
min-width: 52px;
|
| 592 |
+
min-height: 34px;
|
| 593 |
+
flex: 0 0 auto;
|
| 594 |
+
align-items: center;
|
| 595 |
+
justify-content: center;
|
| 596 |
+
gap: 5px;
|
| 597 |
+
border-radius: 7px;
|
| 598 |
+
background: var(--accent-soft);
|
| 599 |
+
color: var(--accent);
|
| 600 |
+
font-weight: 900;
|
| 601 |
+
}
|
| 602 |
+
|
| 603 |
+
.metric-row {
|
| 604 |
+
justify-content: space-between;
|
| 605 |
+
gap: 8px;
|
| 606 |
+
color: var(--text-muted);
|
| 607 |
+
font-size: 0.8rem;
|
| 608 |
font-weight: 750;
|
| 609 |
}
|
| 610 |
|
| 611 |
+
.metric-row span {
|
| 612 |
+
display: inline-flex;
|
| 613 |
+
align-items: center;
|
| 614 |
+
gap: 5px;
|
| 615 |
+
}
|
| 616 |
+
|
| 617 |
+
.clip-actions {
|
| 618 |
+
flex-wrap: wrap;
|
| 619 |
+
gap: 8px;
|
| 620 |
+
}
|
| 621 |
+
|
| 622 |
+
.clip-actions button,
|
| 623 |
+
.download-button {
|
| 624 |
+
padding: 0 10px;
|
| 625 |
+
}
|
| 626 |
+
|
| 627 |
+
.download-button {
|
| 628 |
+
margin-left: auto;
|
| 629 |
+
border-color: var(--primary);
|
| 630 |
+
background: var(--primary);
|
| 631 |
+
color: white;
|
| 632 |
+
}
|
| 633 |
+
|
| 634 |
+
:root[data-theme="dark"] .download-button {
|
| 635 |
+
color: #042f2e;
|
| 636 |
+
}
|
| 637 |
+
|
| 638 |
+
.editor-shell {
|
| 639 |
+
display: grid;
|
| 640 |
+
gap: 18px;
|
| 641 |
+
padding: 20px clamp(16px, 4vw, 44px) 44px;
|
| 642 |
+
}
|
| 643 |
+
|
| 644 |
+
.editor-topbar {
|
| 645 |
+
justify-content: space-between;
|
| 646 |
+
gap: 18px;
|
| 647 |
+
}
|
| 648 |
+
|
| 649 |
+
.editor-topbar > div {
|
| 650 |
+
flex: 1;
|
| 651 |
+
}
|
| 652 |
+
|
| 653 |
+
.editor-topbar p {
|
| 654 |
margin: 4px 0 0;
|
| 655 |
+
color: var(--text-muted);
|
|
|
|
| 656 |
}
|
| 657 |
|
| 658 |
+
.ghost-button {
|
| 659 |
+
padding: 0 12px;
|
| 660 |
+
}
|
| 661 |
+
|
| 662 |
+
.editor-grid {
|
| 663 |
+
display: grid;
|
| 664 |
+
grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
|
| 665 |
+
gap: 18px;
|
| 666 |
+
align-items: start;
|
| 667 |
+
}
|
| 668 |
+
|
| 669 |
+
.editor-main,
|
| 670 |
+
.inspector-panel {
|
| 671 |
+
display: grid;
|
| 672 |
+
gap: 16px;
|
| 673 |
+
}
|
| 674 |
+
|
| 675 |
+
.editor-preview {
|
| 676 |
+
display: grid;
|
| 677 |
+
min-height: 520px;
|
| 678 |
+
max-height: 68vh;
|
| 679 |
+
place-items: center;
|
| 680 |
+
border-radius: var(--radius);
|
| 681 |
+
background: #050b16;
|
| 682 |
+
color: white;
|
| 683 |
+
}
|
| 684 |
+
|
| 685 |
+
.editor-preview video {
|
| 686 |
+
width: 100%;
|
| 687 |
+
height: 100%;
|
| 688 |
+
max-height: 68vh;
|
| 689 |
+
object-fit: contain;
|
| 690 |
+
}
|
| 691 |
+
|
| 692 |
+
.range-editor,
|
| 693 |
+
.subtitle-editor {
|
| 694 |
+
display: grid;
|
| 695 |
+
gap: 12px;
|
| 696 |
+
border: 1px solid var(--border);
|
| 697 |
+
border-radius: var(--radius);
|
| 698 |
+
background: var(--surface-muted);
|
| 699 |
+
padding: 14px;
|
| 700 |
+
}
|
| 701 |
+
|
| 702 |
+
.timeline-visual {
|
| 703 |
+
position: relative;
|
| 704 |
+
height: 54px;
|
| 705 |
+
overflow: hidden;
|
| 706 |
+
border-radius: 7px;
|
| 707 |
+
background: var(--surface);
|
| 708 |
+
border: 1px solid var(--border);
|
| 709 |
+
}
|
| 710 |
+
|
| 711 |
+
.timeline-fill {
|
| 712 |
+
position: absolute;
|
| 713 |
+
inset: 21px 14px;
|
| 714 |
+
border-radius: 999px;
|
| 715 |
+
background: var(--surface-strong);
|
| 716 |
+
}
|
| 717 |
+
|
| 718 |
+
.timeline-window {
|
| 719 |
+
position: absolute;
|
| 720 |
+
top: 14px;
|
| 721 |
+
height: 26px;
|
| 722 |
+
border: 2px solid var(--primary);
|
| 723 |
+
border-radius: 999px;
|
| 724 |
+
background: color-mix(in srgb, var(--primary) 24%, transparent);
|
| 725 |
+
}
|
| 726 |
+
|
| 727 |
+
.timeline-visual span {
|
| 728 |
+
position: absolute;
|
| 729 |
+
top: 18px;
|
| 730 |
+
width: 1px;
|
| 731 |
+
height: 18px;
|
| 732 |
+
background: var(--border-strong);
|
| 733 |
}
|
| 734 |
|
| 735 |
.timeline {
|
| 736 |
display: grid;
|
| 737 |
+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 82px;
|
| 738 |
align-items: end;
|
| 739 |
+
gap: 10px;
|
| 740 |
}
|
| 741 |
|
| 742 |
.timeline label {
|
| 743 |
+
display: grid;
|
| 744 |
+
gap: 5px;
|
| 745 |
+
color: var(--text-muted);
|
| 746 |
font-size: 0.76rem;
|
| 747 |
+
font-weight: 800;
|
| 748 |
}
|
| 749 |
|
| 750 |
.timeline input {
|
| 751 |
+
min-height: 38px;
|
| 752 |
+
padding: 7px 9px;
|
|
|
|
|
|
|
|
|
|
| 753 |
}
|
| 754 |
|
| 755 |
.timeline strong {
|
| 756 |
+
min-height: 38px;
|
| 757 |
+
border-radius: 7px;
|
| 758 |
+
background: var(--surface-strong);
|
| 759 |
+
padding: 9px 8px;
|
| 760 |
+
color: var(--text);
|
| 761 |
text-align: center;
|
| 762 |
font-variant-numeric: tabular-nums;
|
| 763 |
}
|
| 764 |
|
| 765 |
+
.cue-list {
|
| 766 |
+
display: grid;
|
| 767 |
+
gap: 10px;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 768 |
}
|
| 769 |
|
| 770 |
+
.cue-row {
|
| 771 |
+
display: grid;
|
| 772 |
+
grid-template-columns: 112px minmax(0, 1fr);
|
| 773 |
+
gap: 10px;
|
| 774 |
+
align-items: start;
|
| 775 |
+
}
|
| 776 |
+
|
| 777 |
+
.inspector-list {
|
| 778 |
+
display: grid;
|
| 779 |
+
gap: 12px;
|
| 780 |
+
margin: 0;
|
| 781 |
+
}
|
| 782 |
+
|
| 783 |
+
.inspector-list div {
|
| 784 |
+
border-bottom: 1px solid var(--border);
|
| 785 |
+
padding-bottom: 10px;
|
| 786 |
+
}
|
| 787 |
+
|
| 788 |
+
.inspector-list dd {
|
| 789 |
+
margin: 4px 0 0;
|
| 790 |
+
color: var(--text);
|
| 791 |
+
line-height: 1.45;
|
| 792 |
+
}
|
| 793 |
+
|
| 794 |
+
.inspector-actions {
|
| 795 |
+
display: grid;
|
| 796 |
gap: 8px;
|
| 797 |
}
|
| 798 |
|
| 799 |
+
.inspector-actions a,
|
| 800 |
+
.inspector-actions button {
|
| 801 |
+
min-height: 40px;
|
| 802 |
+
padding: 0 12px;
|
| 803 |
+
}
|
| 804 |
+
|
| 805 |
+
.inspector-actions .danger {
|
| 806 |
+
border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
|
| 807 |
+
background: var(--danger-soft);
|
| 808 |
+
color: var(--danger);
|
| 809 |
+
}
|
| 810 |
+
|
| 811 |
+
.mini-transcript {
|
| 812 |
+
display: grid;
|
| 813 |
+
gap: 10px;
|
| 814 |
+
border-top: 1px solid var(--border);
|
| 815 |
+
padding-top: 14px;
|
| 816 |
+
}
|
| 817 |
+
|
| 818 |
+
.mini-transcript div {
|
| 819 |
+
display: grid;
|
| 820 |
+
gap: 4px;
|
| 821 |
}
|
| 822 |
|
| 823 |
.error-box {
|
| 824 |
+
border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border));
|
| 825 |
+
border-radius: 7px;
|
| 826 |
+
background: var(--danger-soft);
|
| 827 |
padding: 10px;
|
| 828 |
+
color: var(--danger);
|
| 829 |
font-size: 0.9rem;
|
| 830 |
+
line-height: 1.45;
|
| 831 |
+
}
|
| 832 |
+
|
| 833 |
+
.spin {
|
| 834 |
+
animation: spin 0.9s linear infinite;
|
| 835 |
+
}
|
| 836 |
+
|
| 837 |
+
@keyframes spin {
|
| 838 |
+
to {
|
| 839 |
+
transform: rotate(360deg);
|
| 840 |
+
}
|
| 841 |
+
}
|
| 842 |
+
|
| 843 |
+
@media (max-width: 1260px) {
|
| 844 |
+
.workspace-grid {
|
| 845 |
+
grid-template-columns: minmax(290px, 340px) minmax(0, 1fr);
|
| 846 |
+
}
|
| 847 |
+
|
| 848 |
+
.results-column {
|
| 849 |
+
grid-column: 1 / -1;
|
| 850 |
+
}
|
| 851 |
+
|
| 852 |
+
.clip-grid {
|
| 853 |
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
| 854 |
+
}
|
| 855 |
}
|
| 856 |
|
| 857 |
+
@media (max-width: 900px) {
|
| 858 |
+
.app-header,
|
| 859 |
+
.editor-topbar {
|
| 860 |
+
align-items: flex-start;
|
| 861 |
+
flex-direction: column;
|
| 862 |
}
|
| 863 |
|
| 864 |
+
.workspace-grid,
|
| 865 |
+
.editor-grid {
|
| 866 |
+
grid-template-columns: 1fr;
|
| 867 |
+
}
|
| 868 |
+
|
| 869 |
+
.input-panel {
|
| 870 |
+
position: static;
|
| 871 |
+
}
|
| 872 |
+
|
| 873 |
+
.clip-grid {
|
| 874 |
+
grid-template-columns: 1fr;
|
| 875 |
+
}
|
| 876 |
+
|
| 877 |
+
.step-list {
|
| 878 |
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
| 879 |
+
}
|
| 880 |
+
|
| 881 |
+
.editor-preview {
|
| 882 |
+
min-height: 420px;
|
| 883 |
+
}
|
| 884 |
+
}
|
| 885 |
+
|
| 886 |
+
@media (max-width: 620px) {
|
| 887 |
+
.form-grid-two,
|
| 888 |
+
.timeline,
|
| 889 |
+
.cue-row,
|
| 890 |
.transcript-row {
|
| 891 |
grid-template-columns: 1fr;
|
| 892 |
}
|
| 893 |
+
|
| 894 |
+
.progress-percent {
|
| 895 |
+
font-size: 1.5rem;
|
| 896 |
+
}
|
| 897 |
+
|
| 898 |
+
.step-list {
|
| 899 |
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
| 900 |
+
}
|
| 901 |
}
|