8000 GitHub - gemini960114/how-many: 互動數學:把紙對折 42 次碰到月球、剪 31 次剪到原子(Vite + Canvas 2D) · GitHub
[go: up one dir, main page]

Skip to content
gemini960114Public

About

互動數學:把紙對折 42 次碰到月球、剪 31 次剪到原子(Vite + Canvas 2D)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

How Many? 指數的力量

兩個互動網頁 APP,用「每一步都 ×2 或 ÷2」感受指數成長:

App 內容 主題包
fold-to-moon/ 折到月球 0.1 mm 的紙對折 42 次,厚度 44 萬 km,碰到月球 經典版、台灣版、動物版
cut-to-atom/ 剪到原子 29.7 cm 的紙對半剪 31 次,長度 0.14 nm,剪到碳原子 經典版、人體版、廚房版

網站:https://gemini960114.github.io/how-many/(首頁 index.html,兩個 app 在各自的子路徑)

兩個 app 都是 Vite + TypeScript + Canvas 2D:

  • 圖示是自繪的 SVG path,原創配樂與音效用程式即時合成
  • 可以一鍵匯出 9:16 的 MP4 短片
  • 各自的細節(腳本、主題資料、配樂結構)請看各資料夾的 README

開發

cd fold-to-moon   # 或 cut-to-atom
npm install
npm run dev       # fold-to-moon: http://localhost:5180,cut-to-atom: http://localhost:5181
npm test

組裝整個網站(與 GitHub Actions 相同):

node scripts/build-site.mjs   # 每個 app 跑測試與 build,輸出到 _site/

推送到 main 後,.github/workflows/pages.yml 會自動 build 並部署到 GitHub Pages。

匯出影片

先在該 app 資料夾執行 npm run dev,再用 Edge 自動按「匯出短片」:

npx tsx scripts/export-test.ts ../videos/fold-to-moon_taiwan_zh.mp4 taiwan zh 0 track
#                             輸出檔                              主題   語言 加碼 音樂(track 原片/synth 原創)

videos/ 與所有 *. 5678 mp4 都在 .gitignore 裡,影片只留在本機。

音樂版權

兩個 app 預設播放的「原片音樂」(各自的 public/music/original.mp3)取自 @MathMango 的參考短片,版權屬原作者,會隨網站一起公開。

若要避免版權風險,刪掉這兩個 mp3 即可:app 載入失敗時會自動改用原創配樂。也可以在網址加 ?music=synth,直接使用原創配樂。

About

互動數學:把紙對折 42 次碰到月球、剪 31 次剪到原子(Vite + Canvas 2D)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0