Skip to content

Commit

Permalink
updates java files
Browse files Browse the repository at this point in the history
  • Loading branch information
kshivam654 committed Oct 26, 2020
1 parent f58397f commit 0d95feb
Show file tree
Hide file tree
Showing 2,784 changed files with 2,905 additions and 376,866 deletions.
2 changes: 0 additions & 2 deletions 25780367.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
Expand Down
124 changes: 62 additions & 62 deletions 4) BEATBOX using JS/index.html
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Beatbox</title>
<link type="text/css" rel="stylesheet" href="style.css" />
</head>
<body>
<div class="container">
<div class="beatbox">
<div class="beat">
<div id="65" class="button aqua">
A
</div>
</div>
<div class="beat">
<div id="83" class="button aqua">
S
</div>
</div>
<div class="beat">
<div id="68" class="button aqua">
D
</div>
</div>
<div class="beat">
<div id="70" class="button purple">
F
</div>
</div>
<div class="beat">
<div id="71" class="button purple">
G
</div>
</div>
<div class="beat">
<div id="72" class="button purple">
H
</div>
</div>
<div class="beat">
<div id="74" class="button purple">
J
</div>
</div>
<div class="beat">
<div id="75" class="button white">
K
</div>
</div>
<div class="beat">
<div id="76" class="button white">
L
</div>
</div>
</div>
</div>

<script type="text/javascript" src="script.js"></script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Beatbox</title>
<link type="text/css" rel="stylesheet" href="style.css" />
</head>
<body>
<div class="container">
<div class="beatbox">
<div class="beat">
<div id="65" class="button aqua">
A
</div>
</div>
<div class="beat">
<div id="83" class="button aqua">
S
</div>
</div>
<div class="beat">
<div id="68" class="button aqua">
D
</div>
</div>
<div class="beat">
<div id="70" class="button purple">
F
</div>
</div>
<div class="beat">
<div id="71" class="button purple">
G
</div>
</div>
<div class="beat">
<div id="72" class="button purple">
H
</div>
</div>
<div class="beat">
<div id="74" class="button purple">
J
</div>
</div>
<div class="beat">
<div id="75" class="button white">
K
</div>
</div>
<div class="beat">
<div id="76" class="button white">
L
</div>
</div>
</div>
</div>

<script type="text/javascript" src="script.js"></script>
</body>
</html>
206 changes: 103 additions & 103 deletions 4) BEATBOX using JS/script.js
Original file line number Diff line number Diff line change
@@ -1,103 +1,103 @@
document.addEventListener("keydown", (event) => {
console.log(event.keyCode);
var key = event.keyCode;
if (key == 65) {
var audio = new Audio("Piano Chord 208.mp3");
audio.currentTime = 0;
audio.play();
document.getElementById("65").style.backgroundColor = "aqua";
document.getElementById("65").style.boxShadow = "0px 0px 20px 0px aqua";
setTimeout(function () {
document.getElementById("65").style.backgroundColor = "transparent";
document.getElementById("65").style.boxShadow = "none";
}, 500);
}
if (key == 83) {
var audio = new Audio("Piano Chord 209.mp3");
audio.currentTime = 0;
audio.play();
document.getElementById("83").style.backgroundColor = "aqua";
document.getElementById("83").style.boxShadow = "0px 0px 20px 0px aqua";
setTimeout(function () {
document.getElementById("83").style.backgroundColor = "transparent";
document.getElementById("83").style.boxShadow = "none";
}, 500);
}
if (key == 68) {
var audio = new Audio("Piano Chord 331.mp3");
audio.currentTime = 0;
audio.play();
document.getElementById("68").style.backgroundColor = "aqua";
document.getElementById("68").style.boxShadow = "0px 0px 20px 0px aqua";
setTimeout(function () {
document.getElementById("68").style.backgroundColor = "transparent";
document.getElementById("68").style.boxShadow = "none";
}, 500);
}
if (key == 70) {
var audio = new Audio("Drum Sticks Hit 3.mp3");
audio.currentTime = 0;
audio.play();
document.getElementById("70").style.backgroundColor = "#ff00ff";
document.getElementById("70").style.boxShadow = "0px 0px 20px 0px #ff00ff";
setTimeout(function () {
document.getElementById("70").style.backgroundColor = "transparent";
document.getElementById("70").style.boxShadow = "none";
}, 500);
}
if (key == 71) {
var audio = new Audio("Drum Snare Roll.mp3");
audio.currentTime = 0;
audio.play();
document.getElementById("71").style.backgroundColor = "#ff00ff";
document.getElementById("71").style.boxShadow = "0px 0px 20px 0px #ff00ff";
setTimeout(function () {
document.getElementById("71").style.backgroundColor = "transparent";
document.getElementById("71").style.boxShadow = "none";
}, 500);
}
if (key == 72) {
var audio = new Audio("PREL Musical 57.mp3");
audio.currentTime = 0;
audio.play();
document.getElementById("72").style.backgroundColor = "#ff00ff";
document.getElementById("72").style.boxShadow = "0px 0px 20px 0px #ff00ff";
setTimeout(function () {
document.getElementById("72").style.backgroundColor = "transparent";
document.getElementById("72").style.boxShadow = "none";
}, 500);
}
if (key == 74) {
var audio = new Audio("Cymbal Suspended 2.mp3");
audio.currentTime = 0;
audio.play();
document.getElementById("74").style.backgroundColor = "#ff00ff";
document.getElementById("74").style.boxShadow = "0px 0px 20px 0px #ff00ff";
setTimeout(function () {
document.getElementById("74").style.backgroundColor = "transparent";
document.getElementById("74").style.boxShadow = "none";
}, 500);
}
if (key == 75) {
var audio = new Audio("Musical Compos 33.mp3");
audio.currentTime = 0;
audio.play();
document.getElementById("75").style.backgroundColor = "white";
document.getElementById("75").style.boxShadow = "0px 0px 20px 0px white";
setTimeout(function () {
document.getElementById("75").style.backgroundColor = "transparent";
document.getElementById("75").style.boxShadow = "none";
}, 500);
}
if (key == 76) {
var audio = new Audio("Musical Orches 4.mp3");
audio.currentTime = 0;
audio.play();
document.getElementById("76").style.backgroundColor = "white";
document.getElementById("76").style.boxShadow = "0px 0px 20px 0px white";
setTimeout(function () {
document.getElementById("76").style.backgroundColor = "transparent";
document.getElementById("76").style.boxShadow = "none";
}, 500);
}
});
document.addEventListener("keydown", (event) => {
console.log(event.keyCode);
var key = event.keyCode;
if (key == 65) {
var audio = new Audio("Piano Chord 208.mp3");
audio.currentTime = 0;
audio.play();
document.getElementById("65").style.backgroundColor = "aqua";
document.getElementById("65").style.boxShadow = "0px 0px 20px 0px aqua";
setTimeout(function () {
document.getElementById("65").style.backgroundColor = "transparent";
document.getElementById("65").style.boxShadow = "none";
}, 500);
}
if (key == 83) {
var audio = new Audio("Piano Chord 209.mp3");
audio.currentTime = 0;
audio.play();
document.getElementById("83").style.backgroundColor = "aqua";
document.getElementById("83").style.boxShadow = "0px 0px 20px 0px aqua";
setTimeout(function () {
document.getElementById("83").style.backgroundColor = "transparent";
document.getElementById("83").style.boxShadow = "none";
}, 500);
}
if (key == 68) {
var audio = new Audio("Piano Chord 331.mp3");
audio.currentTime = 0;
audio.play();
document.getElementById("68").style.backgroundColor = "aqua";
document.getElementById("68").style.boxShadow = "0px 0px 20px 0px aqua";
setTimeout(function () {
document.getElementById("68").style.backgroundColor = "transparent";
document.getElementById("68").style.boxShadow = "none";
}, 500);
}
if (key == 70) {
var audio = new Audio("Drum Sticks Hit 3.mp3");
audio.currentTime = 0;
audio.play();
document.getElementById("70").style.backgroundColor = "#ff00ff";
document.getElementById("70").style.boxShadow = "0px 0px 20px 0px #ff00ff";
setTimeout(function () {
document.getElementById("70").style.backgroundColor = "transparent";
document.getElementById("70").style.boxShadow = "none";
}, 500);
}
if (key == 71) {
var audio = new Audio("Drum Snare Roll.mp3");
audio.currentTime = 0;
audio.play();
document.getElementById("71").style.backgroundColor = "#ff00ff";
document.getElementById("71").style.boxShadow = "0px 0px 20px 0px #ff00ff";
setTimeout(function () {
document.getElementById("71").style.backgroundColor = "transparent";
document.getElementById("71").style.boxShadow = "none";
}, 500);
}
if (key == 72) {
var audio = new Audio("PREL Musical 57.mp3");
audio.currentTime = 0;
audio.play();
document.getElementById("72").style.backgroundColor = "#ff00ff";
document.getElementById("72").style.boxShadow = "0px 0px 20px 0px #ff00ff";
setTimeout(function () {
document.getElementById("72").style.backgroundColor = "transparent";
document.getElementById("72").style.boxShadow = "none";
}, 500);
}
if (key == 74) {
var audio = new Audio("Cymbal Suspended 2.mp3");
audio.currentTime = 0;
audio.play();
document.getElementById("74").style.backgroundColor = "#ff00ff";
document.getElementById("74").style.boxShadow = "0px 0px 20px 0px #ff00ff";
setTimeout(function () {
document.getElementById("74").style.backgroundColor = "transparent";
document.getElementById("74").style.boxShadow = "none";
}, 500);
}
if (key == 75) {
var audio = new Audio("Musical Compos 33.mp3");
audio.currentTime = 0;
audio.play();
document.getElementById("75").style.backgroundColor = "white";
document.getElementById("75").style.boxShadow = "0px 0px 20px 0px white";
setTimeout(function () {
document.getElementById("75").style.backgroundColor = "transparent";
document.getElementById("75").style.boxShadow = "none";
}, 500);
}
if (key == 76) {
var audio = new Audio("Musical Orches 4.mp3");
audio.currentTime = 0;
audio.play();
document.getElementById("76").style.backgroundColor = "white";
document.getElementById("76").style.boxShadow = "0px 0px 20px 0px white";
setTimeout(function () {
document.getElementById("76").style.backgroundColor = "transparent";
document.getElementById("76").style.boxShadow = "none";
}, 500);
}
});
Loading

0 comments on commit 0d95feb

Please sign in to comment.