返回 CodeWhale
opengraph-image.tsx
根目录 / web / app / opengraph-image.tsx
1 import { ImageResponse } from "next/og";
2 import { IDENTITY_PHRASE, SITE_NAME } from "@/lib/page-meta";
3
4 export const alt = `${SITE_NAME} — ${IDENTITY_PHRASE}`;
5 export const size = { width: 1200, height: 630 };
6 export const contentType = "image/png";
7
8 // The social card mirrors the restrained light-to-depth website treatment.
9 export default function OpengraphImage() {
10 return new ImageResponse(
11 (
12 <div
13 style={{
14 width: "100%",
15 height: "100%",
16 display: "flex",
17 flexDirection: "column",
18 justifyContent: "space-between",
19 backgroundColor: "#F4F7FB",
20 padding: "72px 84px",
21 fontFamily: "sans-serif",
22 }}
23 >
24 <div
25 style={{
26 display: "flex",
27 alignItems: "center",
28 gap: 16,
29 fontSize: 26,
30 letterSpacing: 0,
31 textTransform: "uppercase",
32 color: "#5B6780",
33 }}
34 >
35 <div style={{ width: 28, height: 14, borderRadius: "50% 45% 45% 50%", backgroundColor: "#F6C453" }} />
36 codewhale.net
37 </div>
38 <div style={{ display: "flex", flexDirection: "column" }}>
39 <div
40 style={{
41 fontSize: 116,
42 fontWeight: 700,
43 color: "#14213A",
44 letterSpacing: 0,
45 }}
46 >
47 Codewhale
48 </div>
49 <div
50 style={{
51 marginTop: 28,
52 fontSize: 38,
53 lineHeight: 1.35,
54 color: "#455168",
55 maxWidth: 980,
56 }}
57 >
58 {IDENTITY_PHRASE}
59 </div>
60 </div>
61 <div style={{ display: "flex", width: "100%", height: 14, backgroundColor: "#03070D" }}>
62 <div style={{ width: "32%", height: "100%", backgroundColor: "#6AAEF2" }} />
63 </div>
64 </div>
65 ),
66 { ...size },
67 );
68 }
69
69 lines Plain Text