Skip to content

Commit 53cc28f

Browse files
committed
feat(seo): embed mascot in OG image as circular avatar
1 parent e3979f6 commit 53cc28f

1 file changed

Lines changed: 60 additions & 24 deletions

File tree

app/opengraph-image.tsx

Lines changed: 60 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,105 @@
1+
import { readFile } from "node:fs/promises";
2+
import { join } from "node:path";
13
import { ImageResponse } from "next/og";
24

35
export const dynamic = "force-static";
46
export const size = { width: 1200, height: 630 };
57
export const contentType = "image/png";
68
export const alt = "FIRST FLUKE — Make Your First Win";
79

10+
async function loadMascotDataUrl(): Promise<string> {
11+
const buf = await readFile(
12+
join(process.cwd(), "public", "firstfluke-mascot.png"),
13+
);
14+
return `data:image/png;base64,${buf.toString("base64")}`;
15+
}
16+
817
export default async function OpengraphImage() {
18+
const mascotSrc = await loadMascotDataUrl();
19+
920
return new ImageResponse(
1021
(
1122
<div
1223
style={{
1324
width: "100%",
1425
height: "100%",
1526
display: "flex",
16-
flexDirection: "column",
17-
justifyContent: "space-between",
1827
padding: "80px",
1928
background:
20-
"linear-gradient(135deg, #0f4c3a 0%, #1a6048 50%, #7ab94c 100%)",
29+
"linear-gradient(135deg, #0f4c3a 0%, #1a6048 55%, #7ab94c 100%)",
2130
color: "#fafaf7",
2231
fontFamily: "system-ui, sans-serif",
2332
}}
2433
>
2534
<div
2635
style={{
2736
display: "flex",
28-
fontSize: 28,
29-
letterSpacing: 4,
30-
opacity: 0.85,
37+
flexDirection: "column",
38+
justifyContent: "space-between",
39+
flex: 1,
40+
paddingRight: 40,
3141
}}
3242
>
33-
FIRST FLUKE
34-
</div>
35-
<div style={{ display: "flex", flexDirection: "column", gap: 24 }}>
3643
<div
3744
style={{
38-
fontSize: 96,
39-
fontWeight: 700,
40-
lineHeight: 1.05,
41-
letterSpacing: -2,
45+
display: "flex",
46+
fontSize: 28,
47+
letterSpacing: 4,
48+
opacity: 0.85,
4249
}}
4350
>
44-
Make Your First Win
51+
FIRST FLUKE
52+
</div>
53+
<div style={{ display: "flex", flexDirection: "column", gap: 20 }}>
54+
<div
55+
style={{
56+
fontSize: 88,
57+
fontWeight: 700,
58+
lineHeight: 1.05,
59+
letterSpacing: -2,
60+
}}
61+
>
62+
Make Your First Win
63+
</div>
64+
<div style={{ fontSize: 32, opacity: 0.9, lineHeight: 1.3 }}>
65+
AI와 기술로 더 나은 일상을 만드는 팀
66+
</div>
4567
</div>
4668
<div
4769
style={{
48-
fontSize: 36,
49-
opacity: 0.9,
50-
lineHeight: 1.3,
70+
display: "flex",
71+
justifyContent: "space-between",
72+
alignItems: "flex-end",
73+
fontSize: 22,
74+
opacity: 0.85,
5175
}}
5276
>
53-
AI와 기술로 더 나은 일상을 만드는 팀
77+
<div style={{ display: "flex" }}>모두의 창업 2026 선정</div>
78+
<div style={{ display: "flex" }}>firstfluke.com</div>
5479
</div>
5580
</div>
5681
<div
5782
style={{
5883
display: "flex",
59-
justifyContent: "space-between",
60-
alignItems: "flex-end",
61-
fontSize: 24,
62-
opacity: 0.85,
84+
alignItems: "center",
85+
justifyContent: "center",
86+
width: 440,
87+
height: 440,
6388
}}
6489
>
65-
<div style={{ display: "flex" }}>모두의 창업 2026 선정</div>
66-
<div style={{ display: "flex" }}>firstfluke.com</div>
90+
{/** biome-ignore lint/performance/noImgElement: ImageResponse only supports img */}
91+
<img
92+
src={mascotSrc}
93+
alt=""
94+
width={420}
95+
height={420}
96+
style={{
97+
objectFit: "cover",
98+
borderRadius: 210,
99+
background: "#fafaf7",
100+
boxShadow: "0 24px 60px rgba(0,0,0,0.25)",
101+
}}
102+
/>
67103
</div>
68104
</div>
69105
),

0 commit comments

Comments
 (0)