New Features
* Adds Shortcut for Next Track * Press 'n' for next track * Changes in Shortcut * Press SPACE for pause instead of 'x' (blah)
This commit is contained in:
@@ -19,9 +19,10 @@
|
||||
<div class="modal-container">
|
||||
<h3 class="text-center">Welcome to Retrowave Player</h3>
|
||||
<p class="mt-5">Here are the controls:</p>
|
||||
<h4 class="mt-5">Play/Pause <span class="controls">x or Click or Touch</span></h4>
|
||||
<h4 class="mt-5">Play/Pause <span class="controls">SPACE or Click or Touch</span></h4>
|
||||
<h4 class="mt-5">Volume Up <span class="controls">w or Swipe Up</span></h4>
|
||||
<h4 class="mt-5">Volume Down <span class="controls">s or Swipe Down</span></h4>
|
||||
<h4 class="mt-5">Next Track<span class="controls"> n or Press the Refresh Button</span></h4>
|
||||
<p class="mt-5">(You can download the music history of your current browser by clicking the history link on
|
||||
the player)</p>
|
||||
<p class="mt-5">All the music is fetched from retrowave.ru</p>
|
||||
|
||||
@@ -66,8 +66,9 @@
|
||||
|
||||
document.addEventListener("keyup", (event) => {
|
||||
const { key } = event;
|
||||
console.log("key pressed", key);
|
||||
switch (key) {
|
||||
case "x":
|
||||
case " ":
|
||||
togglePlay();
|
||||
break;
|
||||
case "a":
|
||||
@@ -80,6 +81,10 @@
|
||||
case "s":
|
||||
volumeDown();
|
||||
break;
|
||||
case "n":
|
||||
playNextTrack();
|
||||
break;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -230,6 +235,7 @@ https://retrowave.ru/${musicData.streamUrl}
|
||||
}
|
||||
|
||||
function playNextTrack() {
|
||||
resetHowler();
|
||||
currentTracks.shift();
|
||||
if (currentTracks.length <= 3) {
|
||||
getMusic();
|
||||
@@ -247,7 +253,6 @@ https://retrowave.ru/${musicData.streamUrl}
|
||||
|
||||
function initControls() {
|
||||
refreshBtn.addEventListener("click", () => {
|
||||
resetHowler();
|
||||
playNextTrack();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user