11import { ImageResponse } from "next/og" ;
2+ import { loadOgFonts , OG_COLORS , OgLogo } from "@/lib/og" ;
23
3- export const runtime = "edge" ;
4-
5- export function GET ( request : Request ) {
4+ export async function GET ( request : Request ) {
65 const { searchParams } = new URL ( request . url ) ;
76 const revenue = searchParams . get ( "revenue" ) || "0" ;
87 const visitors = searchParams . get ( "visitors" ) || "0" ;
@@ -23,9 +22,10 @@ export function GET(request: Request) {
2322 width : "100%" ,
2423 display : "flex" ,
2524 flexDirection : "column" ,
26- backgroundColor : "#0a0a0a" ,
25+ backgroundColor : OG_COLORS . background ,
2726 position : "relative" ,
2827 overflow : "hidden" ,
28+ fontFamily : "LT Superior" ,
2929 } }
3030 >
3131 < div
@@ -35,21 +35,30 @@ export function GET(request: Request) {
3535 left : 0 ,
3636 right : 0 ,
3737 bottom : 0 ,
38- backgroundImage :
39- "linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px)" ,
38+ backgroundImage : `linear-gradient(${ OG_COLORS . grid } 1px, transparent 1px), linear-gradient(90deg, ${ OG_COLORS . grid } 1px, transparent 1px)` ,
4039 backgroundSize : "48px 48px" ,
4140 } }
4241 />
4342
4443 < div
4544 style = { {
4645 position : "absolute" ,
47- top : "-20 %" ,
46+ top : "-25 %" ,
4847 right : "-10%" ,
48+ width : "700px" ,
49+ height : "550px" ,
50+ background : `radial-gradient(ellipse at center, ${ OG_COLORS . purpleGlow } , transparent 70%)` ,
51+ } }
52+ />
53+
54+ < div
55+ style = { {
56+ position : "absolute" ,
57+ bottom : "-30%" ,
58+ left : "-10%" ,
4959 width : "600px" ,
5060 height : "500px" ,
51- background :
52- "radial-gradient(ellipse at center, rgba(239, 68, 68, 0.08), transparent 70%)" ,
61+ background : `radial-gradient(ellipse at center, ${ OG_COLORS . amberGlow } , transparent 70%)` ,
5362 } }
5463 />
5564
@@ -61,45 +70,12 @@ export function GET(request: Request) {
6170 padding : "40px 60px 0" ,
6271 } }
6372 >
64- < div
65- style = { {
66- display : "flex" ,
67- alignItems : "center" ,
68- gap : "14px" ,
69- } }
70- >
71- < svg
72- height = "36"
73- style = { { borderRadius : "4px" } }
74- viewBox = "0 0 8 8"
75- width = "36"
76- xmlns = "http://www.w3.org/2000/svg"
77- >
78- < title > Databuddy</ title >
79- < path d = "M0 0h8v8H0z" fill = "#000" />
80- < path
81- d = "M1 1h1v6H1zm1 0h4v1H2zm4 1h1v1H6zm0 1h1v1H6zm0 1h1v1H6zm0 1h1v1H6zM2 6h4v1H2zm1-3h1v1H3zm1 1h1v1H4z"
82- fill = "#fff"
83- />
84- </ svg >
85- < span
86- style = { {
87- color : "#ffffff" ,
88- fontSize : "18px" ,
89- fontWeight : 600 ,
90- fontFamily : "monospace" ,
91- letterSpacing : "0.1em" ,
92- textTransform : "uppercase" ,
93- } }
94- >
95- Databuddy
96- </ span >
97- </ div >
73+ < OgLogo height = { 40 } />
9874 < span
9975 style = { {
100- color : "#525252" ,
101- fontSize : "14px " ,
102- fontFamily : "monospace" ,
76+ color : OG_COLORS . faint ,
77+ fontSize : "15px " ,
78+ fontWeight : 500 ,
10379 letterSpacing : "0.05em" ,
10480 } }
10581 >
@@ -128,20 +104,20 @@ export function GET(request: Request) {
128104 >
129105 < span
130106 style = { {
131- color : "#737373" ,
107+ color : OG_COLORS . muted ,
132108 fontSize : "16px" ,
109+ fontWeight : 500 ,
133110 textTransform : "uppercase" ,
134111 letterSpacing : "0.15em" ,
135- fontFamily : "monospace" ,
136112 } }
137113 >
138114 Estimated Opportunity Cost / Year
139115 </ span >
140116 < span
141117 style = { {
142- color : "#ef4444" ,
118+ color : OG_COLORS . amber ,
143119 fontSize : "96px" ,
144- fontWeight : 800 ,
120+ fontWeight : 700 ,
145121 letterSpacing : "-0.04em" ,
146122 lineHeight : 1 ,
147123 } }
@@ -167,18 +143,18 @@ export function GET(request: Request) {
167143 >
168144 < span
169145 style = { {
170- color : "#525252" ,
171- fontSize : "12px" ,
146+ color : OG_COLORS . faint ,
147+ fontSize : "13px" ,
148+ fontWeight : 500 ,
172149 textTransform : "uppercase" ,
173150 letterSpacing : "0.1em" ,
174- fontFamily : "monospace" ,
175151 } }
176152 >
177153 Monthly Visitors
178154 </ span >
179155 < span
180156 style = { {
181- color : "#ffffff" ,
157+ color : OG_COLORS . foreground ,
182158 fontSize : "28px" ,
183159 fontWeight : 700 ,
184160 } }
@@ -190,7 +166,7 @@ export function GET(request: Request) {
190166 style = { {
191167 width : "1px" ,
192168 height : "40px" ,
193- backgroundColor : "rgba(255,255,255,0.1)" ,
169+ backgroundColor : OG_COLORS . badgeBorder ,
194170 } }
195171 />
196172 < div
@@ -203,18 +179,18 @@ export function GET(request: Request) {
203179 >
204180 < span
205181 style = { {
206- color : "#525252" ,
207- fontSize : "12px" ,
182+ color : OG_COLORS . faint ,
183+ fontSize : "13px" ,
184+ fontWeight : 500 ,
208185 textTransform : "uppercase" ,
209186 letterSpacing : "0.1em" ,
210- fontFamily : "monospace" ,
211187 } }
212188 >
213189 Databuddy (est.)
214190 </ span >
215191 < span
216192 style = { {
217- color : "#ffffff" ,
193+ color : OG_COLORS . foreground ,
218194 fontSize : "28px" ,
219195 fontWeight : 700 ,
220196 } }
@@ -235,9 +211,9 @@ export function GET(request: Request) {
235211 >
236212 < span
237213 style = { {
238- color : "#525252" ,
214+ color : OG_COLORS . faint ,
239215 fontSize : "18px" ,
240- fontFamily : "monospace" ,
216+ fontWeight : 500 ,
241217 } }
242218 >
243219 Model yours at databuddy.cc/calculator
@@ -247,6 +223,7 @@ export function GET(request: Request) {
247223 {
248224 width : 1200 ,
249225 height : 630 ,
226+ fonts : await loadOgFonts ( ) ,
250227 }
251228 ) ;
252229}
0 commit comments