mirror of
https://github.com/danbulant/dribbblish-dynamic-theme
synced 2026-06-17 21:51:16 +00:00
make bgTheme a child of theme and reword stuff a little
This commit is contained in:
parent
164058b875
commit
1c4ba1a29d
1 changed files with 16 additions and 18 deletions
|
|
@ -488,15 +488,14 @@ Dribbblish.on("ready", () => {
|
||||||
$("html").css("--is_light", setDark ? 0 : 1);
|
$("html").css("--is_light", setDark ? 0 : 1);
|
||||||
|
|
||||||
switch (Dribbblish.config.get("bgTheme")) {
|
switch (Dribbblish.config.get("bgTheme")) {
|
||||||
case "grey":
|
case "bw":
|
||||||
textColorBg = setDark ? "#202020" : "#C0C0C0";
|
textColorBg = setDark ? "#0A0A0A" : "#FAFAFA";
|
||||||
break;
|
break;
|
||||||
case "nord":
|
case "nord":
|
||||||
textColorBg = setDark ? "#3B4252" : "#D8DEE9";
|
textColorBg = setDark ? "#3B4252" : "#D8DEE9";
|
||||||
break;
|
break;
|
||||||
case "bw":
|
case "grey":
|
||||||
default:
|
textColorBg = setDark ? "#202020" : "#C0C0C0";
|
||||||
textColorBg = setDark ? "#0A0A0A" : "#FAFAFA";
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -618,8 +617,8 @@ Dribbblish.on("ready", () => {
|
||||||
description: "Select Dark / Bright mode",
|
description: "Select Dark / Bright mode",
|
||||||
defaultValue: "time",
|
defaultValue: "time",
|
||||||
showChildren: (val) => {
|
showChildren: (val) => {
|
||||||
if (val == "time") return ["darkModeOnTime", "darkModeOffTime"];
|
if (val == "time") return ["darkModeOnTime", "darkModeOffTime", "bgTheme"];
|
||||||
return false;
|
return ["bgTheme"];
|
||||||
},
|
},
|
||||||
onChange: (val) => {
|
onChange: (val) => {
|
||||||
switch (val) {
|
switch (val) {
|
||||||
|
|
@ -652,21 +651,20 @@ Dribbblish.on("ready", () => {
|
||||||
defaultValue: "06:00",
|
defaultValue: "06:00",
|
||||||
fireInitialChange: false,
|
fireInitialChange: false,
|
||||||
onChange: checkDarkLightMode
|
onChange: checkDarkLightMode
|
||||||
|
},
|
||||||
|
{
|
||||||
|
area: "Theme",
|
||||||
|
type: "select",
|
||||||
|
data: { bw: "Black / White", nord: "Nord", grey: "Greyish" },
|
||||||
|
key: "bgTheme",
|
||||||
|
name: "Background Theme",
|
||||||
|
description: "Select which colors should be used as main background colors",
|
||||||
|
defaultValue: "bw",
|
||||||
|
onChange: () => toggleDark($("html").css("--is_light") == "0")
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
Dribbblish.config.register({
|
|
||||||
area: "Theme",
|
|
||||||
type: "select",
|
|
||||||
data: { bw: "Black/white", nord: "Nord polar night/snow storm", grey: "Dark/light grey" },
|
|
||||||
key: "bgTheme",
|
|
||||||
name: "Background Theme",
|
|
||||||
description: "Select Dark / Bright background colors",
|
|
||||||
defaultValue: "bw",
|
|
||||||
onChange: () => toggleDark($("html").css("--is_light") == "0")
|
|
||||||
});
|
|
||||||
|
|
||||||
function updateColors(checkDarkMode = true, sideColHex) {
|
function updateColors(checkDarkMode = true, sideColHex) {
|
||||||
if (sideColHex == undefined) return registerCoverListener();
|
if (sideColHex == undefined) return registerCoverListener();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue