Unify section layout, scale hero title, smooth back-to-top
Scale the index hero heading to 75% of its previous size and put the header, hero, sections, devices page and footer on one horizontal grid (--pad / --maxw). Enable smooth scrolling for anchor links when reduced motion is not requested.
This commit is contained in:
1 parent
19217ee0f2
commit
739f2ad395
5 files changed
+82
-17
No files matched your search
@@ -12,6 +12,7 @@ Entrypoint for project memory. Read this before working in the repo.
|
|||||||
|
|
||||||
- [Port `site` to Astro in `site-2`](./memories/port-site-to-astro.md) — what was ported, decisions, verification, and follow-ups.
|
- [Port `site` to Astro in `site-2`](./memories/port-site-to-astro.md) — what was ported, decisions, verification, and follow-ups.
|
||||||
- [Redesign: homepage + project page](./memories/redesign-2026-11-01.md) — brief, design decisions, commits, verification.
|
- [Redesign: homepage + project page](./memories/redesign-2026-11-01.md) — brief, design decisions, commits, verification.
|
||||||
|
- [Hero scale, shared grid, smooth scroll](./memories/hero-grid-scroll-2026-11-01.md) — 75% hero title, one horizontal grid for all sections, smooth back-to-top.
|
||||||
|
|
||||||
## Current state (2026-11-01)
|
## Current state (2026-11-01)
|
||||||
|
|
||||||
@@ -21,3 +22,8 @@ The Astro port is complete and builds. `cd site-2 && npm run build` emits
|
|||||||
|
|
||||||
The homepage and project page were redesigned: solid buttons, no pill labels
|
The homepage and project page were redesigned: solid buttons, no pill labels
|
||||||
or eyebrows, no gradient text, revised copy, and a parts list on `/project`.
|
or eyebrows, no gradient text, revised copy, and a parts list on `/project`.
|
||||||
|
|
||||||
|
All sections now share one horizontal grid (`--pad`/`--maxw` in
|
||||||
|
`global.css`), the index hero title is 75% of its old size, and footer
|
||||||
|
"Back to top" scrolls smoothly (reduced-motion users still jump instantly).
|
||||||
|
See `memories/hero-grid-scroll-2026-11-01.md`.
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
# Hero scale, shared horizontal grid, smooth back-to-top
|
||||||
|
|
||||||
|
Date: 2026-11-01
|
||||||
|
|
||||||
|
## Request
|
||||||
|
|
||||||
|
1. Index hero heading was too big → scale to 75% (confirmed with the user;
|
||||||
|
"0.75%" was shorthand for 0.75×).
|
||||||
|
2. Every section (header, hero, modules, footer, devices) must share the same
|
||||||
|
left/right section padding and centering margins so content edges align on
|
||||||
|
the same vertical lines.
|
||||||
|
3. Footer "Back to top" (`#top`) must scroll smoothly.
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- `src/styles/global.css`
|
||||||
|
- Added shared layout tokens: `--pad:clamp(18px,4vw,52px)` and
|
||||||
|
`--maxw:1100px`.
|
||||||
|
- `.hdr`, `.hero`, `.module`, `.ft` now all use `var(--pad)`;
|
||||||
|
`.hdr-in`, `.hero-wrap`, `.wrap` all use `max-width:var(--maxw)`.
|
||||||
|
- `.htitle` is now `clamp(40.5px,9.75vw,138px)` — exactly 75% of the old
|
||||||
|
`clamp(54px,13vw,184px)`.
|
||||||
|
- `@media (prefers-reduced-motion:no-preference){html{scroll-behavior:smooth}}`.
|
||||||
|
The existing reduced-motion block still disables animation/transitions;
|
||||||
|
smooth scrolling is opt-in only, so reduced-motion users jump instantly.
|
||||||
|
- `src/components/Header.astro`
|
||||||
|
- Header contents wrapped in `.hdr-in` so the bar background stays full-bleed
|
||||||
|
while the logo/nav align to the shared content column.
|
||||||
|
- `src/pages/devices.astro`
|
||||||
|
- `.dv-wrap` no longer overrides to 1080px + 24px padding; it now uses the
|
||||||
|
shared `--maxw` with no extra padding.
|
||||||
|
|
||||||
|
## Verified (headless Chromium via CDP)
|
||||||
|
|
||||||
|
- At 1427, 1200, 1024, 800, 390 and 320px, on `/`, `/project/` and `/devices/`:
|
||||||
|
every `.hdr-in`, `.hero-wrap` and `.wrap` has an identical left and right
|
||||||
|
edge (e.g. 163.5/1263.5 at 1427px, 18/302 at 320px). No horizontal overflow.
|
||||||
|
- `.htitle` computed `138px` at 1427 (was 184px) and `117px` at 1200
|
||||||
|
(was 156px); `40.5px` at 320/390 (was 54px).
|
||||||
|
- smooth scroll: `scrollBehavior: smooth`; clicking the footer `#top` link at
|
||||||
|
the bottom (scrollY 3373) animates to 0 over ~900ms.
|
||||||
|
- `npm run build` passes (5 routes).
|
||||||
|
- Header still fits at 320/390 (no content overflow).
|
||||||
|
|
||||||
|
## Notes / interpretation
|
||||||
|
|
||||||
|
- Only section-level gutters and content columns were unified. Deliberate inner
|
||||||
|
indents stay: the path spine's 84px content offset and the second "door"
|
||||||
|
column's 44px inner padding.
|
||||||
|
- Verification scripts are in `/tmp/opencode` and are not committed.
|
||||||
@@ -8,12 +8,14 @@ const here = (p) => path === p || path.startsWith(p + '/');
|
|||||||
---
|
---
|
||||||
|
|
||||||
<header class="hdr">
|
<header class="hdr">
|
||||||
<div class="mk" aria-hidden="true"><Mark name="head" /></div>
|
<div class="hdr-in">
|
||||||
<a class="word" href={homeHref}>Peacock<span class="os">// OS</span></a>
|
<div class="mk" aria-hidden="true"><Mark name="head" /></div>
|
||||||
<nav>
|
<a class="word" href={homeHref}>Peacock<span class="os">// OS</span></a>
|
||||||
<a class="nav-project" href="/project" aria-current={here('/project') ? 'page' : undefined}>The Project</a>
|
<nav>
|
||||||
<a href="https://wiki.peacockos.org">Wiki</a>
|
<a class="nav-project" href="/project" aria-current={here('/project') ? 'page' : undefined}>The Project</a>
|
||||||
<a href="https://forum.peacockos.org">Community</a>
|
<a href="https://wiki.peacockos.org">Wiki</a>
|
||||||
<a class="cta" href="https://github.com/orgs/PeacockProject/" target="_blank" rel="noopener">GitHub</a>
|
<a href="https://forum.peacockos.org">Community</a>
|
||||||
</nav>
|
<a class="cta" href="https://github.com/orgs/PeacockProject/" target="_blank" rel="noopener">GitHub</a>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
</header>
|
</header>
|
||||||
@@ -76,7 +76,7 @@ const groups = [...byBrand.keys()]
|
|||||||
Open a device for the full compatibility notes on the <a class="txt-link" href="https://wiki.peacockos.org/devices">wiki</a>.</p></div>
|
Open a device for the full compatibility notes on the <a class="txt-link" href="https://wiki.peacockos.org/devices">wiki</a>.</p></div>
|
||||||
|
|
||||||
<style is:global>
|
<style is:global>
|
||||||
.dv-wrap{max-width:1080px;margin:0 auto;padding:0 24px}
|
.dv-wrap{max-width:var(--maxw);margin:0 auto;padding:0}
|
||||||
.dv-brand h3{font-family:var(--serif,'Instrument Serif',serif);font-size:26px;color:var(--ink2);border-bottom:1px solid rgba(255,255,255,.08);padding-bottom:8px;margin:44px 0 0}
|
.dv-brand h3{font-family:var(--serif,'Instrument Serif',serif);font-size:26px;color:var(--ink2);border-bottom:1px solid rgba(255,255,255,.08);padding-bottom:8px;margin:44px 0 0}
|
||||||
.dev-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:20px;margin-top:22px}
|
.dev-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:20px;margin-top:22px}
|
||||||
.dev-card{display:block;border:1px solid rgba(255,255,255,.08);border-radius:3px;overflow:hidden;background:rgba(255,255,255,.02);text-decoration:none;color:inherit;transition:border-color .2s,transform .2s}
|
.dev-card{display:block;border:1px solid rgba(255,255,255,.08);border-radius:3px;overflow:hidden;background:rgba(255,255,255,.02);text-decoration:none;color:inherit;transition:border-color .2s,transform .2s}
|
||||||
|
|||||||
+15
-8
@@ -10,6 +10,8 @@
|
|||||||
--teal:#2BD4C4; --blue:#3BA0F0; --violet:#8E7BF0;
|
--teal:#2BD4C4; --blue:#3BA0F0; --violet:#8E7BF0;
|
||||||
--irid:linear-gradient(120deg,#2BD4C4,#3BA0F0 48%,#8E7BF0);
|
--irid:linear-gradient(120deg,#2BD4C4,#3BA0F0 48%,#8E7BF0);
|
||||||
--serif:'Instrument Serif',serif; --sans:'Hanken Grotesk',sans-serif; --mono:'Space Mono',monospace;
|
--serif:'Instrument Serif',serif; --sans:'Hanken Grotesk',sans-serif; --mono:'Space Mono',monospace;
|
||||||
|
/* one horizontal grid for the whole site: same gutter and same content width */
|
||||||
|
--pad:clamp(18px,4vw,52px); --maxw:1100px;
|
||||||
}
|
}
|
||||||
*{box-sizing:border-box}
|
*{box-sizing:border-box}
|
||||||
html,body{margin:0;background:var(--bg);color:var(--ink);}
|
html,body{margin:0;background:var(--bg);color:var(--ink);}
|
||||||
@@ -33,9 +35,11 @@
|
|||||||
.page{position:relative;z-index:2;}
|
.page{position:relative;z-index:2;}
|
||||||
|
|
||||||
/* ---- top bar ---- */
|
/* ---- top bar ---- */
|
||||||
.hdr{position:fixed;top:0;left:0;right:0;z-index:40;height:64px;display:flex;align-items:center;gap:14px;
|
.hdr{position:fixed;top:0;left:0;right:0;z-index:40;height:64px;
|
||||||
padding:0 clamp(18px,4vw,52px);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
|
padding:0 var(--pad);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
|
||||||
background:rgba(7,11,16,.82);border-bottom:1px solid var(--line);}
|
background:rgba(7,11,16,.82);border-bottom:1px solid var(--line);}
|
||||||
|
.hdr-in{width:100%;max-width:var(--maxw);height:100%;margin:0 auto;
|
||||||
|
display:flex;align-items:center;gap:14px;}
|
||||||
.hdr .mk{width:30px;height:34px;flex:0 0 30px;}
|
.hdr .mk{width:30px;height:34px;flex:0 0 30px;}
|
||||||
.hdr .mk svg{width:100%;height:100%;overflow:visible;}
|
.hdr .mk svg{width:100%;height:100%;overflow:visible;}
|
||||||
.hdr .mk svg path{fill:url(#irid)!important;}
|
.hdr .mk svg path{fill:url(#irid)!important;}
|
||||||
@@ -50,7 +54,7 @@
|
|||||||
.hdr nav .cta:hover{color:var(--bg);background:#fff;border-color:#fff;}
|
.hdr nav .cta:hover{color:var(--bg);background:#fff;border-color:#fff;}
|
||||||
|
|
||||||
/* ---- hero ---- */
|
/* ---- hero ---- */
|
||||||
.hero{position:relative;min-height:100svh;display:flex;align-items:center;padding:0 clamp(18px,4vw,52px);overflow:hidden;}
|
.hero{position:relative;min-height:100svh;display:flex;align-items:center;padding:0 var(--pad);overflow:hidden;}
|
||||||
/* fade the peacock into the canvas at the bottom so it dissolves, not slices */
|
/* fade the peacock into the canvas at the bottom so it dissolves, not slices */
|
||||||
.hero::after{content:"";position:absolute;left:0;right:0;bottom:0;height:34%;z-index:2;pointer-events:none;
|
.hero::after{content:"";position:absolute;left:0;right:0;bottom:0;height:34%;z-index:2;pointer-events:none;
|
||||||
background:linear-gradient(to bottom, transparent, var(--bg) 92%);}
|
background:linear-gradient(to bottom, transparent, var(--bg) 92%);}
|
||||||
@@ -60,8 +64,8 @@
|
|||||||
.hero-peacock svg{width:100%;height:100%;overflow:visible;}
|
.hero-peacock svg{width:100%;height:100%;overflow:visible;}
|
||||||
.hero-peacock svg path{fill:url(#irid)!important;}
|
.hero-peacock svg path{fill:url(#irid)!important;}
|
||||||
|
|
||||||
.hero-wrap{position:relative;z-index:3;max-width:1240px;margin:0 auto;width:100%;}
|
.hero-wrap{position:relative;z-index:3;max-width:var(--maxw);margin:0 auto;width:100%;}
|
||||||
.htitle{font-family:var(--serif);font-size:clamp(54px,13vw,184px);line-height:.82;letter-spacing:-.015em;margin:0;}
|
.htitle{font-family:var(--serif);font-size:clamp(40.5px,9.75vw,138px);line-height:.82;letter-spacing:-.015em;margin:0;}
|
||||||
.lead{margin:30px 0 0;max-width:38ch;font-size:clamp(16px,1.5vw,19px);line-height:1.55;color:var(--ink2);}
|
.lead{margin:30px 0 0;max-width:38ch;font-size:clamp(16px,1.5vw,19px);line-height:1.55;color:var(--ink2);}
|
||||||
.status{margin:20px 0 0;max-width:46ch;font-size:14.5px;line-height:1.65;color:var(--soft);}
|
.status{margin:20px 0 0;max-width:46ch;font-size:14.5px;line-height:1.65;color:var(--soft);}
|
||||||
.actions{margin-top:34px;display:flex;gap:12px;flex-wrap:wrap;}
|
.actions{margin-top:34px;display:flex;gap:12px;flex-wrap:wrap;}
|
||||||
@@ -78,8 +82,8 @@
|
|||||||
.btn:focus-visible{outline:2px solid var(--teal);outline-offset:3px;}
|
.btn:focus-visible{outline:2px solid var(--teal);outline-offset:3px;}
|
||||||
|
|
||||||
/* ---- sections ---- */
|
/* ---- sections ---- */
|
||||||
.module{position:relative;padding:clamp(80px,14vh,160px) clamp(18px,4vw,52px);}
|
.module{position:relative;padding:clamp(80px,14vh,160px) var(--pad);}
|
||||||
.wrap{max-width:1100px;margin:0 auto;}
|
.wrap{max-width:var(--maxw);margin:0 auto;}
|
||||||
.module h1,.module h2{font-family:var(--serif);font-size:clamp(38px,6vw,76px);line-height:.98;letter-spacing:-.01em;margin:0;}
|
.module h1,.module h2{font-family:var(--serif);font-size:clamp(38px,6vw,76px);line-height:.98;letter-spacing:-.01em;margin:0;}
|
||||||
.stmt p{margin:26px 0 0;max-width:54ch;font-size:clamp(16px,1.6vw,20px);line-height:1.6;color:var(--ink2);}
|
.stmt p{margin:26px 0 0;max-width:54ch;font-size:clamp(16px,1.6vw,20px);line-height:1.6;color:var(--ink2);}
|
||||||
.page-head{padding-top:clamp(110px,16vh,170px);}
|
.page-head{padding-top:clamp(110px,16vh,170px);}
|
||||||
@@ -115,7 +119,7 @@
|
|||||||
.door:hover h3{color:var(--teal);}
|
.door:hover h3{color:var(--teal);}
|
||||||
.door:hover .go{color:var(--teal);border-color:var(--teal);}
|
.door:hover .go{color:var(--teal);border-color:var(--teal);}
|
||||||
|
|
||||||
.ft{border-top:1px solid var(--line);padding:clamp(56px,9vh,100px) clamp(18px,4vw,52px) 46px;}
|
.ft{border-top:1px solid var(--line);padding:clamp(56px,9vh,100px) var(--pad) 46px;}
|
||||||
.ft .roller{font-family:var(--serif);font-size:clamp(46px,11vw,128px);line-height:.9;letter-spacing:-.01em;}
|
.ft .roller{font-family:var(--serif);font-size:clamp(46px,11vw,128px);line-height:.9;letter-spacing:-.01em;}
|
||||||
.ft .roller .b{font-style:italic;color:var(--ink2);}
|
.ft .roller .b{font-style:italic;color:var(--ink2);}
|
||||||
.ft .frow{margin-top:30px;display:flex;flex-wrap:wrap;align-items:center;gap:18px;font-size:13px;color:var(--soft);}
|
.ft .frow{margin-top:30px;display:flex;flex-wrap:wrap;align-items:center;gap:18px;font-size:13px;color:var(--soft);}
|
||||||
@@ -159,3 +163,6 @@
|
|||||||
*{animation:none!important;transition:none!important}
|
*{animation:none!important;transition:none!important}
|
||||||
.reveal{opacity:1;transform:none;}
|
.reveal{opacity:1;transform:none;}
|
||||||
}
|
}
|
||||||
|
@media (prefers-reduced-motion:no-preference){
|
||||||
|
html{scroll-behavior:smooth;}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user