diff --git a/src/App.vue b/src/App.vue index 6550f6c..727a82c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,7 @@ @@ -21,6 +21,8 @@ export default { return { displayYoutube: true, livesId: [], + easterEggs: [], + easterEggsSongsId:-1, songId: 0 } }, @@ -29,20 +31,26 @@ export default { { let lofi = require("../data/lofi.json"); this.livesId = lofi.id; + this.easterEggs = lofi.easterEggs; }, nextPlaylist() { this.songId++ === this.livesId.length - 1 ? this.songId = 0 : this.songId; let id = this.livesId[this.songId]; - let ytb = document.getElementById("youtube_video") - ytb.src = "https://www.youtube.com/embed/" + id + "?autoplay=1"; + this.changeYtbSrc(id) }, prevPlaylist() { --this.songId === -1 ? this.songId = this.livesId.length - 1: this.songId; - console.log(this.songId) - console.log(this.livesId.length) let id = this.livesId[this.songId]; + this.changeYtbSrc(id) + }, + easterEgg() { + this.easterEggsSongsId++ === this.easterEggs.length - 1 ? this.easterEggsSongsId = 0 : this.easterEggsSongsId; + let id = this.easterEggs[this.easterEggsSongsId]; + this.changeYtbSrc(id) + }, + changeYtbSrc(id) { let ytb = document.getElementById("youtube_video") ytb.src = "https://www.youtube.com/embed/" + id + "?autoplay=1"; } diff --git a/src/data/lofi.json b/src/data/lofi.json index 83191c8..9710c53 100644 --- a/src/data/lofi.json +++ b/src/data/lofi.json @@ -6,5 +6,10 @@ "-5KAN9_CzSA", "jfKfPfyJRdk", "GDQnA1LVCWA" + ], + "easterEggs": [ + "VDgaKWRuhRU", + "wp_QTEDQZsU", + "mgtu7u9PKkI" ] } \ No newline at end of file