Skip to content
ํ”„๋กœ์ ํŠธ

์†Œ๊ฐœ

๐ŸŽน To play piano using CSS and JavaScript

์›น ๋ฐ ์•ฑ ๊ฐœ๋ฐœ

์ด ์ˆ˜์น˜๋ฅผ ์ธก์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•

What you can do

  • 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.

์ธก์ •๋œ ์Šคํƒ€ ์ฆ๊ฐ€

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
๊ธฐ๋ก ์ˆ˜์ง‘ ์ค‘

์„œ๋กœ ๊ฒน์น˜๋Š” ๊ธฐ๊ฐ„์˜ ์ˆœ์ฆ๊ฐ€๋Ÿ‰์ด๋ฉฐ ์ผ๋ณ„ ํ•ฉ๊ณ„๊ฐ€ ์•„๋‹™๋‹ˆ๋‹ค. ์ธก์ •๊ฐ’์ด ์—†์œผ๋ฉด ๋น„์›Œ ๋‘ก๋‹ˆ๋‹ค. ์Šคํƒ€๋Š” ๊ด€์‹ฌ๋„๋ฅผ ๋‚˜ํƒ€๋‚ด๋ฉฐ ํ’ˆ์งˆ์„ ๋ณด์žฅํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

README.md

Original

Piano Keyboard

Piano Keyboard

Two octaves, playable with touch, mouse or keyboard.

CI Netlify Status license

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 reload
  • pnpm build: type-check and create a dist folder to deploy
  • pnpm preview: serve the production build locally
  • pnpm test: run the unit tests
  • pnpm typecheck: run the TypeScript compiler without emitting
  • pnpm lint: lint TypeScript and CSS
  • pnpm lint:fix: fix lint errors automatically
  • pnpm generate-pwa-assets: regenerate the PWA icons from public/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.

๊ด€๋ จ ํ”„๋กœ์ ํŠธ ์‚ดํŽด๋ณด๊ธฐ

๋ถˆ๋Ÿฌ์˜ค๋Š” ์ค‘โ€ฆ