From b432fa4d6bf8a08a99a0ca9465b11472668d9f47 Mon Sep 17 00:00:00 2001 From: booploops <49113086+booploops@users.noreply.github.com> Date: Tue, 10 May 2022 02:17:44 -0700 Subject: [PATCH] added some attributes for themes https://docs.cider.sh/themes/available-attributes --- src/renderer/main/vueapp.js | 7 ++++++- src/renderer/views/main.ejs | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/renderer/main/vueapp.js b/src/renderer/main/vueapp.js index 9ddb2f88..6764e0de 100644 --- a/src/renderer/main/vueapp.js +++ b/src/renderer/main/vueapp.js @@ -828,8 +828,9 @@ const app = new Vue({ } }); - this.mk.addEventListener(MusicKit.Events.playbackStateDidChange, () => { + this.mk.addEventListener(MusicKit.Events.playbackStateDidChange, (event) => { ipcRenderer.send('wsapi-updatePlaybackState', wsapi.getAttributes()); + document.body.setAttribute("playback-state", event.state == 2 ? "playing" : "paused") }) this.mk.addEventListener(MusicKit.Events.playbackTimeDidChange, (a) => { @@ -887,8 +888,10 @@ const app = new Vue({ if (type.includes("musicVideo") || type.includes("uploadedVideo") || type.includes("music-movie")) { document.getElementById("apple-music-video-container").style.display = "block"; + document.body.setAttribute("video-playing", "true") // app.chrome.topChromeVisible = false } else { + document.body.removeAttribute("video-playing") document.getElementById("apple-music-video-container").style.display = "none"; // app.chrome.topChromeVisible = true } @@ -3869,12 +3872,14 @@ const app = new Vue({ el.play() }) document.querySelector("body").classList.remove("stopanimation") + document.body.setAttribute("focus-state", "focused") this.animateBackground = true } else { document.querySelectorAll(".animated-artwork-video").forEach(el => { el.pause() }) document.querySelector("body").classList.add("stopanimation") + document.body.setAttribute("focus-state", "blurred") this.animateBackground = false } }, diff --git a/src/renderer/views/main.ejs b/src/renderer/views/main.ejs index 15f02bf9..8d2a0b98 100644 --- a/src/renderer/views/main.ejs +++ b/src/renderer/views/main.ejs @@ -65,7 +65,7 @@
<%- include("../assets/cider-round.svg") %>
-
+
<%- include('app/chrome-top'); %>