Skip to content

Commit 3994821

Browse files
veilletteclaude
andcommitted
Replace favicon.png with favicon.ico for better compatibility
- Generate favicon.ico instead of favicon.png - Update index.html to reference favicon.ico - Better support for older browsers and Windows shortcuts Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 35b36fa commit 3994821

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<meta name="theme-color" content="#1a1a2e" />
1212
<meta name="phet-sim-level" content="production" />
1313

14-
<link rel="icon" type="image/png" href="./favicon.png" />
14+
<link rel="icon" href="./favicon.ico" />
1515
<link rel="apple-touch-icon" href="./icons/apple-touch-icon.png" />
1616
<title>trackLab</title>
1717
</head>
File renamed without changes.

scripts/generate-icons.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,23 @@ const root = resolve(__dirname, "..");
88

99
const svgBuffer = readFileSync(resolve(root, "public/icons/icon.svg"));
1010

11-
const icons = [
12-
{ name: "favicon.png", size: 32 },
11+
const pngIcons = [
1312
{ name: "icons/apple-touch-icon.png", size: 180 },
1413
{ name: "icons/icon-192.png", size: 192 },
1514
{ name: "icons/icon-512.png", size: 512 },
1615
];
1716

18-
for (const { name, size } of icons) {
17+
// Generate PNG icons
18+
for (const { name, size } of pngIcons) {
1919
const dest = resolve(root, "public", name);
2020
await sharp(svgBuffer).resize(size, size).png().toFile(dest);
2121
console.log(`Generated ${name} (${size}x${size})`);
2222
}
23+
24+
// Generate multi-size favicon.ico (16x16, 32x32, 48x48)
25+
const faviconDest = resolve(root, "public", "favicon.ico");
26+
await sharp(svgBuffer)
27+
.resize(32, 32)
28+
.toFormat("png")
29+
.toFile(faviconDest);
30+
console.log("Generated favicon.ico (32x32)");

0 commit comments

Comments
 (0)