This document outlines the strategy for transforming the current mobile-only application into a fully responsive web application supporting Desktop views.
We utilize Tailwind CSS's utility-first, mobile-first approach.
- Default classes: Apply to Mobile view (< 768px).
md:prefix: Apply to Tablet/Desktop view (>= 768px).lg:prefix: Apply to Large Desktop view (>= 1024px).
| Prefix | Minimum Width | Device Type | Action |
|---|---|---|---|
| (none) | 0px | Mobile | Default vertical layout |
md: |
768px | Tablet/Small Laptop | Sidebar appears, Grid 2 cols |
lg: |
1024px | Desktop | Grid 3 cols, Expanded spacing |
Goal: Unbind the fixed mobile width and establish desktop navigation.
Remove the hardcoded mobile constraints on Desktop.
// Before
<div className="max-w-[430px] mx-auto min-h-screen">
// After
<div className="w-full min-h-screen bg-background md:flex">
{/* Desktop Sidebar (Hidden on Mobile) */}
<aside className="hidden md:flex w-64 border-r fixed h-full z-50">
<Sidebar />
</aside>
{/* Main Content Area */}
<main className="flex-1 md:ml-64 max-w-[430px] md:max-w-screen-xl mx-auto w-full">
<Outlet />
</main>
</div>- Mobile: Keep
BottomNavigation.tsx. Addmd:hiddenclass. - Desktop: Create
src/components/Sidebar.tsx.- Should contain the same links as BottomNavigation.
- Add "Logout" button and "Profile" summary in the sidebar.
Goal: Utilize horizontal space effectively.
Transform the single-column list into a grid.
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 md:gap-6 p-4 md:p-8">
{diaries.map(diary => (
<DiaryCard key={diary.id} {...diary} />
))}
</div>Move from vertical stacking to a dashboard layout.
- Top: Summary cards in a row (Vitality, Stress, etc.).
- Body: Charts on the Left (2/3 width), Details on the Right (1/3 width).
<div className="flex flex-col md:flex-row gap-6">
<div className="md:w-2/3"><ChartComponent /></div>
<div className="md:w-1/3"><DetailPanel /></div>
</div>Goal: Optimize UI patterns for mouse vs. touch.
Use useMediaQuery to render different components based on screen size.
- Mobile:
Drawer(Slide up from bottom). - Desktop:
Dialog(Centered modal).
import { useMediaQuery } from "@/hooks/use-media-query"
const ResponsiveDialog = ({ children }) => {
const isDesktop = useMediaQuery("(min-width: 768px)")
return isDesktop ? (
<Dialog>{children}</Dialog>
) : (
<Drawer>{children}</Drawer>
)
}- Add Hover States to all interactive elements (Cards, Buttons).
hover:bg-accent,hover:shadow-lg,hover:scale-105.
- Scrollbars: Ensure custom scrollbars are visible or styled for Desktop webkit.
- Mobile: Fullscreen absolute positioning.
- Desktop: Container with fixed height/aspect-ratio or split-pane view.
h-[calc(100vh-bottom_nav)]->md:h-[600px] md:rounded-xl.
- Setup: Update
Layout.tsxto allow full width onmd:. - Nav: Create
Sidebarcomponent and mount it conditionally. - Nav: Apply
md:hiddentoBottomNavigation. - Home: Apply Grid system to
DiaryCards. - UI: Add hover effects to
ButtonandCardcomponents. - Map: Fix map container height for desktop view.
- Analysis: Refactor stats page to use 2-column layout.
- Auth: Ensure Login/Signup pages are centered nicely on large screens.