Skip to content

An interactive web drum kit that plays sounds with keyboard keys or screen taps, created as part of Wes Bos's JavaScript 30 course.

License

Notifications You must be signed in to change notification settings

Drougnov/Drum-kit-2.0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drum Kit

This project is inspired by Day 1 of Wes Bos's JavaScript 30 Course. The goal is to create an interactive drum kit that plays sounds when keys are pressed on the keyboard or clicked/tapped on the screen.

Project Overview

The Drum Kit allows users to:

  • Play different drum sounds by pressing specific keys on the keyboard.
  • Click or tap on-screen keys to produce sounds, ideal for touch screens.

The project consists of HTML, CSS, and JavaScript files that create a responsive drum interface.

Key Mappings

Key Sound
A Clap
S Hihat
D Kick
F Openhat
G Boom
H Ride
J Snare
K Tom
L Tink

How It Works

  1. Each drum key is linked to an audio element with a unique data-key attribute.
  2. JavaScript detects the key press or click event and matches it to the corresponding data-key.
  3. When a match is found:
    • The audio element is played from the beginning.
    • The key element is highlighted with a CSS class.
  4. The transition effect is removed once the sound and animation are complete.

How to Use

  • Clone or download the repository.
  • Open index.html in a browser.
  • Press any of the mapped keys (A, S, D, F, G, H, J, K, L) or click/tap the on-screen keys to play sounds.

Customizations

  • Tapping/Clicking Functionality: Tapping or clicking on the keys plays the corresponding sounds, making it compatible with touch screens. This feature has been implemented to enhance interactivity.
  • Modifying Styles: Customize key appearance and animations in style.css.

About

An interactive web drum kit that plays sounds with keyboard keys or screen taps, created as part of Wes Bos's JavaScript 30 course.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published