Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lauren(Sky) - Keyboard #24

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
23 changes: 12 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,51 @@
<title>Noises</title>
<meta charset="utf-8">
<link href="noise.css" media="screen" rel="stylesheet" type="text/css">

<link href="https://fonts.googleapis.com/css?family=Lobster|Quicksand" rel="stylesheet">
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="noise.js"></script>
</head>
<body>
<h1 id = "sky-header">Sky's the limit(ed) Keyboard!</h1>
<div id="audio_embeds">
<audio id="cAudio">
<source src="media/c_note.mp3" type="audio/mpeg"></source>
<source src="media/c_note.ogg" type="audio/ogg"></source>
<source src="media/c_note.wav" type="audio/wav"></source>
<source src="media/c_note.wav" type="audio/wav"></source>
</audio>
<audio id="dAudio">
<source src="media/d_note.mp3" type="audio/mpeg"></source>
<source src="media/d_note.ogg" type="audio/ogg"></source>
<source src="/media/d_note.wav" type="audio/wav"></source>
</audio>
<source src="/media/d_note.wav" type="audio/wav"></source>
</audio>
<audio id="eAudio">
<source src="media/e_note.mp3" type="audio/mpeg"></source>
<source src="media/e_note.ogg" type="audio/ogg"></source>
<source src="media/e_note.wav" type="audio/wav"></source>
<source src="media/e_note.wav" type="audio/wav"></source>
</audio>
<audio id="fAudio">
<source src="media/f_note.mp3" type="audio/mpeg"></source>
<source src="media/f_note.ogg" type="audio/ogg"></source>
<source src="media/f_note.wav" type="audio/wav"></source>
<source src="media/f_note.wav" type="audio/wav"></source>
</audio>
<audio id="gAudio">
<source src="media/g_note.mp3" type="audio/mpeg"></source>
<source src="media/g_note.ogg" type="audio/ogg"></source>
<source src="media/g_note.wav" type="audio/wav"></source>
<source src="media/g_note.wav" type="audio/wav"></source>
</audio>
<audio id="aAudio">
<source src="media/a_note.mp3" type="audio/mpeg"></source>
<source src="media/a_note.ogg" type="audio/ogg"></source>
<source src="media/a_note.wav" type="audio/wav"></source>
<source src="media/a_note.wav" type="audio/wav"></source>
</audio>
<audio id="bAudio">
<source src="media/b_note.mp3" type="audio/mpeg"></source>
<source src="media/b_note.ogg" type="audio/ogg"></source>
<source src="media/b_note.wav" type="audio/wav"></source>
<source src="media/b_note.wav" type="audio/wav"></source>
</audio>
</div>
<div class="instrument">
<button class="note c">c</button>
<div class="instrument">
<button class="note c">c</button>
<button class="note d">d</button>
<button class="note e">e</button>
<button class="note f">f</button>
Expand Down
7 changes: 6 additions & 1 deletion noise.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ html {
}

body {
background-color: black;
background-color: black;
}

#sky-header {
color: white;
font-family: 'Quicksand', sans-serif;
}

.instrument {
Expand Down
19 changes: 17 additions & 2 deletions noise.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
$(document).ready( function() {
// your code here
var loadPlay = function(sound) {
sound.load();
sound.play();
};

$(document).ready(function() {
$('.note').on('click', function() {
var noteSelected = $(this).html();
// alert("You played note: " + noteSelected);
var sound = $('#' + noteSelected + 'Audio')[0];
loadPlay(sound);
});

$('body').keydown(function(event) {
var sound = $('#' + event.key + 'Audio')[0];
loadPlay(sound);
});
});