NEW: smooth color transition

This commit is contained in:
Julien Maille 2021-06-03 21:37:39 +02:00
parent b53208cf5d
commit 8539ef806e

View file

@ -1,5 +1,6 @@
let current = '1.0'
let current = '2.3'
/* css needed for system mode detection */
document.styleSheets[0].insertRule(`
:root {
--system_is_dark: 1;
@ -11,6 +12,33 @@ document.styleSheets[0].insertRule(`
}
}`)
/* css for color transition */
document.styleSheets[0].insertRule(`
@property --spice-sidebar {
syntax: '<color>';
initial-value: magenta;
inherits: true;
}`)
document.styleSheets[0].insertRule(`
@property --spice-main {
syntax: '<color>';
initial-value: magenta;
inherits: true;
}`)
document.styleSheets[0].insertRule(`
@property --spice-button {
syntax: '<color>';
initial-value: magenta;
inherits: true;
}`)
document.styleSheets[0].insertRule(`
html {
transition: --spice-sidebar 1s, --spice-main 1s, --spice-button 1s;
}`)
function waitForElement(els, func, timeout = 100) {
const queries = els.map(el => document.querySelector(el));
if (queries.every(a => a)) {
@ -239,7 +267,7 @@ waitForElement([".cover-art-image"], (queries) => {
Spicetify.showNotification("Applied system " + (systemDark ? "dark" : "light") + " theme.")
})()
/* translucid background cover */
/* css for translucid background cover */
document.styleSheets[0].addRule('.main-view-container__scroll-node-child::before',
` content: '';
background-image: var(--image_url);