Skip to content

Commit d3e8d66

Browse files
nmndwivediclaude
andcommitted
Site: responsive hero — stacked full-width CTAs and single-line install chip on mobile
The mobile hero was ragged: the two CTAs sat at different widths, the npm install chip wrapped to two lines with an orphaned arrow, and the type scale was tuned for desktop. - Below 460px the CTAs stack full-bleed; above that they stay inline. - The install chip is full-width and single-line on phones, switching to `npm i` under 400px so it never wraps. - Tighter hero type/spacing under 640px; board height now viewport-relative. - Same CTA stacking on the keyword landing pages for consistency. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent fed9587 commit d3e8d66

2 files changed

Lines changed: 50 additions & 4 deletions

File tree

‎apps/website/src/layouts/Landing.astro‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,17 @@ const { title, description, jsonLd = null } = Astro.props
3333
.landing .fine-print { font-size: 13px; color: var(--ink-soft); margin-top: 12px; }
3434
.landing .more-links { color: var(--ink-soft); font-size: 15px; margin-top: 14px; }
3535
.landing pre { margin: 0; }
36+
37+
@media (max-width: 640px) {
38+
.landing section { margin-top: 56px; }
39+
.landing .page-head { margin-top: 30px; }
40+
.landing h1 { font-size: clamp(29px, 8.4vw, 38px); line-height: 1.14; }
41+
.landing .lede { font-size: 16px; margin-bottom: 24px; }
42+
}
43+
/* Same as the home hero: below ~460px the buttons stack full-bleed
44+
instead of wrapping to ragged widths. */
45+
@media (max-width: 460px) {
46+
.landing .actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
47+
.landing .btn { padding: 13px 20px; text-align: center; font-size: 16px; }
48+
}
3649
</style>

‎apps/website/src/pages/index.astro‎

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const jsonLd = {
8787
</div>
8888
<a class="install" href="https://www.npmjs.com/package/@quickdrawjs/react" rel="noopener" title="View @quickdrawjs/react on npm">
8989
<span class="npm-mark" aria-hidden="true">npm</span>
90-
<span class="install-cmd"><span class="prompt">$</span> npm install @quickdrawjs/react</span>
90+
<span class="install-cmd"><span class="prompt">$</span> <span class="cmd-long">npm install @quickdrawjs/react</span><span class="cmd-short">npm i @quickdrawjs/react</span></span>
9191
<span class="install-go" aria-hidden="true">→</span>
9292
</a>
9393
</div>
@@ -338,7 +338,8 @@ createQuickdraw({
338338
}
339339
.install:hover { text-decoration: none; border-color: var(--ink-soft); background: #fff; }
340340
.install:hover .install-go { transform: translateX(3px); color: var(--accent-ink); }
341-
.install-cmd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
341+
.install-cmd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
342+
.cmd-short { display: none; }
342343
.install .prompt { color: var(--accent); user-select: none; margin-right: 6px; }
343344
.install-go { transition: transform 140ms ease; color: var(--ink-soft); }
344345
.npm-mark {
@@ -435,8 +436,40 @@ createQuickdraw({
435436
.cta-final .actions { justify-content: center; }
436437

437438
@media (max-width: 880px) {
438-
.hero { grid-template-columns: 1fr; gap: 32px; }
439+
.hero { grid-template-columns: 1fr; gap: 34px; margin-top: 46px; }
439440
#hero-board { height: 380px; }
440-
h1 { font-size: clamp(32px, 9vw, 42px); }
441+
h1 { font-size: clamp(32px, 6.2vw, 44px); }
442+
.lede { max-width: 52ch; }
443+
}
444+
445+
@media (max-width: 640px) {
446+
section { margin-top: 68px; }
447+
.hero { margin-top: 30px; gap: 26px; }
448+
.eyebrow { font-size: 11.5px; letter-spacing: 0.09em; margin: 0 0 12px; }
449+
h1 { font-size: clamp(29px, 8.4vw, 38px); line-height: 1.14; margin-bottom: 14px; }
450+
.scribble { background-size: 100% 7px; padding-bottom: 6px; }
451+
.lede { font-size: 16px; max-width: none; margin-bottom: 24px; }
452+
.install { margin-top: 20px; }
453+
#hero-board { height: clamp(300px, 52vh, 400px); }
454+
.board-hint { margin-top: 10px; }
455+
.support-card { padding: 42px 22px 40px; }
456+
}
457+
458+
/* Below ~460px the two buttons no longer sit side by side without
459+
wrapping to ragged widths — stack them full-bleed instead. */
460+
@media (max-width: 460px) {
461+
.actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
462+
.btn { padding: 13px 20px; text-align: center; font-size: 16px; }
463+
.btn.github { justify-content: center; }
464+
.install {
465+
display: flex; width: 100%;
466+
padding: 11px 13px; gap: 10px; font-size: 12.5px;
467+
}
468+
.install-go { margin-left: auto; }
469+
}
470+
471+
@media (max-width: 400px) {
472+
.cmd-long { display: none; }
473+
.cmd-short { display: inline; }
441474
}
442475
</style>

0 commit comments

Comments
 (0)