Skip to content

Open source CapCut alternative.

TypeScript

Update mock and allow for keyboard steps while playing

David Le00366e375b61
diff --git a/site/src/app/cut/_components/landing/editor-mock/EditorMock.tsx b/site/src/app/cut/_components/landing/editor-mock/EditorMock.tsx
index 2eb7f93b..da4d98ef 100644
--- a/site/src/app/cut/_components/landing/editor-mock/EditorMock.tsx
+++ b/site/src/app/cut/_components/landing/editor-mock/EditorMock.tsx
@@ -82,7 +82,7 @@ export function EditorMock() {
onClick={() => setActive(i)}
aria-pressed={i === active}
className={cn(
- "flex items-center gap-1.5 rounded-full border border-ink px-2.5 py-0.5 text-xs font-medium transition-colors",
+ "flex items-center gap-1.5 rounded-full border border-ink px-2.5 py-3 text-xs font-medium transition-colors",
i === active ? "bg-ink text-white" : "bg-white text-ink hover:bg-ink/5",
)}
>
diff --git a/site/src/cut/components/Editor.tsx b/site/src/cut/components/Editor.tsx
index 264555f7..4b6c9ed4 100644
--- a/site/src/cut/components/Editor.tsx
+++ b/site/src/cut/components/Editor.tsx
@@ -373,7 +373,10 @@ export function Editor({
s.addOverlay();
} else if ((e.key === "ArrowLeft" || e.key === "ArrowRight") && !controlFocused) {
e.preventDefault();
- const step = e.shiftKey ? 1 : 1 / 30;
+ // While playing, arrows skip in 2s jumps and playback rolls on (seek
+ // never pauses); paused, they step a frame — 1s with Shift — for
+ // precise editing.
+ const step = s.playing ? 2 : e.shiftKey ? 1 : 1 / 30;
s.seek(s.currentTime + (e.key === "ArrowLeft" ? -step : step));
} else if (e.key === "Escape") {
s.select(null);