drum-machine add notification to .focus(); with 'v' key

This commit is contained in:
2020-05-27 12:52:54 -07:00
parent a76e33a644
commit b137e5e185
2 changed files with 11 additions and 4 deletions

View File

@ -80,6 +80,8 @@ $(document).ready(function () {
padsArray.forEach(pad => {
makeMetronomeIcons(pad);
});
$('#display-top').html('<p id="volumeTip">press "V" to focus Volume so you can adjust with arrow keys</p>');
});
const makeMetronomeIcons = (pad) => {
@ -110,7 +112,7 @@ const qweasdzxc = [81,87,69,65,83,68,90,88,67];
const playSample = (key) => {
const audioFileText = $('#'+key[0]).attr('src').slice(36)
$('#display-top').html(key[0] +": " + audioFileText.replace(/\//g,' ').replace(/-/g,'&#8209;'));
$('#display-top').html( "<p>" + key[0] +": " + audioFileText.replace(/\//g,' ').replace(/-/g,'&#8209;') + "</p>");
if (sessionStorage.getItem(key[0] + 'isMetronome') === 'false') {
const keyDuration = 1000;
const sound = document.getElementById(key[0]);