Skip to content

Commit dc304d3

Browse files
committed
refactor(epoch1000): enhance card layout and improve metadata descriptions
1 parent 2e5b0f0 commit dc304d3

2 files changed

Lines changed: 89 additions & 32 deletions

File tree

apps/web/src/app/[locale]/epoch1000/card/page.tsx

Lines changed: 68 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { Metadata } from "next";
2-
import Link from "next/link";
2+
import { Link } from "@workspace/i18n/routing";
3+
import Reveal from "@/components/epoch1000/Reveal";
34
import { tierFor } from "@/lib/epoch1000/tiers";
45

56
interface Props {
@@ -25,9 +26,10 @@ export async function generateMetadata({
2526
const sp = await searchParams;
2627
const survived = first(sp.s) || "0";
2728
const capped = first(sp.x) === "1";
29+
const firstEpoch = first(sp.fe);
2830
const tier = tierFor(parseInt(survived, 10) || 0);
29-
const title = `Epoch 1000 survivor card - ${tier.name}`;
30-
const description = `Survived ${survived}${capped ? "+" : ""} Solana epochs. First seen in epoch ${first(sp.fe) || "?"}.`;
31+
const title = `Epoch 1000 Survivor Card — ${tier.name}`;
32+
const description = `Survived ${survived}${capped ? "+" : ""} of Solana's first 1,000 epochs${firstEpoch ? ` — on chain since epoch ${firstEpoch}` : ""}. ${tier.line}`;
3133
const image = `/api/epoch1000/og?${ogQuery(sp)}`;
3234
return {
3335
title,
@@ -49,34 +51,76 @@ export async function generateMetadata({
4951
export default async function CardPage({ searchParams }: Props) {
5052
const sp = await searchParams;
5153
const query = ogQuery(sp);
52-
const survived = parseInt(first(sp.s), 10) || 0;
54+
const survived = Math.max(0, parseInt(first(sp.s), 10) || 0);
5355
const capped = first(sp.x) === "1";
56+
const firstEpoch = first(sp.fe);
57+
const wallet = first(sp.w);
5458
const tier = tierFor(survived);
59+
const survivedLabel = `${survived}${capped ? "+" : ""}`;
5560

5661
return (
57-
<main className="w-full max-w-3xl mx-auto px-5 sm:px-8 py-10 sm:py-16 flex flex-col gap-8 min-h-screen">
58-
<h1 className="font-bold tracking-tight text-xl sm:text-2xl">
59-
<span style={{ color: tier.color }}>{tier.name}</span> · survived{" "}
60-
{survived}
61-
{capped ? "+" : ""} epochs
62-
</h1>
62+
<main className="w-full max-w-3xl mx-auto px-5 sm:px-8 py-12 sm:py-20 flex flex-col items-center text-center gap-8 sm:gap-10 min-h-screen">
63+
<header className="flex flex-col items-center gap-4 sm:gap-5">
64+
<p className="font-brand-mono text-xs sm:text-sm tracking-[0.2em] text-ep-dust uppercase">
65+
Solana mainnet · Epoch 1000
66+
</p>
67+
<h1
68+
className="font-black tracking-tight text-4xl sm:text-6xl leading-none"
69+
style={{ color: tier.color }}
70+
>
71+
{tier.name}
72+
</h1>
73+
<p className="text-sm sm:text-base text-ep-dim max-w-xl">
74+
{wallet ? (
75+
<span className="font-mono text-ep-ink">{wallet}</span>
76+
) : (
77+
"This wallet"
78+
)}{" "}
79+
survived{" "}
80+
<span className="font-semibold text-ep-ink">{survivedLabel}</span> of
81+
Solana&apos;s first 1,000 epochs
82+
{firstEpoch ? ` — on chain since epoch ${firstEpoch}` : ""}.
83+
</p>
84+
</header>
6385

64-
<img
65-
src={`/api/epoch1000/og?${query}`}
66-
alt={`Survivor card: ${tier.name}, survived ${survived} epochs on Solana`}
67-
className="w-full rounded-lg border border-ep-edge"
68-
width={1200}
69-
height={630}
70-
/>
86+
<Reveal className="w-full">
87+
<img
88+
src={`/api/epoch1000/og?${query}`}
89+
alt={`Survivor card: ${tier.name}, survived ${survivedLabel} of Solana's first 1,000 epochs`}
90+
className="w-full rounded-xl border border-ep-edge"
91+
style={{ boxShadow: `0 20px 100px -30px ${tier.color}66` }}
92+
width={1200}
93+
height={630}
94+
/>
95+
</Reveal>
7196

72-
<p className="text-sm text-ep-dim">{tier.line}</p>
97+
<Reveal className="flex flex-col items-center gap-6 sm:gap-8">
98+
<p className="text-sm text-ep-dim max-w-xl">
99+
An epoch is roughly two days of uninterrupted Solana blocks — epoch
100+
1000 marks over six years of mainnet without missing a beat. Every
101+
survivor card shows how much of that history a wallet lived through.
102+
</p>
73103

74-
<Link
75-
href="/epoch1000#checker"
76-
className="self-start bg-ep-ink text-ep-void font-semibold rounded-full px-7 py-3 text-sm hover:bg-ep-dim transition"
77-
>
78-
Check your own wallet
79-
</Link>
104+
<div className="flex flex-col items-center gap-3">
105+
<div className="flex flex-wrap justify-center gap-3">
106+
<Link
107+
href="/epoch1000#checker"
108+
className="bg-ep-ink text-ep-void font-semibold rounded-full px-7 py-3 text-sm hover:bg-ep-dim transition-colors duration-200"
109+
>
110+
Check your wallet
111+
</Link>
112+
<Link
113+
href="/epoch1000"
114+
className="border border-ep-edge rounded-full px-7 py-3 text-sm text-ep-dim hover:text-ep-ink transition-colors duration-200"
115+
>
116+
Explore the celebration
117+
</Link>
118+
</div>
119+
<p className="text-xs text-ep-dust">
120+
No connect. No signature. Just paste an address.
121+
</p>
122+
</div>
123+
</Reveal>
80124
</main>
81125
);
82126
}

apps/web/src/app/api/epoch1000/og/route.tsx

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export async function GET(req: Request) {
107107
flexDirection: "column",
108108
backgroundColor: "#000000",
109109
backgroundImage: `radial-gradient(ellipse 900px 500px at 85% -10%, ${tier.glow}55, transparent 70%)`,
110-
padding: "56px 64px",
110+
padding: "46px 64px",
111111
fontFamily: "DSemi",
112112
color: "#FFFFFF",
113113
boxSizing: "border-box",
@@ -147,7 +147,7 @@ export async function GET(req: Request) {
147147
style={{
148148
display: "flex",
149149
flexDirection: "column",
150-
marginTop: 58,
150+
marginTop: 34,
151151
}}
152152
>
153153
<div
@@ -190,7 +190,7 @@ export async function GET(req: Request) {
190190
color: "#FFFFFF",
191191
}}
192192
>
193-
EPOCHS
193+
EPOCHS SURVIVED
194194
</span>
195195
<span
196196
style={{
@@ -200,7 +200,7 @@ export async function GET(req: Request) {
200200
letterSpacing: "0.14em",
201201
}}
202202
>
203-
SURVIVED
203+
OF THE FIRST 1000
204204
</span>
205205
</div>
206206
</div>
@@ -210,12 +210,23 @@ export async function GET(req: Request) {
210210
fontSize: 26,
211211
color: "#B0B0B0",
212212
gap: 10,
213-
marginTop: 16,
213+
marginTop: 12,
214214
}}
215215
>
216216
<span style={{ color: "#757575" }}>First seen</span>
217217
<span style={{ fontWeight: 600 }}>{firstSeenLabel}</span>
218218
</div>
219+
<div
220+
style={{
221+
display: "flex",
222+
marginTop: 10,
223+
fontSize: 27,
224+
fontWeight: 600,
225+
color: tier.color,
226+
}}
227+
>
228+
{`"${tier.line}"`}
229+
</div>
219230
</div>
220231

221232
{/* thousand grid - github-contributions strip of square cells */}
@@ -225,7 +236,7 @@ export async function GET(req: Request) {
225236
justifyContent: "space-between",
226237
alignItems: "center",
227238
width: 1046,
228-
marginTop: 62,
239+
marginTop: 34,
229240
fontSize: 21,
230241
}}
231242
>
@@ -306,8 +317,10 @@ export async function GET(req: Request) {
306317
>
307318
{wallet || "Anonymous survivor"}
308319
</div>
309-
<div style={{ display: "flex", color: "#757575" }}>
310-
solana.com/epoch1000
320+
<div style={{ display: "flex", gap: 10, color: "#757575" }}>
321+
<span style={{ color: "#FFFFFF", fontWeight: 600 }}>Check yours</span>
322+
<span>·</span>
323+
<span>solana.com/epoch1000</span>
311324
</div>
312325
</div>
313326
</div>,

0 commit comments

Comments
 (0)