| 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 ?? |
| 43 | subtitles[page] ?? |
| 44 | 'The operating system for your freelance business' |
| 45 | |
| 46 | const { bold, |
| 47 | |
| 48 | return new ImageResponse |
| 49 | <div |
| 50 | style={{ |
| 51 | background: |
| 52 | 'linear-gradient(145deg, #0a0a0f 0%, #0d0b1a 40%, #120e24 100%)', |
| 53 | overflow: 'hidden', |
| 54 | }} |
| 55 | tw='flex w-full h-full relative' |
| 56 | > |
| 57 | <div |
| 58 | style={{ |
| 59 | right: -40, |
| 60 | top: '50%', |
| 61 | transform: 'translateY(-50%)', |
| 62 | opacity: 0.04, |
| 63 | }} |
| 64 | tw='absolute flex' |
| 65 | > |
| 66 | <SaturnLogoLight height={ |
| 67 | </div> |
| 68 | |
| 69 | <div |
| 70 | style={{ |
| 71 | width: 900, |
| 72 | height: 900, |
| 73 | borderRadius: '50%', |
| 74 | border: '1px solid rgba(124,58,237,0.08)', |
| 75 | right: -300, |
| 76 | top: -140, |
| 77 | }} |
| 78 | tw='absolute flex' |
| 79 | /> |
| 80 | <div |
| 81 | style={{ |
| 82 | width: 700, |
| 83 | height: 700, |
| 84 | borderRadius: '50%', |
| 85 | border: '1px solid rgba(124,58,237,0.05)', |
| 86 | right: -200, |
| 87 | top: -40, |
| 88 | }} |
| 89 | tw='absolute flex' |
| 90 | /> |
| 91 | |
| 92 | <div |
| 93 | style={{ |
| 94 | width: 500, |
| 95 | height: 500, |
| 96 | borderRadius: '50%', |
| 97 | background: |
| 98 | 'radial-gradient(circle, rgba(124,58,237,0.18) 0%, rgba(124,58,237,0.05) 40%, transparent 70%)', |
| 99 | top: -100, |
| 100 | right: 50, |
| 101 | }} |
| 102 | tw='absolute flex' |
| 103 | /> |
| 104 | |
| 105 | <div |
| 106 | style={{ |
| 107 | left: 0, |
| 108 | top: 0, |
| 109 | bottom: 0, |
| 110 | width: 5, |
| 111 | background: |
| 112 | 'linear-gradient(to bottom, transparent, #7c3aed, #a78bfa, #7c3aed, transparent)', |
| 113 | }} |
| 114 | tw='absolute flex' |
| 115 | /> |
| 116 | |
| 117 | <div |
| 118 | style={{ padding: |
| 119 | tw='flex flex-col justify-between h-full w-full relative' |
| 120 | > |
| 121 | <div style={{ |
| 122 | <SaturnLogoLight height={ |
| 123 | <span |
| 124 | style={{ letterSpacing: |
| 125 | tw='text-[28px] font-bold text-white' |
| 126 | > |
| 127 | Saturn |
| 128 | </span> |
| 129 | </div> |
| 130 | |
| 131 | <div style={{ |
| 132 | <h1 |
| 133 | style={{ lineHeight: |
| 134 | tw='text-[80px] font-bold text-white m-0' |
| 135 | > |
| 136 | {page} |
| 137 | </h1> |
| 138 | <p |
| 139 | style={{ letterSpacing: |
| 140 | tw='text-[24px] text-white/40 m-0' |
| 141 | > |
| 142 | {subtitle} |
| 143 | </p> |
| 144 | </div> |
| 145 | |
| 146 | <div tw='flex items-center justify-between w-full |
| 147 | <span |
| 148 | style={{ letterSpacing: |
| 149 | tw='text-[14px] text-white/20' |
| 150 | > |
| 151 | saturn.procrastinator.fyi |
| 152 | </span> |
| 153 | </div> |
| 154 | </div> |
| 155 | </div>, |
| 156 | { |
| 157 | ...size, |
| 158 | fonts: [ |
| 159 | { |
| 160 | name: 'Geist', |
| 161 | data: bold, |
| 162 | style: 'normal' as |
| 163 | weight: 700 as const |
| 164 | }, |
| 165 | { |
| 166 | name: 'Geist', |
| 167 | data: regular, |
| 168 | style: 'normal' as |
| 169 | weight: 400 as const |
| 170 | }, |
| 171 | ], |
| 172 | } |
| 173 | ) |
| 174 | } |