Skip to content

Commit 679ba8e

Browse files
joaoh82claude
andauthored
feat(web): mobile-friendly + responsive sqlritedb.com (SQLR-37) (#119)
Mobile-first pass over the marketing site so SEO + Core Web Vitals ranking signals don't leak before the rest of the SEO ticket sequence lands. Renders cleanly with no horizontal scroll at 375 / 390 / 768 / 1024px+ breakpoints; tap targets on primary controls are >= 44px. - nav.tsx: client-side hamburger + full-width drawer below 760px; body-scroll lock and Esc-to-close while open. - docs/page.tsx: sticky <details> "On this page" panel surfaces the full TOC on phones (desktop sidebar + right TOC unchanged). - layout.tsx: viewport export with device-width / dark themeColor so iOS Safari + Chrome mobile chrome stop flashing white. - globals.css: 900 / 640 / 380px responsive layer — wrap padding, hero / CTA / sec-head spacing, terminal / install-bar / SDK / bench / footer / desktop showcase tuning, architecture row stacking, SQL table -> stacked cards under 640px, SDK tab bar -> horizontal scroll, hamburger + mobile-menu + docs-mobile-menu styles. Global guard switched to html { overflow-x: clip } to preserve position: sticky. - README.md: documents the responsive layers + section-local breakpoint convention for new sections. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 33bab4a commit 679ba8e

5 files changed

Lines changed: 682 additions & 4 deletions

File tree

web/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,43 @@ roadmap timeline, etc.) is intentionally hand-rolled — it ports the
9292
prototype's `styles.css` 1:1 rather than reaching for component-library
9393
abstractions.
9494

95+
## Responsive design
96+
97+
The site is mobile-first and verified at 375px (iPhone SE), 390px
98+
(iPhone 14), 768px (iPad), and 1024px+. Key conventions:
99+
100+
- **Breakpoints** live at the bottom of [`src/app/globals.css`](src/app/globals.css):
101+
900px (tablet), 760px (mobile nav cutover), 640px (phone), and 380px
102+
(very small phones). Section-level grids declare their own breakpoints
103+
inline near their styles (features, bench bars, footer, etc.).
104+
- **Nav** ([`src/components/nav.tsx`](src/components/nav.tsx)) is a
105+
client component. Below 760px the inline links collapse into a 44×44
106+
hamburger that opens a full-width drawer; Esc closes; the body scroll
107+
is locked while open.
108+
- **Docs** ([`src/app/docs/page.tsx`](src/app/docs/page.tsx)) hides the
109+
desktop sidebar and on-page TOC under 1000px and 720px respectively
110+
and shows a sticky `<details>`-driven section list in their place.
111+
- **Tap targets** — primary buttons (`.btn`), the hamburger, install-bar
112+
copy, mobile menu links, and the docs section toggle are all ≥ 44px
113+
tall on phones. Footer / docs sidebar inline nav links stay at ~36px,
114+
which is the common compromise for dense navigation lists.
115+
- **Horizontal scroll** is guarded globally with `html { overflow-x:
116+
clip }`. We use `clip` instead of `hidden` so `position: sticky` keeps
117+
working for the nav and the docs sidebar. Long URLs / unbroken tokens
118+
in prose use `overflow-wrap: anywhere` so they don't blow out the
119+
viewport.
120+
- **Tables and code blocks** scroll horizontally inside their container
121+
(`overflow-x: auto`); the SQL surface table on `/` reflows into
122+
stacked cards under 640px since its second column is a long pill list.
123+
- **Viewport / theme color** — set via the `viewport` export in
124+
[`src/app/layout.tsx`](src/app/layout.tsx); the dark `#0b0c0e`
125+
`themeColor` keeps mobile browser chrome from flashing white.
126+
127+
When adding new sections, declare the breakpoint logic alongside the
128+
section's styles rather than at the bottom of the file — it keeps the
129+
section self-contained and the global breakpoint block reserved for
130+
typography / spacing baseline tweaks.
131+
95132
## Updating the version
96133

97134
The displayed version is in [`src/lib/site.ts`](src/lib/site.ts). Update it

web/src/app/docs/page.tsx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,39 @@ export default function DocsPage() {
5858
}}
5959
/>
6060
<Nav variant="docs" />
61+
<details className="docs-mobile-menu">
62+
<summary>
63+
<span>On this page</span>
64+
</summary>
65+
<div className="docs-mobile-menu-panel">
66+
<div className="section-label">Getting started</div>
67+
<a href="#install">Install</a>
68+
<a href="#first-db">Your first database</a>
69+
<a href="#repl">Using the REPL</a>
70+
<a href="#persistence">Persistence &amp; the WAL</a>
71+
<a href="#transactions">Transactions</a>
72+
<a href="#joins">JOINs</a>
73+
<a href="#aggregates">GROUP BY &amp; aggregates</a>
74+
<a href="#alter-drop">ALTER / DROP / VACUUM</a>
75+
<a href="#prepared">Prepared statements</a>
76+
<a href="#pragma">PRAGMA</a>
77+
<a href="#vector">Vector search</a>
78+
<a href="#fts">Full-text search</a>
79+
<a href="#desktop">Desktop app</a>
80+
<a href="#mcp">MCP server</a>
81+
<div className="section-label">Embedding</div>
82+
<a href="#sdk-rust">Rust crate</a>
83+
<a href="#sdk-python">Python</a>
84+
<a href="#sdk-node">Node.js</a>
85+
<a href="#sdk-go">Go</a>
86+
<a href="#sdk-c">C FFI</a>
87+
<a href="#sdk-wasm">WASM</a>
88+
<div className="section-label">Reference</div>
89+
<a href="#supported">Supported SQL</a>
90+
<a href="#errors">Errors &amp; limits</a>
91+
<a href="#contributing">Contributing</a>
92+
</div>
93+
</details>
6194
<div className="docs-shell">
6295
<aside className="docs-side">
6396
<div className="section-label">Getting started</div>

0 commit comments

Comments
 (0)