top500albums/scripts/create_simple_favicon.py
Johan Lundberg 872fdfa0ee Organize repository by moving all scripts to scripts/ folder
- Moved all Python processing scripts to scripts/ directory for better organization
- Preserves git history using git mv command
- Clean separation between main project files and utility scripts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-01 00:36:08 +02:00

59 lines
No EOL
1.4 KiB
Python

#!/usr/bin/env python3
"""
Create a simple favicon using basic drawing
"""
def create_favicon_data():
"""Create a simple 16x16 favicon as a data URL"""
# Create a simple pattern for 16x16 favicon
# This will be a simplified version of our design
favicon_html = '''
<!DOCTYPE html>
<html>
<head><title>Favicon Creator</title></head>
<body>
<canvas id="favicon" width="16" height="16"></canvas>
<script>
const canvas = document.getElementById('favicon');
const ctx = canvas.getContext('2d');
// Fill background with gradient-like color
ctx.fillStyle = '#667eea';
ctx.fillRect(0, 0, 16, 16);
// Draw record
ctx.fillStyle = '#1a1a1a';
ctx.beginPath();
ctx.arc(8, 8, 6, 0, 2 * Math.PI);
ctx.fill();
// Center hole
ctx.fillStyle = '#667eea';
ctx.beginPath();
ctx.arc(8, 8, 2, 0, 2 * Math.PI);
ctx.fill();
// Download as PNG
function download() {
const link = document.createElement('a');
link.download = 'favicon-16x16.png';
link.href = canvas.toDataURL();
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
// Auto download
setTimeout(download, 100);
</script>
</body>
</html>'''
with open('favicon_generator.html', 'w') as f:
f.write(favicon_html)
print("Created favicon_generator.html - open this in a browser to download the favicon")
if __name__ == "__main__":
create_favicon_data()