Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(editor): add platform-specific zoom hint to player

Richie McIlroy56915bc628de
diff --git a/apps/desktop/src/routes/editor/Player.tsx b/apps/desktop/src/routes/editor/Player.tsx
index ae17000c2..0d46b1e14 100644
--- a/apps/desktop/src/routes/editor/Player.tsx
+++ b/apps/desktop/src/routes/editor/Player.tsx
@@ -3,6 +3,7 @@ import { ToggleButton as KToggleButton } from "@kobalte/core/toggle-button";
import { createElementBounds } from "@solid-primitives/bounds";
import { debounce } from "@solid-primitives/scheduled";
import { Menu } from "@tauri-apps/api/menu";
+import { type as ostype } from "@tauri-apps/plugin-os";
import { cx } from "cva";
import { createEffect, createSignal, onMount, Show } from "solid-js";
@@ -52,6 +53,11 @@ export function PlayerContent() {
{ label: "Quarter", value: "quarter" as EditorPreviewQuality },
];
+ const zoomHint = () =>
+ ostype() === "windows"
+ ? "Hold Ctrl and scroll, or press Ctrl +/- to zoom"
+ : "Pinch, or press Cmd +/- to zoom";
+
// Load captions on mount
onMount(async () => {
if (editorInstance?.path) {
@@ -306,7 +312,7 @@ export function PlayerContent() {
</div>
</div>
<PreviewCanvas />
- <div class="flex overflow-hidden z-10 flex-row gap-3 justify-between items-center p-5">
+ <div class="relative flex overflow-hidden z-10 flex-row gap-3 justify-between items-center p-5">
<div class="flex-1">
<Time
class="text-gray-12"
@@ -426,6 +432,9 @@ export function PlayerContent() {
}
/>
</div>
+ <div class="absolute right-2 bottom-1 text-[11px] leading-none text-right text-gray-9 pointer-events-none whitespace-nowrap">
+ {zoomHint()}
+ </div>
</div>
</div>
);