From 91169f117b34a21c717ba4d8f337133407e72182 Mon Sep 17 00:00:00 2001 From: Yuyao Huang Date: Sat, 9 May 2026 10:51:09 +0800 Subject: [PATCH] responsive layout fixes for mobile and desktop - style.css: shrink nav-link padding, wrap nav-links on mobile, reduce container margin, responsive modal - goals.css: stack goal cards vertically on small screens - tasks.css: fix scroll-view height for mobile (50-55vh), side-panel width uses percentage (85%), add small-screen breakpoint at 480px - notes.css: stack filters vertically on mobile, remove min-width constraints --- static/css/goals.css | 20 ++++++++++++++++++++ static/css/notes.css | 14 ++++++++++++++ static/css/style.css | 36 ++++++++++++++++++++++++++++++++++-- static/css/tasks.css | 23 +++++++++++++++++++++-- 4 files changed, 89 insertions(+), 4 deletions(-) diff --git a/static/css/goals.css b/static/css/goals.css index ec47f77..12f23f7 100644 --- a/static/css/goals.css +++ b/static/css/goals.css @@ -128,3 +128,23 @@ .empty-state h3 { margin-bottom: 1rem; } + +@media (max-width: 640px) { + .goals-header { + flex-direction: column; + align-items: stretch; + gap: 0.75rem; + } + + .goal-card { + flex-direction: column; + align-items: stretch; + gap: 0.75rem; + padding: 1rem; + } + + .goal-actions { + justify-content: flex-end; + flex-wrap: wrap; + } +} diff --git a/static/css/notes.css b/static/css/notes.css index eea826d..dbd1994 100644 --- a/static/css/notes.css +++ b/static/css/notes.css @@ -254,4 +254,18 @@ flex-direction: column; gap: 0; } + + .notes-filters { + flex-direction: column; + align-items: stretch; + } + + .filter-group select { + min-width: 0; + width: 100%; + } + + .search-group { + min-width: 0; + } } diff --git a/static/css/style.css b/static/css/style.css index aaa6210..93df4a5 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -29,15 +29,18 @@ body { .nav-links { display: flex; align-items: center; - gap: 1rem; + gap: 0.5rem; + flex-wrap: wrap; + justify-content: flex-end; } .nav-link { color: white; text-decoration: none; - padding: 0.5rem 1rem; + padding: 0.4rem 0.6rem; border-radius: 4px; transition: background-color 0.2s; + white-space: nowrap; } .nav-link:hover { @@ -251,3 +254,32 @@ body { gap: 1rem; margin-top: 1rem; } + +@media (max-width: 640px) { + .navbar { + padding: 0.5rem 0.75rem; + flex-wrap: wrap; + gap: 0.25rem; + } + + .nav-brand { + font-size: 1.15rem; + } + + .container { + margin: 0.75rem auto; + } + + .modal-content { + margin: 0.5rem; + padding: 1rem; + } + + .modal-actions { + flex-wrap: wrap; + } + + .modal-actions .btn-danger { + width: 100%; + } +} diff --git a/static/css/tasks.css b/static/css/tasks.css index 380edb2..3a44de2 100644 --- a/static/css/tasks.css +++ b/static/css/tasks.css @@ -202,8 +202,9 @@ .side-panel { position: fixed; top: 0; - right: -400px; - width: 400px; + right: -100%; + width: 85%; + max-width: 400px; height: 100%; background: white; box-shadow: -2px 0 8px rgba(0,0,0,0.1); @@ -216,6 +217,24 @@ .side-panel.active { right: 0; } + + .scroll-view { + height: 55vh; + } +} + +@media (max-width: 480px) { + .scroll-view { + height: 50vh; + } + + .tasks-list { + padding: 30vh 1rem; + } + + .goal-selector-container select { + min-width: 140px; + } } @media (orientation: landscape) and (min-width: 1024px) {