Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

Add download button to desktop audio player and fix dark mode styling

Murtaza Nasir65194481830a
diff --git a/static/css/styles.css b/static/css/styles.css
index c45e4aeb..b6cb6d73 100644
--- a/static/css/styles.css
+++ b/static/css/styles.css
@@ -2826,7 +2826,9 @@ body {
background-color: transparent;
}
-.dark .audio-player-container audio::-webkit-media-controls-mute-button {
+/* Dark mode: use browser's native dark theme for audio controls */
+.dark audio {
+ color-scheme: dark;
}
/* Custom audio player wrapper for better control */
diff --git a/templates/components/detail/audio-player.html b/templates/components/detail/audio-player.html
index f9706319..a31c4d61 100644
--- a/templates/components/detail/audio-player.html
+++ b/templates/components/detail/audio-player.html
@@ -19,9 +19,10 @@
Your browser does not support the audio element.
</audio>
<a :href="'/audio/' + selectedRecording.id + '?download=true'"
- class="p-2 rounded-lg bg-[var(--bg-tertiary)] hover:bg-[var(--bg-accent-hover)] text-[var(--text-muted)] hover:text-[var(--text-accent)] transition-colors flex-shrink-0"
+ download
+ class="h-[36px] w-[36px] flex items-center justify-center rounded-lg bg-[var(--bg-tertiary)] hover:bg-[var(--bg-accent)] text-[var(--text-muted)] hover:text-white transition-all duration-200 flex-shrink-0 border border-[var(--border-secondary)] hover:border-[var(--border-focus)]"
:title="t('buttons.downloadAudio') || 'Download audio'">
- <i class="fas fa-download"></i>
+ <i class="fas fa-download text-sm"></i>
</a>
</div>
</div>
diff --git a/templates/components/detail/desktop-right-panel.html b/templates/components/detail/desktop-right-panel.html
index ac56a60c..98099358 100644
--- a/templates/components/detail/desktop-right-panel.html
+++ b/templates/components/detail/desktop-right-panel.html
@@ -10,16 +10,23 @@
<span v-text="t('help.audioDeletedMessage')"></span>
</div>
<!-- Show audio player if audio is available -->
- <audio v-else
- ref="audioPlayerElement"
- controls
- :src="'/audio/' + selectedRecording.id"
- :volume="playerVolume"
- @volumechange="onPlayerVolumeChange"
- @timeupdate="handleAudioTimeUpdate"
- class="w-full">
- Your browser does not support the audio element.
- </audio>
+ <div v-else class="flex items-center gap-2">
+ <audio ref="audioPlayerElement"
+ controls
+ :src="'/audio/' + selectedRecording.id"
+ :volume="playerVolume"
+ @volumechange="onPlayerVolumeChange"
+ @timeupdate="handleAudioTimeUpdate"
+ class="flex-1">
+ Your browser does not support the audio element.
+ </audio>
+ <a :href="'/audio/' + selectedRecording.id + '?download=true'"
+ download
+ class="h-[36px] w-[36px] flex items-center justify-center rounded-lg bg-[var(--bg-tertiary)] hover:bg-[var(--bg-accent)] text-[var(--text-muted)] hover:text-white transition-all duration-200 flex-shrink-0 border border-[var(--border-secondary)] hover:border-[var(--border-focus)]"
+ :title="t('buttons.downloadAudio') || 'Download audio'">
+ <i class="fas fa-download text-sm"></i>
+ </a>
+ </div>
</div>
</div>