forked from kane50613/takumi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathog-image.tsx
More file actions
210 lines (201 loc) · 4.77 KB
/
Copy pathog-image.tsx
File metadata and controls
210 lines (201 loc) · 4.77 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
import { readFile } from "node:fs/promises";
import { Box, Brain, Globe, type LucideIcon, Zap } from "lucide-react";
import { createElement } from "react";
const secondaryForeground = "rgba(241, 245, 249, 0.75)";
const primaryForeground = "#F1F5F9";
const borderColor = "rgba(215, 29, 54, 0.5)";
const accentColor = "#ff3535";
export const persistentImages = [
{
src: "takumi.svg",
data: await readFile("../../assets/images/takumi.svg"),
},
];
export const name = "og-image";
export const width = 1280;
export const height = 640;
export const fonts = [
"plus-jakarta-sans/PlusJakartaSans-VariableFont_wght.woff2",
];
export default function OgImage() {
return (
<div
style={{
backgroundImage:
"linear-gradient(135deg, #100806 0%, #1b0a08 35%, #2a0c0a 65%, #360e0c 100%)",
width: "100%",
height: "100%",
fontFamily: "Plus Jakarta Sans",
display: "grid",
gridTemplateColumns: "3fr 5fr",
}}
>
<div
style={{
paddingLeft: "4rem",
display: "flex",
flexDirection: "column",
borderRightWidth: 1,
borderColor,
borderStyle: "solid",
justifyContent: "center",
color: primaryForeground,
gap: "2rem",
}}
>
<img
src={persistentImages[0]?.src}
alt="Takumi logo"
style={{
width: "6rem",
}}
/>
<span style={{ fontSize: "4rem", fontWeight: 800 }}>Takumi</span>
<span
style={{
fontSize: "2rem",
fontWeight: 600,
color: secondaryForeground,
lineHeight: 1.5,
}}
>
Render your React components to images.
</span>
</div>
<div style={{ display: "flex", flexDirection: "column" }}>
<div
style={{
justifyContent: "center",
alignItems: "center",
padding: "1rem",
borderBottomWidth: 1,
borderColor,
borderStyle: "solid",
}}
>
<span
style={{
color: accentColor,
fontWeight: 800,
fontSize: "1.75rem",
padding: "0.5rem 1rem",
}}
>
Build for Developers.
</span>
</div>
<Features />
<div
style={{
alignItems: "center",
justifyContent: "center",
padding: "0.75rem",
}}
>
<span
style={{
color: secondaryForeground,
fontWeight: 600,
fontSize: "1rem",
}}
>
This image is rendered with Takumi.
</span>
</div>
</div>
</div>
);
}
function Features() {
return (
<div
style={{
display: "grid",
gridTemplateColumns: "repeat(2, 1fr)",
gridTemplateRows: "repeat(2, 1fr)",
flexGrow: 1,
}}
>
<Feature
title="All in One"
description="React code to image file in a single library."
icon={Box}
borderBottom
borderRight
/>
<Feature
title="Speed is the Priority"
description="Focus on speed to get your images ready."
icon={Zap}
borderBottom
/>
<Feature
title="Runs Everywhere"
description="In the browser, Node.js, and Edge Runtime."
icon={Globe}
borderRight
borderBottom
/>
<Feature
title="LLM Friendly"
description="Documentation is ready for AI to use."
icon={Brain}
borderBottom
/>
</div>
);
}
function Feature({
title,
description,
icon,
borderBottom = false,
borderRight = false,
}: {
title: string;
description: string;
icon: LucideIcon;
borderBottom?: boolean;
borderRight?: boolean;
}) {
return (
<div
style={{
flexDirection: "column",
borderBottomWidth: Number(borderBottom),
borderRightWidth: Number(borderRight),
borderColor,
borderStyle: "solid",
padding: "2rem",
gap: "1rem",
justifyContent: "center",
}}
>
<div
style={{
gap: "0.5rem",
color: secondaryForeground,
alignItems: "center",
}}
>
{createElement(icon, {
color: accentColor,
strokeWidth: 2.5,
width: 24,
height: 24,
})}
<span style={{ fontSize: "1.5rem", fontWeight: 600 }}>{title}</span>
</div>
<span
style={{
fontSize: "1.75rem",
color: primaryForeground,
fontWeight: 600,
lineHeight: 1.5,
}}
>
{description}
</span>
</div>
);
}