mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig.space.git
synced 2025-12-13 16:26:50 +00:00
🛠 Podcast categories and player
This commit is contained in:
@@ -42,4 +42,15 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
list.innerHTML = ""
|
||||
shuffle(items).forEach(item => list.appendChild(item))
|
||||
})
|
||||
|
||||
// Player
|
||||
if (window.Einundzwanzig.amplitude && window.Amplitude) {
|
||||
window.Amplitude.init(window.Einundzwanzig.amplitude)
|
||||
|
||||
document.querySelector('.player__progress').addEventListener('click', function (e) {
|
||||
var offset = this.getBoundingClientRect()
|
||||
var x = e.pageX - offset.left
|
||||
window.Amplitude.setSongPlayedPercentage((parseFloat(x) / parseFloat(this.offsetWidth)) * 100)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user