Skip to content

Commit 93266b9

Browse files
committed
Tighten alignments on the home and auth pages
- Hero lines share one left edge; stats hairline is full-bleed like the other section borders; the featured article byline follows its excerpt - "Derniers arrivés" gets a real heading aligned with the discussions one - Open source band: columns aligned at the top, full clone command that wraps after slashes, flush on the footer (spacing moved to the layout) - Auth poster: one inner margin for every block, the yellow block no longer covers "code en", pillars stack below 1280px; the toaster sits outside the grid (it created an extra row and a paper strip under the panel)
1 parent 1d765ec commit 93266b9

6 files changed

Lines changed: 131 additions & 112 deletions

File tree

‎inertia/components/articles/list.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export function ArticleFeature({
8686
{article.excerpt && (
8787
<p className="mt-5 max-w-2xl text-[17.5px] leading-relaxed text-ink-2">{article.excerpt}</p>
8888
)}
89-
<Byline article={article} className="mt-auto pt-8" showStats={showStats} />
89+
<Byline article={article} className="mt-6" showStats={showStats} />
9090
</article>
9191
)
9292
}

‎inertia/components/footer.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const COLUMNS = [
3636
export default function Footer() {
3737
const year = new Date().getFullYear()
3838
return (
39-
<footer className="mt-24 border-t border-ink bg-ink text-paper sm:mt-32 dark:bg-paper-2 dark:text-ink">
39+
<footer className="border-t border-ink bg-ink text-paper dark:bg-paper-2 dark:text-ink">
4040
<div className="shell pt-16 pb-10 sm:pt-20">
4141
<div className="grid gap-12 lg:grid-cols-12">
4242
<div className="lg:col-span-5">

‎inertia/components/open-source-section.tsx‎

Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { Check, Copy } from 'lucide-react'
44
const CLONE = 'git clone https://github.com/javascriptcm/javascript.cm.git'
55

66
/**
7-
* Full-bleed JS-yellow band: the rhythm break of the home page.
7+
* Full-bleed JS-yellow band: the rhythm break of the home page. Last section
8+
* of the page, it sits flush on the footer (negative margin cancels the
9+
* layout's bottom padding).
810
*/
911
export default function OpenSourceSection() {
1012
const [copied, setCopied] = useState(false)
@@ -22,45 +24,55 @@ export default function OpenSourceSection() {
2224
return (
2325
<section
2426
aria-labelledby="open-source"
25-
className="mt-24 border-y border-ink bg-js text-js-ink sm:mt-32"
27+
className="mt-24 -mb-24 border-t border-ink bg-js text-js-ink sm:mt-32 sm:-mb-32"
2628
>
27-
<div className="shell grid grid-cols-1 gap-10 py-16 sm:py-24 lg:grid-cols-12 lg:items-end">
28-
<div className="lg:col-span-7">
29-
<p className="label text-js-ink/70">[04] — Open source</p>
29+
<div className="shell py-16 sm:py-24">
30+
<p className="label text-js-ink/70">[05] — Open source</p>
31+
<div className="mt-6 grid grid-cols-1 gap-10 lg:grid-cols-12 lg:gap-12">
3032
<h2
3133
id="open-source"
32-
className="mt-5 text-[clamp(2.6rem,7vw,6rem)] leading-[0.9] font-extrabold tracking-[-0.05em]"
34+
className="text-[clamp(2.6rem,6.4vw,5.6rem)] leading-[0.9] font-extrabold tracking-[-0.05em] lg:col-span-7"
3335
>
3436
Ce site est écrit par la communauté.
3537
</h2>
36-
</div>
37-
<div className="lg:col-span-5">
38-
<p className="text-[17.5px] leading-relaxed">
39-
AdonisJS, React, Inertia, TypeScript. Corrigez un bug, proposez une fonctionnalité,
40-
faites votre première contribution open source sur un projet que vous utilisez.
41-
</p>
42-
<div className="mt-6 flex items-stretch rounded-sm border border-js-ink bg-js-ink text-js">
43-
<code className="min-w-0 flex-1 overflow-x-auto px-4 py-3.5 font-mono text-[13px] whitespace-nowrap">
44-
<span className="select-none opacity-50">$ </span>
45-
{CLONE}
46-
</code>
47-
<button
48-
type="button"
49-
onClick={copy}
50-
aria-label="Copier la commande"
51-
className="grid w-12 shrink-0 place-items-center border-l border-js/30 transition-colors hover:bg-js hover:text-js-ink"
38+
<div className="lg:col-span-5 lg:pt-[0.4rem]">
39+
<p className="text-[17.5px] leading-relaxed">
40+
AdonisJS, React, Inertia, TypeScript. Corrigez un bug, proposez une fonctionnalité,
41+
faites votre première contribution open source sur un projet que vous utilisez.
42+
</p>
43+
<div className="mt-6 flex items-stretch rounded-sm border border-js-ink bg-js-ink text-js">
44+
<code className="min-w-0 flex-1 px-4 py-3.5 font-mono text-[13px] leading-relaxed">
45+
<span className="select-none opacity-50">$ </span>
46+
{/* Wrap after slashes only, never inside a word. */}
47+
{CLONE.split('/').map((part, i, parts) => (
48+
<span key={i}>
49+
{part}
50+
{i < parts.length - 1 && (
51+
<>
52+
/<wbr />
53+
</>
54+
)}
55+
</span>
56+
))}
57+
</code>
58+
<button
59+
type="button"
60+
onClick={copy}
61+
aria-label="Copier la commande"
62+
className="grid w-12 shrink-0 place-items-center border-l border-js/30 transition-colors hover:bg-js hover:text-js-ink"
63+
>
64+
{copied ? <Check size={16} /> : <Copy size={16} />}
65+
</button>
66+
</div>
67+
<a
68+
href="https://github.com/javascriptcm/javascript.cm"
69+
target="_blank"
70+
rel="noopener noreferrer"
71+
className="mt-6 inline-flex items-center gap-2 font-mono text-[13px] font-semibold tracking-[0.06em] uppercase"
5272
>
53-
{copied ? <Check size={16} /> : <Copy size={16} />}
54-
</button>
73+
<span className="link-draw">Voir le dépôt sur GitHub</span> ↗
74+
</a>
5575
</div>
56-
<a
57-
href="https://github.com/javascriptcm/javascript.cm"
58-
target="_blank"
59-
rel="noopener noreferrer"
60-
className="mt-6 inline-flex items-center gap-2 font-mono text-[13px] font-semibold tracking-[0.06em] uppercase"
61-
>
62-
<span className="link-draw">Voir le dépôt sur GitHub</span> ↗
63-
</a>
6476
</div>
6577
</div>
6678
</section>

‎inertia/layouts/app.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function SiteLayout({ children }: { children: ReactNode }) {
77
return (
88
<div className="flex min-h-dvh flex-col">
99
<Navbar />
10-
<main id="contenu" className="flex-1">
10+
<main id="contenu" className="flex-1 pb-24 sm:pb-32">
1111
{children}
1212
</main>
1313
<Footer />

‎inertia/layouts/auth.tsx‎

Lines changed: 58 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,63 +3,71 @@ import Logo from '~/components/logo'
33
import ThemeToggle from '~/components/theme-toggle'
44
import FlashToasts from '~/components/flash-toasts'
55

6+
const PILLARS = [
7+
['Articles', 'Écrivez, partagez, apprenez en public.'],
8+
['Forum', 'Une question ? Quelqu’un a la réponse.'],
9+
['Discussions', 'Carrière, outils, écosystème local.'],
10+
]
11+
612
/**
713
* Split layout: form on the left; on the right a dark "poster" panel.
14+
* One inner margin (px-10) for every block of the poster so all its
15+
* lines share the same left edge.
816
*/
917
export default function AuthLayout({ children }: { children: ReactNode }) {
1018
return (
11-
<div className="grid min-h-dvh lg:grid-cols-[minmax(0,1fr)_minmax(0,1.05fr)]">
12-
<div className="flex flex-col px-5 py-6 sm:px-10">
13-
<div className="flex items-center justify-between">
14-
<Logo />
15-
<ThemeToggle />
19+
<>
20+
<div className="grid min-h-dvh lg:grid-cols-[minmax(0,1fr)_minmax(0,1.05fr)]">
21+
<div className="flex flex-col px-5 py-6 sm:px-10">
22+
<div className="flex items-center justify-between">
23+
<Logo />
24+
<ThemeToggle />
25+
</div>
26+
<main
27+
id="contenu"
28+
className="mx-auto flex w-full max-w-[400px] flex-1 flex-col justify-center py-12"
29+
>
30+
{children}
31+
</main>
32+
<p className="label">© {new Date().getFullYear()} JavaScript Cameroun</p>
1633
</div>
17-
<main
18-
id="contenu"
19-
className="mx-auto flex w-full max-w-[400px] flex-1 flex-col justify-center py-12"
20-
>
21-
{children}
22-
</main>
23-
<p className="label">© {new Date().getFullYear()} JavaScript Cameroun</p>
24-
</div>
2534

26-
<aside className="relative hidden overflow-hidden border-l border-ink bg-ink text-paper lg:flex lg:flex-col lg:justify-between dark:bg-paper-2 dark:text-ink">
27-
<div className="flex items-start justify-between p-10">
28-
<p className="label text-paper/60 dark:text-muted">Fiche d’adhésion · N° 237</p>
29-
<p className="label text-paper/60 dark:text-muted">4.05° N · 9.70° E</p>
30-
</div>
31-
<div className="px-10">
32-
<p className="text-[clamp(3rem,6.4vw,6.5rem)] leading-[0.9] font-extrabold tracking-[-0.055em]">
33-
Le 237
34-
<br />
35-
<span className="font-mono text-[0.42em] font-medium tracking-[-0.02em] text-paper/70 dark:text-muted">
36-
code en
37-
</span>
38-
<br />
39-
<span className="mark-full">JavaScript.</span>
40-
</p>
41-
</div>
42-
<dl className="grid grid-cols-3 border-t border-paper/20 dark:border-line">
43-
{[
44-
['Articles', 'Écrivez, partagez, apprenez en public.'],
45-
['Forum', 'Une question ? Quelqu’un a la réponse.'],
46-
['Discussions', 'Carrière, outils, écosystème local.'],
47-
].map(([title, text], i) => (
48-
<div
49-
key={title}
50-
className="border-r border-paper/20 p-8 last:border-r-0 dark:border-line"
51-
>
52-
<dt className="label text-js dark:text-ink">
53-
0{i + 1} — {title}
54-
</dt>
55-
<dd className="mt-3 text-[15px] leading-snug text-paper/75 dark:text-ink-2">
56-
{text}
57-
</dd>
58-
</div>
59-
))}
60-
</dl>
61-
</aside>
35+
<aside className="relative hidden overflow-hidden border-l border-ink bg-ink text-paper lg:flex lg:flex-col dark:bg-paper-2 dark:text-ink">
36+
<div className="flex items-start justify-between px-10 pt-10">
37+
<p className="label text-paper/60 dark:text-muted">Fiche d’adhésion · N° 237</p>
38+
<p className="label text-paper/60 dark:text-muted">4.05° N · 9.70° E</p>
39+
</div>
40+
41+
<div className="flex flex-1 flex-col justify-center px-10 py-16">
42+
<p className="text-[clamp(3rem,6vw,6.25rem)] font-extrabold tracking-[-0.055em]">
43+
<span className="block leading-[0.9]">Le 237</span>
44+
<span className="mt-[0.35em] block font-mono text-[0.32em] leading-none font-medium tracking-[-0.02em] text-paper/70 dark:text-muted">
45+
code en
46+
</span>
47+
<span className="mt-[0.14em] -ml-[0.1em] inline-block bg-js px-[0.1em] pt-[0.02em] pb-[0.1em] leading-[0.95] text-js-ink">
48+
JavaScript.
49+
</span>
50+
</p>
51+
</div>
52+
53+
<dl className="grid grid-cols-1 border-t border-paper/20 xl:grid-cols-3 dark:border-line">
54+
{PILLARS.map(([title, text], i) => (
55+
<div
56+
key={title}
57+
className="border-t border-paper/20 px-10 py-6 first:border-t-0 xl:border-t-0 xl:border-l xl:py-8 xl:first:border-l-0 dark:border-line"
58+
>
59+
<dt className="label text-js dark:text-ink">
60+
0{i + 1} — {title}
61+
</dt>
62+
<dd className="mt-3 text-[15px] leading-snug text-paper/75 dark:text-ink-2">
63+
{text}
64+
</dd>
65+
</div>
66+
))}
67+
</dl>
68+
</aside>
69+
</div>
6270
<FlashToasts />
63-
</div>
71+
</>
6472
)
6573
}

‎inertia/pages/home.tsx‎

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default function Home({ stats, articles, threads, discussions, members }:
5959
className="text-[clamp(4rem,14vw,10rem)] leading-[0.84] font-extrabold tracking-[-0.06em] lg:col-span-9"
6060
>
6161
<span className="rise block">Le 237</span>
62-
<span className="rise rise-1 block pl-[0.08em] font-mono text-[0.3em] leading-[1.5] font-medium tracking-[-0.02em] text-ink-2 sm:pl-[1.4em]">
62+
<span className="rise rise-1 block py-[0.12em] pl-[0.12em] font-mono text-[0.3em] leading-[1.3] font-medium tracking-[-0.02em] text-ink-2">
6363
code en
6464
</span>
6565
<span className="rise rise-2 block">
@@ -98,21 +98,23 @@ export default function Home({ stats, articles, threads, discussions, members }:
9898
</div>
9999

100100
{/* Instrument readout */}
101-
<dl className="shell grid grid-cols-2 border-t border-line lg:grid-cols-4">
102-
{readings.map((reading, i) => (
103-
<div
104-
key={reading.label}
105-
className={`py-6 ${i % 2 === 1 ? 'border-l border-line pl-5 sm:pl-8' : ''} ${i >= 2 ? 'border-t border-line lg:border-t-0' : ''} ${i === 2 ? 'lg:border-l lg:pl-8' : ''}`}
106-
>
107-
<dt className="label">
108-
<span className="text-ink">{String(i + 1).padStart(2, '0')}</span> {reading.label}
109-
</dt>
110-
<dd className="mt-2 text-[clamp(2.2rem,4.5vw,3.4rem)] leading-none font-bold tracking-[-0.04em] tabular-nums">
111-
{reading.value}
112-
</dd>
113-
</div>
114-
))}
115-
</dl>
101+
<div className="border-t border-line">
102+
<dl className="shell grid grid-cols-2 lg:grid-cols-4">
103+
{readings.map((reading, i) => (
104+
<div
105+
key={reading.label}
106+
className={`py-6 ${i % 2 === 1 ? 'border-l border-line pl-5 sm:pl-8' : ''} ${i >= 2 ? 'border-t border-line lg:border-t-0' : ''} ${i === 2 ? 'lg:border-l lg:pl-8' : ''}`}
107+
>
108+
<dt className="label">
109+
<span className="text-ink">{String(i + 1).padStart(2, '0')}</span> {reading.label}
110+
</dt>
111+
<dd className="mt-2 text-[clamp(2.2rem,4.5vw,3.4rem)] leading-none font-bold tracking-[-0.04em] tabular-nums">
112+
{reading.value}
113+
</dd>
114+
</div>
115+
))}
116+
</dl>
117+
</div>
116118
</section>
117119

118120
<ArticlesSection articles={articles} />
@@ -178,11 +180,14 @@ export default function Home({ stats, articles, threads, discussions, members }:
178180
</div>
179181
</div>
180182
<aside className="lg:col-span-5" aria-labelledby="home-members">
181-
<div className="border-t border-ink pt-5">
182-
<p className="label text-ink" id="home-members">
183-
<span className="mr-2 text-muted">[—]</span>Derniers arrivés
184-
</p>
185-
<ul className="mt-6 grid grid-cols-4 gap-3 sm:grid-cols-6 lg:grid-cols-4">
183+
<SectionHeading
184+
index="04"
185+
label="Derniers arrivés"
186+
title={<span id="home-members">Bienvenue à bord.</span>}
187+
action={{ href: '/membres', label: 'L’annuaire' }}
188+
/>
189+
<div>
190+
<ul className="mt-8 grid grid-cols-4 gap-x-3 gap-y-5 sm:grid-cols-6 lg:grid-cols-4">
186191
{members.map((member) => (
187192
<li key={member.id}>
188193
<Link
@@ -202,12 +207,6 @@ export default function Home({ stats, articles, threads, discussions, members }:
202207
</li>
203208
))}
204209
</ul>
205-
<Link
206-
href="/membres"
207-
className="mt-6 inline-flex items-center gap-2 font-mono text-[13px] font-medium tracking-[0.06em] uppercase"
208-
>
209-
<span className="link-draw">L’annuaire des membres</span> →
210-
</Link>
211210
</div>
212211
</aside>
213212
</section>

0 commit comments

Comments
 (0)