added some attributes for themes

https://docs.cider.sh/themes/available-attributes
This commit is contained in:
booploops 2022-05-10 02:17:44 -07:00
parent 44160dc104
commit b432fa4d6b
2 changed files with 7 additions and 2 deletions

View file

@ -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()); ipcRenderer.send('wsapi-updatePlaybackState', wsapi.getAttributes());
document.body.setAttribute("playback-state", event.state == 2 ? "playing" : "paused")
}) })
this.mk.addEventListener(MusicKit.Events.playbackTimeDidChange, (a) => { 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")) { if (type.includes("musicVideo") || type.includes("uploadedVideo") || type.includes("music-movie")) {
document.getElementById("apple-music-video-container").style.display = "block"; document.getElementById("apple-music-video-container").style.display = "block";
document.body.setAttribute("video-playing", "true")
// app.chrome.topChromeVisible = false // app.chrome.topChromeVisible = false
} else { } else {
document.body.removeAttribute("video-playing")
document.getElementById("apple-music-video-container").style.display = "none"; document.getElementById("apple-music-video-container").style.display = "none";
// app.chrome.topChromeVisible = true // app.chrome.topChromeVisible = true
} }
@ -3869,12 +3872,14 @@ const app = new Vue({
el.play() el.play()
}) })
document.querySelector("body").classList.remove("stopanimation") document.querySelector("body").classList.remove("stopanimation")
document.body.setAttribute("focus-state", "focused")
this.animateBackground = true this.animateBackground = true
} else { } else {
document.querySelectorAll(".animated-artwork-video").forEach(el => { document.querySelectorAll(".animated-artwork-video").forEach(el => {
el.pause() el.pause()
}) })
document.querySelector("body").classList.add("stopanimation") document.querySelector("body").classList.add("stopanimation")
document.body.setAttribute("focus-state", "blurred")
this.animateBackground = false this.animateBackground = false
} }
}, },

View file

@ -65,7 +65,7 @@
<div id="LOADER"> <div id="LOADER">
<%- include("../assets/cider-round.svg") %> <%- include("../assets/cider-round.svg") %>
</div> </div>
<div id="app" :class="getAppClasses()"> <div id="app" :class="getAppClasses()" :window-style="cfg.visual.directives.windowLayout">
<transition name="fsModeSwitch"> <transition name="fsModeSwitch">
<div id="app-main" v-show="appMode == 'player'"> <div id="app-main" v-show="appMode == 'player'">
<%- include('app/chrome-top'); %> <%- include('app/chrome-top'); %>