Skip to content

Commit 247909f

Browse files
committed
Add favicon generation script and assets
- Added a new script `generate-favicon.js` to create a favicon with an azure blue background and a white lightning bolt icon. - Included a new PNG favicon (`favicon.png`) generated by the script. - Added an SVG version of the favicon (`favicon.svg`) for scalability. - Updated `package.json` to include the `canvas` dependency required for the favicon generation.
1 parent 1880e34 commit 247909f

6 files changed

Lines changed: 683 additions & 14 deletions

File tree

favicon.png

621 Bytes
Loading

favicon.svg

Lines changed: 7 additions & 0 deletions
Loading

generate-favicon.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env node
2+
import fs from 'fs';
3+
import { createCanvas } from 'canvas';
4+
5+
const size = 32;
6+
const canvas = createCanvas(size, size);
7+
const ctx = canvas.getContext('2d');
8+
9+
// Azure blue background with rounded corners
10+
ctx.fillStyle = '#0078D4';
11+
ctx.beginPath();
12+
ctx.roundRect(0, 0, size, size, 4);
13+
ctx.fill();
14+
15+
// Draw lightning bolt in white
16+
ctx.fillStyle = '#FFFFFF';
17+
ctx.beginPath();
18+
ctx.moveTo(19, 5); // top point
19+
ctx.lineTo(11, 16); // middle left
20+
ctx.lineTo(15, 16); // indent
21+
ctx.lineTo(13, 27); // bottom point
22+
ctx.lineTo(24, 14); // middle right
23+
ctx.lineTo(19, 14); // indent
24+
ctx.closePath();
25+
ctx.fill();
26+
27+
// Save as PNG
28+
const buffer = canvas.toBuffer('image/png');
29+
fs.writeFileSync('favicon.png', buffer);
30+
console.log('favicon.png created successfully!');

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
1111
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
1212
<title>Azure Speed Test 2.0</title>
13+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
1314
<link rel="icon" type="image/png" href="/favicon.png" />
1415
<style>
1516
:root {

0 commit comments

Comments
 (0)