Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 61 additions & 106 deletions pages/api/og.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,144 +8,99 @@ export const config = {
export default async function handler(req: NextRequest) {
try {
const { searchParams } = new URL(req.url)

// Get dynamic parameters

const title = searchParams.get('title') || 'Tilekit'
const description = searchParams.get('description') || 'Monorepo hosting both in-house and vendored libraries and tools powering the Tiles Launcher.'
const type = searchParams.get('type') || 'default'

// Note: Using system fonts for better compatibility

return new ImageResponse(
(
<div
style={{
height: '100%',
backgroundColor: '#000000',
width: '100%',
height: '100%',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#0a0a0a',
backgroundImage: 'radial-gradient(circle at 25px 25px, #1a1a1a 2%, transparent 0%), radial-gradient(circle at 75px 75px, #1a1a1a 2%, transparent 0%)',
backgroundSize: '100px 100px',
color: 'white',
padding: '80px 120px',
boxSizing: 'border-box',
}}
>
{/* Header with logo */}
<div
style={{
display: 'flex',
alignItems: 'center',
gap: '12px',
marginBottom: '40px',
}}
>
<div
style={{
width: '48px',
height: '48px',
borderRadius: '12px',
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
fontSize: '24px',
fontWeight: 'bold',
color: 'white',
}}
>
T
</div>
<span
style={{
fontSize: '32px',
fontWeight: 'bold',
color: 'white',
letterSpacing: '-0.02em',
}}
>
Tilekit
</span>
</div>

{/* Main content */}
<div
style={{
display: 'flex',
justifyContent: 'center',
flexDirection: 'column',
alignItems: 'center',
textAlign: 'center',
maxWidth: '800px',
padding: '0 40px',
}}
>
<h1
style={{
fontSize: '64px',
fontWeight: 'bold',
color: 'white',
margin: '0 0 24px 0',
lineHeight: '1.1',
letterSpacing: '-0.02em',
}}
>
{title}
</h1>

<p
style={{
fontSize: '28px',
color: '#a1a1aa',
margin: '0',
lineHeight: '1.4',
maxWidth: '600px',
}}
>
{description}
</p>
</div>

{/* Footer */}
<div
style={{
position: 'absolute',
bottom: '40px',
left: '40px',
right: '40px',
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
}}
>
<div
style={{
display: 'flex',
alignItems: 'center',
gap: '8px',
color: '#71717a',
fontSize: '18px',
}}
>
<span>tileslauncher</span>
<span>•</span>
<span>{type}</span>
</div>

<div
style={{
color: '#71717a',
fontSize: '18px',
justifyContent: 'center',
marginBottom: title !== 'Tilekit' ? 40 : 0,
}}
>
tiles.run
<div
style={{
display: 'flex',
flexDirection: 'column',
gap: 10,
marginRight: 30,
}}
>
<div style={{ display: 'flex', gap: 8 }}>
<div
style={{
width: 35,
height: 35,
backgroundColor: 'white',
borderRadius: 7,
}}
/>
<div
style={{
width: 35,
height: 35,
backgroundColor: 'white',
borderRadius: 7,
}}
/>
</div>
<div style={{ display: 'flex' }}>
<div
style={{
width: 35,
height: 35,
backgroundColor: 'white',
borderRadius: 7,
}}
/>
</div>
</div>
<span style={{ fontSize: 110, fontWeight: 600 }}>
Tilekit
</span>
</div>
{title !== 'Tilekit' && (
<div
style={{
fontSize: 28,
fontWeight: 400,
maxWidth: 1000,
textAlign: 'center',
}}
>
{title}
</div>
)}
</div>
</div>
),
{
width: 1200,
height: 630,

}
)
} catch (e: any) {
Expand Down