mirror of
https://github.com/danbulant/dribbblish-dynamic-theme
synced 2026-06-07 08:40:44 +00:00
Channge OS Icon dodge to a config item so it stays after theme updates
This commit is contained in:
parent
3cdee1d9b3
commit
57c05e73a1
1 changed files with 25 additions and 9 deletions
|
|
@ -3,27 +3,43 @@
|
||||||
const DribbblishShared = {
|
const DribbblishShared = {
|
||||||
configMenu: new Spicetify.Menu.SubMenu("Dribbblish", []),
|
configMenu: new Spicetify.Menu.SubMenu("Dribbblish", []),
|
||||||
rightBigCover: localStorage.getItem("dribs-right-big-cover") === "true",
|
rightBigCover: localStorage.getItem("dribs-right-big-cover") === "true",
|
||||||
setRightBigCover: () => {
|
osIconDodge: localStorage.getItem("dribs-os-icon-dodge") === "true",
|
||||||
|
updateConfig: () => {
|
||||||
if (DribbblishShared.rightBigCover) {
|
if (DribbblishShared.rightBigCover) {
|
||||||
document.documentElement.classList.add("right-expanded-cover");
|
document.documentElement.classList.add("right-expanded-cover");
|
||||||
} else {
|
} else {
|
||||||
document.documentElement.classList.remove("right-expanded-cover");
|
document.documentElement.classList.remove("right-expanded-cover");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (DribbblishShared.osIconDodge) {
|
||||||
|
document.documentElement.style.setProperty("--os-windows-icon-dodge", 1);
|
||||||
|
} else {
|
||||||
|
document.documentElement.style.setProperty("--os-windows-icon-dodge", 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
DribbblishShared.configMenu.register();
|
DribbblishShared.configMenu.register();
|
||||||
DribbblishShared.configMenu.addItem(new Spicetify.Menu.Item(
|
DribbblishShared.configMenu.addItem(
|
||||||
"Right expanded cover",
|
new Spicetify.Menu.Item("Right expanded cover", DribbblishShared.rightBigCover, (self) => {
|
||||||
DribbblishShared.rightBigCover,
|
|
||||||
(self) => {
|
|
||||||
self.isEnabled = !self.isEnabled;
|
self.isEnabled = !self.isEnabled;
|
||||||
DribbblishShared.rightBigCover = self.isEnabled;
|
DribbblishShared.rightBigCover = self.isEnabled;
|
||||||
localStorage.setItem("dribs-right-big-cover", self.isEnabled);
|
localStorage.setItem("dribs-right-big-cover", self.isEnabled);
|
||||||
DribbblishShared.setRightBigCover();
|
DribbblishShared.updateConfig();
|
||||||
}
|
})
|
||||||
));
|
);
|
||||||
DribbblishShared.setRightBigCover();
|
|
||||||
|
DribbblishShared.configMenu.register();
|
||||||
|
DribbblishShared.configMenu.addItem(
|
||||||
|
new Spicetify.Menu.Item("OS Icon Dodge", DribbblishShared.osIconDodge, (self) => {
|
||||||
|
self.isEnabled = !self.isEnabled;
|
||||||
|
DribbblishShared.osIconDodge = self.isEnabled;
|
||||||
|
localStorage.setItem("dribs-os-icon-dodge", self.isEnabled);
|
||||||
|
DribbblishShared.updateConfig();
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
DribbblishShared.updateConfig();
|
||||||
|
|
||||||
function waitForElement(els, func, timeout = 100) {
|
function waitForElement(els, func, timeout = 100) {
|
||||||
const queries = els.map(el => document.querySelector(el));
|
const queries = els.map(el => document.querySelector(el));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue