Spaces:
Running
Running
// Simple script to create PWA icons | |
const canvas = document.createElement('canvas'); | |
const ctx = canvas.getContext('2d'); | |
function createIcon(size) { | |
canvas.width = size; | |
canvas.height = size; | |
// Background | |
ctx.fillStyle = '#0d6efd'; | |
ctx.fillRect(0, 0, size, size); | |
// Audio bars | |
ctx.fillStyle = 'white'; | |
const barWidth = size * 0.06; | |
const spacing = size * 0.08; | |
const baseY = size * 0.35; | |
// Bar heights and positions | |
const bars = [ | |
{ height: size * 0.3, offset: 0 }, | |
{ height: size * 0.45, offset: -size * 0.075 }, | |
{ height: size * 0.38, offset: -size * 0.04 }, | |
{ height: size * 0.3, offset: 0 } | |
]; | |
let x = size * 0.25; | |
bars.forEach(bar => { | |
ctx.fillRect(x, baseY + bar.offset, barWidth, bar.height); | |
x += barWidth + spacing; | |
}); | |
// Text | |
ctx.fillStyle = 'white'; | |
ctx.font = `bold ${size * 0.09}px Arial`; | |
ctx.textAlign = 'center'; | |
ctx.fillText('VELIN', size / 2, size * 0.85); | |
return canvas.toDataURL('image/png'); | |
} | |
// Create icons | |
const icon192 = createIcon(192); | |
const icon512 = createIcon(512); | |
console.log('Icons created'); | |