Skip to content

Commit fb44752

Browse files
committed
fix(landing): stop hero code window widening the page on mobile; tighten navbar
The hero section is a flex column, so its content wrapper had min-width:auto and inherited the longest unbreakable line of the code window's <pre> (~384px) — the whole page laid out wider than the viewport and looked shifted/clipped on phones. Add min-w-0/w-full on the wrapper and code window, clip the card, keep the <pre> scrolling, html{overflow-x:clip}. Headline 2.5rem on <640px. Navbar: nowrap CTAs, tighter gaps/padding on small screens so "Log in / Get Started" stay on one row at 360px. Visible hero snippet now shows the real X-API-Key header and API base URL.
1 parent da810ed commit fb44752

4 files changed

Lines changed: 21 additions & 19 deletions

File tree

frontend/src/app/globals.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
}
4444

4545
html {
46+
overflow-x: clip; /* mobile browsers ignore body-only overflow-x; never let a wide element widen the viewport */
4647
scroll-behavior: smooth;
4748
-webkit-font-smoothing: antialiased;
4849
-moz-osx-font-smoothing: grayscale;

frontend/src/components/CodeWindow.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { useState } from 'react';
55
export default function CodeWindow() {
66
const [copied, setCopied] = useState(false);
77

8-
const codeString = `curl -X POST ${process.env.NEXT_PUBLIC_API_URL || 'https://api.qiflow.io'}/v1/payments \\
8+
const apiBase = process.env.NEXT_PUBLIC_API_URL || 'https://api.qiflow.io';
9+
const codeString = `curl -X POST ${apiBase}/v1/payments \\
910
-H "X-API-Key: qiflow_live_9a8f..." \\
1011
-H "Content-Type: application/json" \\
1112
-d '{
@@ -21,15 +22,15 @@ export default function CodeWindow() {
2122
};
2223

2324
return (
24-
<div className="w-full max-w-3xl mx-auto group perspective-1000">
25-
<div className="relative rounded-2xl bg-[#141033] border border-violet/40 p-4 sm:p-6 shadow-card-lg backdrop-blur-xl transform sm:rotate-x-3 group-hover:rotate-x-0 group-hover:border-violet/70 group-hover:shadow-glow-violet transition-all duration-500 ease-out">
25+
<div className="w-full min-w-0 max-w-3xl mx-auto group perspective-1000">
26+
<div className="relative min-w-0 overflow-hidden rounded-2xl bg-[#141033] border border-violet/40 p-4 sm:p-6 shadow-card-lg backdrop-blur-xl transform sm:rotate-x-3 group-hover:rotate-x-0 group-hover:border-violet/70 group-hover:shadow-glow-violet transition-all duration-500 ease-out">
2627
{/* macOS Dots Header */}
27-
<div className="flex items-center justify-between border-b border-violet/20 pb-3 mb-4">
28-
<div className="flex items-center gap-2">
28+
<div className="flex flex-wrap items-center justify-between gap-2 border-b border-violet/20 pb-3 mb-4">
29+
<div className="flex items-center gap-2 min-w-0">
2930
<span className="w-3 h-3 rounded-full bg-rose-500 inline-block" />
3031
<span className="w-3 h-3 rounded-full bg-amber-500 inline-block" />
3132
<span className="w-3 h-3 rounded-full bg-emerald-500 inline-block" />
32-
<span className="ml-3 text-xs text-slate-400 font-mono">bash — POST /v1/payments</span>
33+
<span className="ml-3 text-xs text-slate-400 font-mono truncate">bash — POST /v1/payments</span>
3334
</div>
3435
<button
3536
onClick={copyToClipboard}
@@ -56,13 +57,13 @@ export default function CodeWindow() {
5657
</div>
5758

5859
{/* Syntax-Highlighted Code Body */}
59-
<pre className="font-mono text-xs sm:text-sm text-left overflow-x-auto leading-relaxed p-2">
60+
<pre className="font-mono text-xs sm:text-sm text-left overflow-x-auto max-w-full leading-relaxed p-2 [-webkit-overflow-scrolling:touch]">
6061
<code>
6162
<span className="text-mint font-semibold">curl</span>{' '}
6263
<span className="text-blue-400 font-medium">-X POST</span>{' '}
63-
<span className="text-[#D4C7FC]">https://api.qiflow.io/v1/payments</span>{' '}\{'\n'}
64+
<span className="text-[#D4C7FC]">{apiBase}/v1/payments</span>{' '}\{'\n'}
6465
{' '}<span className="text-blue-400 font-medium">-H</span>{' '}
65-
<span className="text-[#D4C7FC]">&quot;Authorization: Bearer qiflow_sec_9a8f...&quot;</span>{' '}\{'\n'}
66+
<span className="text-[#D4C7FC]">&quot;X-API-Key: qiflow_live_9a8f...&quot;</span>{' '}\{'\n'}
6667
{' '}<span className="text-blue-400 font-medium">-H</span>{' '}
6768
<span className="text-[#D4C7FC]">&quot;Content-Type: application/json&quot;</span>{' '}\{'\n'}
6869
{' '}<span className="text-blue-400 font-medium">-d</span>{' '}

frontend/src/components/Navbar.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ export default function Navbar() {
2222
: 'bg-ink/40 backdrop-blur-xl border-b border-violet/5 py-5'
2323
}`}
2424
>
25-
<div className="max-w-7xl mx-auto px-6 flex items-center justify-between">
25+
<div className="max-w-7xl mx-auto px-4 sm:px-6 flex items-center justify-between gap-3">
2626
{/* Logo */}
27-
<Link href="/" className="flex items-center gap-3 group">
28-
<div className="w-10 h-10 rounded-full border-2 border-violet flex items-center justify-center shadow-glow-violet group-hover:scale-105 transition-transform bg-indigo/40">
27+
<Link href="/" className="flex items-center gap-2.5 sm:gap-3 group shrink-0">
28+
<div className="w-9 h-9 sm:w-10 sm:h-10 rounded-full border-2 border-violet flex items-center justify-center shadow-glow-violet group-hover:scale-105 transition-transform bg-indigo/40">
2929
{/* Mint Upward Triangle Arrow */}
3030
<svg
3131
className="w-4 h-4 text-mint transform group-hover:-translate-y-0.5 transition-transform"
@@ -35,7 +35,7 @@ export default function Navbar() {
3535
<polygon points="12,4 22,20 2,20" />
3636
</svg>
3737
</div>
38-
<span className="text-xl font-bold tracking-tight text-white font-sans">
38+
<span className="text-lg sm:text-xl font-bold tracking-tight text-white font-sans whitespace-nowrap">
3939
Qi<span className="text-mint">Flow</span>
4040
</span>
4141
</Link>
@@ -60,16 +60,16 @@ export default function Navbar() {
6060
</nav>
6161

6262
{/* Action CTAs */}
63-
<div className="flex items-center gap-4">
63+
<div className="flex items-center gap-2 sm:gap-4 shrink-0">
6464
<Link
6565
href="/auth/login"
66-
className="md:hidden text-sm text-[#A5A3B8] hover:text-white font-medium transition-colors px-2 py-1"
66+
className="md:hidden text-sm text-[#A5A3B8] hover:text-white font-medium transition-colors px-2 py-1 whitespace-nowrap"
6767
>
6868
Log in
6969
</Link>
7070
<Link
7171
href="/auth/register"
72-
className="bg-mint text-ink font-semibold text-sm px-5 py-2.5 rounded-xl shadow-glow-mint hover:bg-[#26eed2] hover:scale-[1.02] active:scale-[0.98] transition-all"
72+
className="bg-mint text-ink font-semibold text-sm px-4 sm:px-5 py-2.5 rounded-xl shadow-glow-mint hover:bg-[#26eed2] hover:scale-[1.02] active:scale-[0.98] transition-all whitespace-nowrap"
7373
>
7474
Get Started
7575
</Link>

frontend/src/sections/Hero.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function Hero() {
88
<div className="absolute top-1/4 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[550px] h-[550px] bg-violet/25 rounded-full blur-[120px] pointer-events-none animate-drift" />
99
<div className="absolute top-1/3 left-1/3 w-[450px] h-[450px] bg-mint/20 rounded-full blur-[120px] pointer-events-none animate-drift-reverse" />
1010

11-
<div className="relative z-10 max-w-4xl mx-auto space-y-8">
11+
<div className="relative z-10 w-full min-w-0 max-w-4xl mx-auto space-y-8">
1212
{/* Badge Pill */}
1313
<div className="inline-flex items-center gap-2.5 px-4 py-2 rounded-full bg-indigo/90 border border-violet/40 shadow-card backdrop-blur-md">
1414
<span className="w-2.5 h-2.5 rounded-full bg-mint pulse-dot" />
@@ -18,7 +18,7 @@ export default function Hero() {
1818
</div>
1919

2020
{/* H1 Headline */}
21-
<h1 className="text-5xl sm:text-6xl md:text-7xl font-bold tracking-tight text-white leading-[1.1]">
21+
<h1 className="text-[2.5rem] sm:text-6xl md:text-7xl font-bold tracking-tight text-white leading-[1.1] text-balance">
2222
The payment gateway for{' '}
2323
<span className="bg-gradient-to-r from-mint via-[#60ffe0] to-[#80ffdb] bg-clip-text text-transparent drop-shadow">
2424
Qi
@@ -47,7 +47,7 @@ export default function Hero() {
4747
</div>
4848

4949
{/* Code Window Container */}
50-
<div className="pt-10">
50+
<div className="pt-10 w-full min-w-0">
5151
<CodeWindow />
5252
</div>
5353
</div>

0 commit comments

Comments
 (0)