Skip to content

Commit 4e31bf7

Browse files
veilletteclaude
andcommitted
Generate icons dynamically from bouncing ball physics
- Update bouncingBallToSVG.ts to write to public/icons/icon.svg - Add generate-svg-icon script to package.json - Update icons script to run SVG generation before PNG conversion - Regenerate all icons (favicon, apple-touch-icon, icon-192, icon-512) from physics-based bouncing ball animation (60 snapshots, 4 bounces) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent b040d40 commit 4e31bf7

7 files changed

Lines changed: 72 additions & 19 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"serve": "serve -s dist",
1616
"watch": "tsc --watch",
1717
"clean": "rm -rf dist",
18-
"icons": "tsx scripts/generate-icons.ts"
18+
"generate-svg-icon": "tsx scripts/bouncingBallToSVG.ts",
19+
"icons": "npm run generate-svg-icon && tsx scripts/generate-icons.ts"
1920
},
2021
"dependencies": {
2122
"@ffmpeg/core": "^0.12.10",

public/favicon.png

32 Bytes
Loading

public/icons/apple-touch-icon.png

-378 Bytes
Loading

public/icons/icon-192.png

-407 Bytes
Loading

public/icons/icon-512.png

-3.55 KB
Loading

public/icons/icon.svg

Lines changed: 64 additions & 16 deletions
Loading

scripts/bouncingBallToSVG.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,5 +116,9 @@ ${circles}
116116

117117
const points = computeSnapshots();
118118
const svg = buildSVG(points);
119-
fs.writeFileSync("bouncing_ball.svg", svg, "utf8");
120-
console.log(`SVG written with ${points.length} snapshots.`);
119+
120+
// Write to public/icons/icon.svg (source for PNG icon generation)
121+
const outputPath = "public/icons/icon.svg";
122+
fs.mkdirSync("public/icons", { recursive: true });
123+
fs.writeFileSync(outputPath, svg, "utf8");
124+
console.log(`✓ Generated ${outputPath} with ${points.length} bouncing ball snapshots`);

0 commit comments

Comments
 (0)