| 1 | import { ImageResponse } from 'next/og' |
| 2 | import type { NextRequest |
| 3 | import { SaturnLogoLight } |
| 4 | |
| 5 | export const runtime = |
| 6 | |
| 7 | const size = { |
| 8 | |
| 9 | const subtitles: Record |
| 10 | Invoices: 'Create, send, and track invoices', |
| 11 | Clients: 'Manage client relationships and access', |
| 12 | Milestones: 'Track project milestones and deliverables', |
| 13 | Requirements: 'Write, review, and sign off on requirements', |
| 14 | Timesheets: 'Log hours and track team productivity', |
| 15 | Expenses: 'Track and approve project expenses', |
| 16 | Team: 'Manage your team members and roles', |
| 17 | Settings: 'Configure your project and organization', |
| 18 | Overview: 'Your project at a glance', |
| 19 | Projects: 'Manage projects, requirements, and invoices', |
| 20 | } |
| 21 | |
| 22 | async function loadGeistFont() |
| 23 | const [bold, |
| 24 | fetch( |
| 25 | new URL( |
| 26 | 'https://cdn.jsdelivr.net/fontsource/fonts/geist-sans@latest/latin-700-normal.woff' |
| 27 | ) |
| 28 | ).then((r |
| 29 | fetch( |
| 30 | new URL( |
| 31 | 'https://cdn.jsdelivr.net/fontsource/fonts/geist-sans@latest/latin-400-normal.woff' |
| 32 | ) |
| 33 | ).then((r |
| 34 | ]) |
| 35 | return { bold, |
| 36 | } |
| 37 | |
| 38 | export async function GET |
| 39 | const page = |
| 40 | const subtitleParam = |
| 41 | const subtitle = |
| 42 | subtitleParam ?? subtitles[ |
| 43 | |
| 44 | const { bold, |
| 45 | |
| 46 | return new ImageResponse |
| 47 | <div |
| 48 | style={{ |
| 49 | background: |
| 50 | 'linear-gradient(145deg, #0a0a0f 0%, #0d0b1a 40%, #120e24 100%)', |
| 51 | overflow: 'hidden', |
| 52 | }} |
| 53 | tw='flex w-full h-full relative' |
| 54 | > |
| 55 | <div |
| 56 | style={{ |
| 57 | right: -40, |
| 58 | top: '50%', |
| 59 | transform: 'translateY(-50%)', |
| 60 | opacity: 0.04, |
| 61 | }} |
| 62 | tw='absolute flex' |
| 63 | > |
| 64 | <SaturnLogoLight height={ |
| 65 | </div> |
| 66 | |
| 67 | <div |
| 68 | style={{ |
| 69 | width: 900, |
| 70 | height: 900, |
| 71 | borderRadius: '50%', |
| 72 | border: '1px solid rgba(124,58,237,0.08)', |
| 73 | right: -300, |
| 74 | top: -140, |
| 75 | }} |
| 76 | tw='absolute flex' |
| 77 | /> |
| 78 | <div |
| 79 | style={{ |
| 80 | width: 700, |
| 81 | height: 700, |
| 82 | borderRadius: '50%', |
| 83 | border: '1px solid rgba(124,58,237,0.05)', |
| 84 | right: -200, |
| 85 | top: -40, |
| 86 | }} |
| 87 | tw='absolute flex' |
| 88 | /> |
| 89 | |
| 90 | <div |
| 91 | style={{ |
| 92 | width: 500, |
| 93 | height: 500, |
| 94 | borderRadius: '50%', |
| 95 | background: |
| 96 | 'radial-gradient(circle, rgba(124,58,237,0.18) 0%, rgba(124,58,237,0.05) 40%, transparent 70%)', |
| 97 | top: -100, |
| 98 | right: 50, |
| 99 | }} |
| 100 | tw='absolute flex' |
| 101 | /> |
| 102 | |
| 103 | <div |
| 104 | style={{ |
| 105 | left: 0, |
| 106 | top: 0, |
| 107 | bottom: 0, |
| 108 | width: 5, |
| 109 | background: |
| 110 | 'linear-gradient(to bottom, transparent, #7c3aed, #a78bfa, #7c3aed, transparent)', |
| 111 | }} |
| 112 | tw='absolute flex' |
| 113 | /> |
| 114 | |
| 115 | <div |
| 116 | style={{ padding: |
| 117 | tw='flex flex-col justify-between h-full w-full relative' |
| 118 | > |
| 119 | <div style={{ |
| 120 | <SaturnLogoLight height={ |
| 121 | <span |
| 122 | style={{ letterSpacing: |
| 123 | tw='text-[28px] font-bold text-white' |
| 124 | > |
| 125 | Saturn |
| 126 | </span> |
| 127 | </div> |
| 128 | |
| 129 | <div style={{ |
| 130 | <h1 |
| 131 | style={{ lineHeight: |
| 132 | tw='text-[80px] font-bold text-white m-0' |
| 133 | > |
| 134 | {page} |
| 135 | </h1> |
| 136 | <p |
| 137 | style={{ letterSpacing: |
| 138 | tw='text-[24px] text-white/40 m-0' |
| 139 | > |
| 140 | {subtitle} |
| 141 | </p> |
| 142 | </div> |
| 143 | |
| 144 | <div tw='flex items-center justify-between w-full |
| 145 | <span |
| 146 | style={{ letterSpacing: |
| 147 | tw='text-[14px] text-white/20' |
| 148 | > |
| 149 | saturn.procrastinator.fyi |
| 150 | </span> |
| 151 | </div> |
| 152 | </div> |
| 153 | </div>, |
| 154 | { |
| 155 | ...size, |
| 156 | fonts: [ |
| 157 | { |
| 158 | name: 'Geist', |
| 159 | data: bold, |
| 160 | style: 'normal' as |
| 161 | weight: 700 as const |
| 162 | }, |
| 163 | { |
| 164 | name: 'Geist', |
| 165 | data: regular, |
| 166 | style: 'normal' as |
| 167 | weight: 400 as const |
| 168 | }, |
| 169 | ], |
| 170 | } |
| 171 | ) |
| 172 | } |