Skip to content

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

Python

Item 7 (mobile bottom-sheet variant for modals) — adds a .modal-panel--bottom-sheet modifier and applies it to the Upload modal so on phones (≤ 640 px) the modal anchors to the bottom of the viewport, takes full width, rounds only the top corners, and slides up from the bottom instead of fading in at center, giving the user a thumb-reachable surface where the Cancel / Upload actions in the sticky footer sit right above the thumb's natural rest position; above the mobile breakpoint the modifier has zero effect so the desktop layout is unchanged; a small 36×4 px drag-handle bar is drawn via ::before so the affordance reads as a draggable sheet even though actual drag-to-dismiss isn't implemented yet (Esc and backdrop-click still work as before); .modal-header gains an extra 4px top padding on the sheet so its row sits below the handle bar; overlay uses :has(> .modal-panel--bottom-sheet) to switch from centered padded layout to flush flex-end, so existing modals that don't opt in keep their existing centered layout unchanged

Murtaza Nasirdbfe22ddecb2
diff --git a/static/css/primitives.css b/static/css/primitives.css
index dfedad22..c8ed861c 100644
--- a/static/css/primitives.css
+++ b/static/css/primitives.css
@@ -784,6 +784,50 @@ html.dark .modal-overlay {
.modal-panel--xl { max-width: 980px; }
.modal-panel--full { max-width: 95vw; max-height: 95vh; }
+/* Bottom-sheet variant: opt-in via .modal-panel--bottom-sheet on the
+ panel. Above mobile breakpoint it behaves identically to a regular
+ centered modal. On phones (≤ 640 px) the overlay collapses its
+ padding and anchors the panel to the bottom edge of the viewport,
+ stretches it full-width, rounds only the top corners, and uses a
+ slide-up animation instead of the centered fade-in. Better thumb
+ reach for the close / primary actions. A small drag-handle bar is
+ drawn via a ::before so the affordance reads as draggable even
+ without implementing actual drag-to-dismiss. */
+@media (max-width: 640px) {
+ .modal-overlay:has(> .modal-panel--bottom-sheet) {
+ padding: 0;
+ align-items: flex-end;
+ }
+ .modal-panel--bottom-sheet {
+ max-width: 100%;
+ max-height: 92vh;
+ border-radius: 1rem 1rem 0 0;
+ border-bottom-width: 0;
+ animation: modalSheetUp 220ms cubic-bezier(0.16, 1, 0.3, 1);
+ position: relative;
+ }
+ .modal-panel--bottom-sheet::before {
+ content: '';
+ position: absolute;
+ top: var(--sp-2);
+ left: 50%;
+ transform: translateX(-50%);
+ width: 36px;
+ height: 4px;
+ border-radius: 999px;
+ background: var(--border-secondary);
+ z-index: 1;
+ pointer-events: none;
+ }
+ .modal-panel--bottom-sheet .modal-header {
+ padding-top: calc(var(--sp-4) + 4px);
+ }
+}
+@keyframes modalSheetUp {
+ from { opacity: 0; transform: translateY(100%); }
+ to { opacity: 1; transform: translateY(0); }
+}
+
.modal-header {
display: flex;
align-items: center;
diff --git a/templates/components/upload-view.html b/templates/components/upload-view.html
index 4cf09471..5b830faa 100644
--- a/templates/components/upload-view.html
+++ b/templates/components/upload-view.html
@@ -9,7 +9,7 @@
@keydown.esc="closeUploadView"
tabindex="-1"
class="modal-overlay">
- <div class="modal-panel modal-panel--lg" style="max-height: 92vh;">
+ <div class="modal-panel modal-panel--lg modal-panel--bottom-sheet" style="max-height: 92vh;">
<div class="modal-header">
<i class="fas fa-microphone text-[var(--text-accent)]"></i>
<h3 class="modal-title" v-text="t('upload.title')"></h3>