From 795a13382cfd7cd16809d9976855144ea19ac45b Mon Sep 17 00:00:00 2001 From: RemiSaurel Date: Thu, 25 Aug 2022 14:28:14 +0200 Subject: [PATCH] easter eggs, background colors, refactor --- src/App.vue | 54 ++++++++++++----------- src/components/Pomodoro.vue | 4 ++ src/components/Settings.vue | 83 ++++++++++++++++++++++++++++++++++++ src/components/ToDoList.vue | 46 ++++++++++++-------- src/components/YtbPlayer.vue | 20 ++++++--- src/data/lofi.json | 5 +++ 6 files changed, 162 insertions(+), 50 deletions(-) create mode 100644 src/components/Settings.vue 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