forked from colin/resume
38 lines
1.3 KiB
JavaScript
Executable File
38 lines
1.3 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
// Create an SVG favicon with a gradient background and initials
|
|
function generateFavicon() {
|
|
// Define colors for gradient
|
|
const primaryColor = '#3498db'; // Blue
|
|
const secondaryColor = '#2980b9'; // Darker blue
|
|
|
|
// Create SVG content with gradient and text
|
|
const svgContent = `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64">
|
|
<defs>
|
|
<linearGradient id="gradient" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
<stop offset="0%" stop-color="${primaryColor}" />
|
|
<stop offset="100%" stop-color="${secondaryColor}" />
|
|
</linearGradient>
|
|
</defs>
|
|
<rect width="64" height="64" rx="12" fill="url(#gradient)" />
|
|
<g>
|
|
<!-- C letter -->
|
|
<path d="M22,20 C18,20 15,23 15,28 C15,33 18,36 22,36 C25,36 27,34 28,31"
|
|
stroke="white" stroke-width="4" fill="none" stroke-linecap="round" />
|
|
<!-- K letter -->
|
|
<path d="M36,20 L36,36 M36,28 L45,20 M36,28 L45,36"
|
|
stroke="white" stroke-width="4" fill="none" stroke-linecap="round" />
|
|
</g>
|
|
</svg>`;
|
|
|
|
// Write SVG file
|
|
fs.writeFileSync(path.join(__dirname, 'favicon.svg'), svgContent);
|
|
console.log('Generated favicon.svg');
|
|
}
|
|
|
|
// Run the generator
|
|
generateFavicon();
|