1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

weather: fix icons

This commit is contained in:
bbedward
2025-12-24 00:33:54 -05:00
parent 6c56d23b93
commit 8fdc748ed2
3 changed files with 120 additions and 152 deletions

View File

@@ -151,56 +151,15 @@ Singleton {
return conditions[String(code)] || "Unknown";
}
property var moonWeatherIcons: ({
"0": "",
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
"6": "",
"7": "",
"8": "",
"9": "",
"10": "",
"11": "",
"12": "",
"13": "",
"14": "",
"15": "",
"16": "",
"17": "",
"18": "",
"19": "",
"20": "",
"21": "",
"22": "",
"23": "",
"24": "",
"25": "",
"26": "",
"27": ""
})
property var moonMaterialIcons: ({
"0": "󰽤",
"1": "󰽧",
"2": "󰽡",
"3": "󰽦",
"4": "󰽢",
"5": "󰽨",
"6": "󰽣",
"7": "󰽥"
})
property var moonPhaseNames: ["moon_new", "moon_waxing_crescent", "moon_first_quarter", "moon_waxing_gibbous", "moon_full", "moon_waning_gibbous", "moon_last_quarter", "moon_waning_crescent"]
function getMoonPhase(date) {
const icons = moonWeatherIcons; // more icons in this set but thinner outline than material icons
// const icons = moonMaterialIcons
const iconCount = Object.keys(icons).length;
const phases = moonPhaseNames;
const iconCount = phases.length;
const moon = SunCalc.getMoonIllumination(date);
const index = ((Math.floor(moon.phase * iconCount + 0.5) % iconCount) + iconCount) % iconCount;
return icons[index];
return phases[index];
}
function getMoonAngle(date) {