From 5f632f57fd295b3a95cf4930aa071c1015e7f514 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Sat, 30 Aug 2025 22:10:06 +0000 Subject: [PATCH] Add favicon and manifest file for improved website branding Implement an API endpoint for dynamic favicon generation using SVG and add a manifest.json file for progressive web app capabilities. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 051a65da-1176-4478-a61c-c662f2a15536 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/051a65da-1176-4478-a61c-c662f2a15536/9NQBiz8 --- client/index.html | 5 +++++ client/public/manifest.json | 23 +++++++++++++++++++++++ server/routes.ts | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 client/public/manifest.json diff --git a/client/index.html b/client/index.html index 33397e6..5f2b225 100644 --- a/client/index.html +++ b/client/index.html @@ -31,6 +31,11 @@ + + + + +
diff --git a/client/public/manifest.json b/client/public/manifest.json new file mode 100644 index 0000000..b44927b --- /dev/null +++ b/client/public/manifest.json @@ -0,0 +1,23 @@ +{ + "name": "go4.video - Professional Video Streaming Platform", + "short_name": "go4.video", + "description": "Professional video streaming platform featuring Geschichte des Liedes, FOLX STADL, and premium content", + "theme_color": "#6366f1", + "background_color": "#2D1B69", + "display": "standalone", + "start_url": "/", + "icons": [ + { + "src": "/api/favicon?size=192", + "sizes": "192x192", + "type": "image/svg+xml", + "purpose": "any maskable" + }, + { + "src": "/api/favicon?size=512", + "sizes": "512x512", + "type": "image/svg+xml", + "purpose": "any maskable" + } + ] +} \ No newline at end of file diff --git a/server/routes.ts b/server/routes.ts index d7aa8f2..28beb53 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -689,6 +689,39 @@ export async function registerRoutes(app: Express): Promise { } }); + // Favicon generation endpoint + app.get('/api/favicon', (req, res) => { + try { + const size = req.query.size ? parseInt(req.query.size as string) : 32; + const padding = Math.max(2, size * 0.1); + const logoSize = size - (padding * 2); + const cornerRadius = Math.max(2, size * 0.15); + + // Generate SVG favicon with just the logo + const svg = ` + + + + + + + + + + + + + `; + + res.setHeader('Content-Type', 'image/svg+xml'); + res.setHeader('Cache-Control', 'public, max-age=86400'); // Cache for 24 hours + res.send(svg); + } catch (error) { + console.error('Error generating favicon:', error); + res.status(500).send('Error generating favicon'); + } + }); + const httpServer = createServer(app); return httpServer; }