for (const element of document.getElementsByClassName("song")) {
m_allSongs.push(element);
}
+
+ // Volume
+ var vol = document.getElementById("volume-slider");
+ vol.oninput = function() {
+ console.log("updateVolume", vol);
+ audio.volume = vol.value;
+ }
+
});
padding: 5px;
}
+/* Sliders (e.g. volume) */
+
+input[type=range] {
+ -webkit-appearance: none; /* Hides the slider so that custom slider can be made */
+ background: var(--black); /* Otherwise white in Chrome */
+ height: 4px;
+ border-radius: 2px;
+}
+
+input[type=range]::-webkit-slider-thumb {
+ -webkit-appearance: none;
+ border: none;
+ height: 14px;
+ width: 14px;
+ border-radius: 7px;
+ background: var(--purple);
+ cursor: pointer;
+}
+
+input[type=range]::-moz-range-thumb {
+ border: none;
+ height: 14px;
+ width: 14px;
+ border-radius: 7px;
+ background: var(--purple);
+ cursor: pointer;
+}
+
/* Navbar */
div.navbar {
display: flex;
padding: 10px;
}
-div.player-controls {
+.player-controls {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
border: none;
}
-.player-button img {
- image-rendering: pixelated;
- width: 32px;
-}
-
#player-position {
display: inline-block;
position: relative;
- width: 50%;
height: 32px;
+ width: 50%;
}
#player-position-bar {
top: 14px;
width: 100%;
height: 4px;
+ border-radius: 2px;
}
#player-position-dot {
position: absolute;
display: inline-block;
- visibility: hidden;
background-color: var(--purple);
top: 6px;
width: 20px;
cursor: pointer;
}
+.player-button img {
+ image-rendering: pixelated;
+ width: 32px;
+}
+
+#volume-slider {
+ width: 25%;
+}
+
+.player-label {
+ font-size: 14px;
+}
+
/* Activity */
div.comment-notification {
margin: 10px;
box-shadow: 0px 0px 5px 0px;
border-radius: 10px;
}
+
+/* Platform-specific global overrides */
+@media screen and (max-width: 480px) {
+ .desktop-only {
+ display: none;
+ }
+}
<span class="player-time" id="player-total-time">0:00</span>
<audio id="player-audio"></audio>
</div>
+ <div class="player-controls desktop-only">
+ <label class="player-label" for="volume">Volume</label>
+ <input id="volume-slider" name="volume" type="range" min="0" max="1" step="any" value="1"/>
+ </div>
</div>
</div>
</body>
+- Activity indicator
+- Favicon
- YouTube importer
- Autoplay toggle
-- Volume control
- Shuffle all
- Song sorter for song lists
- Additional song info in player (collabs, description, tags)