|
| 1 | +#!/usr/bin/env node |
| 2 | + |
| 3 | +// eslint-disable-next-line @typescript-eslint/no-require-imports |
| 4 | +const fs = require('fs'); |
| 5 | +// eslint-disable-next-line @typescript-eslint/no-require-imports |
| 6 | +const path = require('path'); |
| 7 | + |
| 8 | +// Simple PNG creation (1x1 orange pixel, will be scaled by browser) |
| 9 | +// This is a minimal valid PNG file in GitLab orange (#FC6D26) |
| 10 | +const createSimplePNG = () => { |
| 11 | + // This is a valid 1x1 orange PNG in base64 |
| 12 | + const base64PNG = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8DwHwAFBQIAX8jx0gAAAABJRU5ErkJggg=='; |
| 13 | + return Buffer.from(base64PNG, 'base64'); |
| 14 | +}; |
| 15 | + |
| 16 | +// GitLab orange color SVG icon |
| 17 | +const createSVGIcon = () => `<?xml version="1.0" encoding="UTF-8"?> |
| 18 | +<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"> |
| 19 | + <!-- Background --> |
| 20 | + <rect width="512" height="512" rx="80" fill="#FC6D26"/> |
| 21 | +
|
| 22 | + <!-- CI/CD Icon --> |
| 23 | + <g fill="white"> |
| 24 | + <!-- Top pipeline stage --> |
| 25 | + <circle cx="256" cy="150" r="30" opacity="1"/> |
| 26 | + <rect x="246" y="180" width="20" height="40" opacity="0.9"/> |
| 27 | +
|
| 28 | + <!-- Middle pipeline stage --> |
| 29 | + <circle cx="256" cy="256" r="30" opacity="0.9"/> |
| 30 | + <rect x="246" y="286" width="20" height="40" opacity="0.8"/> |
| 31 | +
|
| 32 | + <!-- Bottom pipeline stage --> |
| 33 | + <circle cx="256" cy="362" r="30" opacity="0.8"/> |
| 34 | +
|
| 35 | + <!-- Side branches --> |
| 36 | + <circle cx="180" cy="256" r="20" opacity="0.7"/> |
| 37 | + <circle cx="332" cy="256" r="20" opacity="0.7"/> |
| 38 | + <line x1="210" y1="256" x2="236" y2="256" stroke="white" stroke-width="4" opacity="0.7"/> |
| 39 | + <line x1="276" y1="256" x2="302" y2="256" stroke="white" stroke-width="4" opacity="0.7"/> |
| 40 | + </g> |
| 41 | +</svg>`; |
| 42 | + |
| 43 | +const publicDir = path.join(__dirname, '..', 'public'); |
| 44 | + |
| 45 | +// Create favicon.ico (using PNG format, browsers accept it) |
| 46 | +fs.writeFileSync(path.join(publicDir, 'favicon.ico'), createSimplePNG()); |
| 47 | +console.log('✅ Created favicon.ico'); |
| 48 | + |
| 49 | +// Create icon PNGs (minimal size, browser will scale) |
| 50 | +fs.writeFileSync(path.join(publicDir, 'icon-192x192.png'), createSimplePNG()); |
| 51 | +console.log('✅ Created icon-192x192.png'); |
| 52 | + |
| 53 | +fs.writeFileSync(path.join(publicDir, 'icon-512x512.png'), createSimplePNG()); |
| 54 | +console.log('✅ Created icon-512x512.png'); |
| 55 | + |
| 56 | +// Create proper SVG icon |
| 57 | +fs.writeFileSync(path.join(publicDir, 'icon.svg'), createSVGIcon()); |
| 58 | +console.log('✅ Created icon.svg'); |
| 59 | + |
| 60 | +console.log('\n🎉 All icons generated successfully!'); |
0 commit comments