项目
在 GitHub 查看
felipefialho/piano
关于
🎹 To play piano using CSS and JavaScript
网站与应用开发可以做什么
- 24 keys with sampled notes, starting at C4.
- Play with touch, mouse or your computer keyboard. Keys stay down while held.
- Installable PWA that works offline, with all samples precached.
- Light and dark themes that follow your system preference.
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文
Piano Keyboard
Two octaves, playable with touch, mouse or keyboard.
Live demo: piano.felipefialho.com
Features
- 24 keys with sampled notes, starting at C4.
- Play with touch, mouse or your computer keyboard. Keys stay down while held.
- Installable PWA that works offline, with all samples precached.
- Light and dark themes that follow your system preference.
Keyboard layout
| Octave | White keys | Black keys |
|---|---|---|
| Lower | Z X C V B N M |
S D G H J |
| Upper | Q W E R T Y U |
2 3 5 6 7 |
Tech stack
Vite, TypeScript, plain CSS, Howler.js and Vitest. Fonts (Bodoni Moda and Instrument Sans) are self-hosted.
Getting started
Requires Node.js 22.12+ and pnpm.
pnpm install
pnpm dev
Tasks
pnpm dev: start the dev server with hot reloadpnpm build: type-check and create adistfolder to deploypnpm preview: serve the production build locallypnpm test: run the unit testspnpm typecheck: run the TypeScript compiler without emittingpnpm lint: lint TypeScript and CSSpnpm lint:fix: fix lint errors automaticallypnpm generate-pwa-assets: regenerate the PWA icons frompublic/images/piano.png
Project structure
src/piano/ key handling and note playback (with tests)
src/styles/ plain CSS, split by concern
public/medias/ one MP3 sample per note
public/images/ PWA icons and social image
logo/ logo files
Security
See SECURITY.md to report a vulnerability.
License
MIT License © Felipe Fialho
If you enjoyed it, you can sponsor my work on GitHub.
探索相关项目
加载中…