From 68a122fcf5e73e812815f12ae35442ec2844d511 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 11 Mar 2026 19:06:53 +0200 Subject: [PATCH] chore(audio): reintroduce some styles --- .../src/widgets/type_widgets/file/Audio.tsx | 4 +- .../widgets/type_widgets/file/MediaPlayer.css | 58 +++++++++++++++ .../widgets/type_widgets/file/MediaPlayer.tsx | 12 ++-- .../src/widgets/type_widgets/file/Video.css | 70 ++----------------- .../src/widgets/type_widgets/file/Video.tsx | 4 +- 5 files changed, 76 insertions(+), 72 deletions(-) create mode 100644 apps/client/src/widgets/type_widgets/file/MediaPlayer.css diff --git a/apps/client/src/widgets/type_widgets/file/Audio.tsx b/apps/client/src/widgets/type_widgets/file/Audio.tsx index 60db5cf169..623b4efbfc 100644 --- a/apps/client/src/widgets/type_widgets/file/Audio.tsx +++ b/apps/client/src/widgets/type_widgets/file/Audio.tsx @@ -17,10 +17,10 @@ export default function AudioPreview({ note }: { note: FNote }) { onPlay={() => setPlaying(true)} onPause={() => setPlaying(false)} /> -
+
-
+
diff --git a/apps/client/src/widgets/type_widgets/file/MediaPlayer.css b/apps/client/src/widgets/type_widgets/file/MediaPlayer.css new file mode 100644 index 0000000000..9e7c5dbdc6 --- /dev/null +++ b/apps/client/src/widgets/type_widgets/file/MediaPlayer.css @@ -0,0 +1,58 @@ +.media-preview-controls { + position: absolute; + bottom: 0; + left: 0; + right: 0; + padding: 1.25em; + display: flex; + flex-direction: column; + gap: 0.5em; + background: rgba(0, 0, 0, 0.5); + color: white; + + .media-buttons-row { + display: flex; + + > * { + flex: 1; + align-items: center; + gap: 0.5em; + display: flex; + } + + .spacer { + width: var(--icon-button-size, 32px); + height: var(--icon-button-size, 32px); + } + + .center { + justify-content: center; + } + + .right { + display: flex; + justify-content: flex-end; + } + + .play-button { + --icon-button-size: 48px; + } + } + + .media-seekbar-row { + display: flex; + align-items: center; + gap: 0.5em; + + .media-time { + font-size: 0.85em; + font-variant-numeric: tabular-nums; + white-space: nowrap; + } + + .media-trackbar { + flex: 1; + cursor: pointer; + } + } +} diff --git a/apps/client/src/widgets/type_widgets/file/MediaPlayer.tsx b/apps/client/src/widgets/type_widgets/file/MediaPlayer.tsx index 7105027a85..efdcfb8948 100644 --- a/apps/client/src/widgets/type_widgets/file/MediaPlayer.tsx +++ b/apps/client/src/widgets/type_widgets/file/MediaPlayer.tsx @@ -1,3 +1,5 @@ +import "./MediaPlayer.css"; + import { RefObject } from "preact"; import { useEffect, useState } from "preact/hooks"; @@ -30,18 +32,18 @@ export function SeekBar({ mediaRef }: { mediaRef: RefObject - {formatTime(currentTime)} +
+ {formatTime(currentTime)} - -{formatTime(Math.max(0, duration - currentTime))} + -{formatTime(Math.max(0, duration - currentTime))}
); } @@ -72,4 +74,4 @@ export function PlayPauseButton({ mediaRef, playing }: { mediaRef: RefObject ); -} \ No newline at end of file +} diff --git a/apps/client/src/widgets/type_widgets/file/Video.css b/apps/client/src/widgets/type_widgets/file/Video.css index 5386672f7d..7d2516cab0 100644 --- a/apps/client/src/widgets/type_widgets/file/Video.css +++ b/apps/client/src/widgets/type_widgets/file/Video.css @@ -19,69 +19,6 @@ } } - .video-preview-controls { - position: absolute; - bottom: 0; - left: 0; - right: 0; - padding: 1.25em; - display: flex; - flex-direction: column; - gap: 0.5em; - background: rgba(0, 0, 0, 0.5); - color: white; - --icon-button-hover-color: white; - --icon-button-hover-background: rgba(255, 255, 255, 0.2); - opacity: 1; - transition: opacity 300ms ease; - - .video-buttons-row { - display: flex; - - > * { - flex: 1; - align-items: center; - gap: 0.5em; - display: flex; - } - - .spacer { - width: var(--icon-button-size, 32px); - height: var(--icon-button-size, 32px); - } - - .center { - justify-content: center; - } - - .right { - display: flex; - justify-content: flex-end; - } - - .play-button { - --icon-button-size: 48px; - } - } - } - - .video-seekbar-row { - display: flex; - align-items: center; - gap: 0.5em; - } - - .video-trackbar { - flex: 1; - cursor: pointer; - } - - .video-time { - font-size: 0.85em; - font-variant-numeric: tabular-nums; - white-space: nowrap; - } - .video-volume-row { display: flex; align-items: center; @@ -93,6 +30,13 @@ cursor: pointer; } + .media-preview-controls { + --icon-button-hover-color: white; + --icon-button-hover-background: rgba(255, 255, 255, 0.2); + opacity: 1; + transition: opacity 300ms ease; + } + .speed-dropdown { position: relative; diff --git a/apps/client/src/widgets/type_widgets/file/Video.tsx b/apps/client/src/widgets/type_widgets/file/Video.tsx index f89aa0c90d..2b9a5fb473 100644 --- a/apps/client/src/widgets/type_widgets/file/Video.tsx +++ b/apps/client/src/widgets/type_widgets/file/Video.tsx @@ -113,9 +113,9 @@ export default function VideoPreview({ note }: { note: FNote }) { onError={onError} /> -
+
-
+