Spaces:
Running
Running
File size: 1,122 Bytes
9bea604 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
// 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');
|