-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopengraph-image.tsx
63 lines (60 loc) · 1.56 KB
/
opengraph-image.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* eslint-disable @next/next/no-img-element */
import { ImageResponse } from "next/server";
export const runtime = "edge";
export const alt = "Precedent - Building blocks for your Next.js project";
export const contentType = "image/png";
export default async function OG() {
// Font
const interSemiBold = await fetch(
new URL("./fonts/Inter-SemiBold.ttf", import.meta.url)
).then((res) => res.arrayBuffer());
return new ImageResponse(
(
<div
style={{
height: "100%",
width: "100%",
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
backgroundColor: "white",
backgroundImage:
"linear-gradient(to bottom right, #E0E7FF 25%, #ffffff 50%, #bde1ff 75%)",
}}
>
<img
src={new URL(
"../public/apple-touch-icon.png",
import.meta.url
).toString()}
alt="Liftoff Logo"
tw="w-20 h-20 mb-4 opacity-95"
/>
<h1
style={{
fontSize: "100px",
background:
"linear-gradient(to bottom right, #1E2B3A 21.66%, #78716c 86.47%)",
backgroundClip: "text",
color: "transparent",
lineHeight: "5rem",
letterSpacing: "-0.02em",
}}
>
AI Mock Interviews
</h1>
</div>
),
{
width: 1200,
height: 630,
fonts: [
{
name: "Inter",
data: interSemiBold,
},
],
}
);
}