From bf43841da220d9d512e297df102f7f940da93878 Mon Sep 17 00:00:00 2001 From: ectasy663 Date: Tue, 22 Sep 2026 19:31:18 +0530 Subject: [PATCH] Premium Redesign of Share Card: Added glassmorphism, dynamic typography, avatars, and tech grid --- src/app/api/og/dashboard/route.tsx | 129 +++++++++++++++++++---------- 1 file changed, 86 insertions(+), 43 deletions(-) diff --git a/src/app/api/og/dashboard/route.tsx b/src/app/api/og/dashboard/route.tsx index a428357..78ab262 100644 --- a/src/app/api/og/dashboard/route.tsx +++ b/src/app/api/og/dashboard/route.tsx @@ -20,9 +20,13 @@ export async function GET(req: NextRequest) { // Load logo from disk and convert to base64 const logoPath = join(process.cwd(), 'public', 'PragatiVeer_Logo', 'PNG_Logos', 'Rectangular_dark_background.png'); - const logoData = readFileSync(logoPath); - const logoBase64 = logoData.toString('base64'); - const logoUrl = `data:image/png;base64,${logoBase64}`; + let logoUrl = ''; + try { + const logoData = readFileSync(logoPath); + logoUrl = `data:image/png;base64,${logoData.toString('base64')}`; + } catch (e) { + console.error('Failed to load logo', e); + } return new ImageResponse( ( @@ -34,53 +38,92 @@ export async function GET(req: NextRequest) { flexDirection: 'column', justifyContent: 'space-between', alignItems: 'center', - background: 'linear-gradient(135deg, #09090b 0%, #171717 100%)', + background: 'linear-gradient(145deg, #050505 0%, #111111 50%, #0a0a0a 100%)', color: '#ffffff', - fontFamily: 'sans-serif', - padding: '80px 0', - border: '12px solid #27272a', + fontFamily: '"Inter", sans-serif', + padding: '70px 0', }} > - {/* Header */} -
- -
- Performance Overview -
-
+ {/* Subtle grid background overlay */} +
- {/* Main Content */} -
- {/* 2x2 Grid */} -
-
- {score} - Today's Score -
-
- {accuracy} - Accuracy -
-
- {qs} - Qs Attempted -
-
- {rank} - City Rank +
+ {/* Header */} +
+ + +
+
+ + Performance Report +
-
- - {/* Footer */} -
-
-
{name}
-
{`${plan} Plan`}
-
{`${target} Aspirant`}
+ + {/* Main Content - 2x2 Grid */} +
+ +
+ Today's Score + {score} +
+ +
+ Accuracy + {accuracy} +
+ +
+ Qs Attempted + {qs} +
+ +
+ City Rank + {rank} +
+
-
- contact@pragativeer.com + + {/* Footer */} +
+ {/* Divider */} +
+ +
+
+ {/* User Avatar Placeholder */} +
+ {name.charAt(0).toUpperCase()} +
+ +
+
{name}
+
+
{`${target} Aspirant`}
+
•
+
{`${plan} Plan`}
+
+
+
+ +
+
+ pragativeer.com +
+
+