Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added drumkit/ManuPrasad1208/.DS_Store
Binary file not shown.
Binary file added drumkit/ManuPrasad1208/images/crash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drumkit/ManuPrasad1208/images/kick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drumkit/ManuPrasad1208/images/snare.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drumkit/ManuPrasad1208/images/tom1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drumkit/ManuPrasad1208/images/tom2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drumkit/ManuPrasad1208/images/tom3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added drumkit/ManuPrasad1208/images/tom4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions drumkit/ManuPrasad1208/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">

<head>
<meta charset="utf-8">
<title>Drum Kit</title>
<link rel="stylesheet" href="styles.css">
<link href="https://fonts.googleapis.com/css?family=Arvo" rel="stylesheet">
</head>

<body>

<h1 id="title">Drum 🥁 Kit</h1>
<div class="set">
<button class="w drum">w</button>
<button class="a drum">a</button>
<button class="s drum">s</button>
<button class="d drum">d</button>
<button class="j drum">j</button>
<button class="k drum">k</button>
<button class="l drum">l</button>
</div>


<footer>
Made with ❤️ INDIA.
</footer>
<script charset="utf-8" src="/home/manu/Desktop/Drum Kit Starting Files/index.js"></script>
</body>

</html>
57 changes: 57 additions & 0 deletions drumkit/ManuPrasad1208/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// detecting button press

for (var i = 0; i < document.querySelectorAll(".drum").length; i++) {
document.querySelectorAll(".drum")[i].addEventListener("click", function() {
var buttonInnerHTML = this.innerHTML;
makeSound(buttonInnerHTML);

buttonAnimation(buttonInnerHTML);
});
}

// detecting keyboard press
document.addEventListener("keypress",function(event){
makeSound(event.key);


buttonAnimation(event.key);
});
function makeSound(key){
switch (key) {
case "w":
var crash = new Audio("/home/manu/Desktop/Drum Kit Starting Files/sounds/crash.mp3");
crash.play();
break;
case "a":
var kick = new Audio("/home/manu/Desktop/Drum Kit Starting Files/sounds/kick-bass.mp3");
kick.play();
break;
case "s":
var snare = new Audio("/home/manu/Desktop/Drum Kit Starting Files/sounds/snare.mp3");
snare.play();
break;
case "d":
var tom1 = new Audio("/home/manu/Desktop/Drum Kit Starting Files/sounds/tom-1.mp3");
tom1.play();
break;
case "j":
var tom2 = new Audio("/home/manu/Desktop/Drum Kit Starting Files/sounds/tom-2.mp3");
tom2.play();
break;
case "k":
var tom3 = new Audio("/home/manu/Desktop/Drum Kit Starting Files/sounds/tom-3.mp3");
tom3.play();
break;
case "l":
var tom4 = new Audio("/home/manu/Desktop/Drum Kit Starting Files/sounds/tom-4.mp3");
tom4.play();
default:
console.log(buttonInnerHTML);
}
}

function buttonAnimation(currentKey){
var activeButton=document.querySelector("."+currentKey);//.w,.a,.s and so on.
activeButton.classList.add("pressed");
setTimeout(function(){activeButton.classList.remove("pressed")},100);
}
Binary file added drumkit/ManuPrasad1208/sounds/crash.mp3
Binary file not shown.
Binary file added drumkit/ManuPrasad1208/sounds/kick-bass.mp3
Binary file not shown.
Binary file added drumkit/ManuPrasad1208/sounds/snare.mp3
Binary file not shown.
Binary file added drumkit/ManuPrasad1208/sounds/tom-1.mp3
Binary file not shown.
Binary file added drumkit/ManuPrasad1208/sounds/tom-2.mp3
Binary file not shown.
Binary file added drumkit/ManuPrasad1208/sounds/tom-3.mp3
Binary file not shown.
Binary file added drumkit/ManuPrasad1208/sounds/tom-4.mp3
Binary file not shown.
88 changes: 88 additions & 0 deletions drumkit/ManuPrasad1208/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
body {
text-align: center;
background-color: #283149;
}

h1 {
font-size: 5rem;
color: #DBEDF3;
font-family: "Arvo", cursive;
text-shadow: 3px 0 #DA0463;

}

footer {
color: #DBEDF3;
font-family: sans-serif;
}

.w {
background: url('/home/manu/Desktop/Drum Kit Starting Files/images/crash.png') no-repeat center;
background-size: cover;
}

.a {
background: url('/home/manu/Desktop/Drum Kit Starting Files/images/kick.png') no-repeat center;
background-size: cover;
}

.s {
background: url('/home/manu/Desktop/Drum Kit Starting Files/images/snare.png') no-repeat center;
background-size: cover;
}

.d {
background: url('/home/manu/Desktop/Drum Kit Starting Files/images/tom1.png') no-repeat center;
background-size: cover;
}

.j {
background: url('/home/manu/Desktop/Drum Kit Starting Files/images/tom2.png') no-repeat center;
background-size: cover;
}

.k {
background: url('/home/manu/Desktop/Drum Kit Starting Files/images/tom3.png') no-repeat center;
background-size: cover;
}

.l {
background: url('/home/manu/Desktop/Drum Kit Starting Files/images/tom4.png') no-repeat center;
background-size: cover;
}

.set {
margin: 10% auto;
}

.game-over {
background-color: red;
opacity: 0.8;
}

.pressed {
box-shadow: 0 3px 4px 0 #DBEDF3;
opacity: 0.5;
}

.red {
color: red;
}

.drum {
outline: none;
border: 10px solid #404B69;
font-size: 5rem;
font-family: 'Arvo', cursive;
line-height: 2;
font-weight: 900;
color: #DA0463;
text-shadow: 3px 0 #DBEDF3;
border-radius: 15px;
display: inline-block;
width: 150px;
height: 150px;
text-align: center;
margin: 10px;
background-color: white;
}