feat: add seasonal halloween theme

pull/784/head
4444dogs 2022-09-18 08:25:32 -06:00
parent 6b9106c975
commit 1abc2c116e
1 changed files with 28 additions and 12 deletions

View File

@ -51,24 +51,40 @@ export default observer(() => {
state.settings.set("appearance:seasonal", !seasonalTheme);
const isDecember = !isTouchscreenDevice && new Date().getMonth() === 11;
const isOctober = !isTouchscreenDevice && new Date().getMonth() === 9
const snowflakes = useMemo(() => {
const flakes = [];
// Disable outside of December
if (!isDecember) return [];
if (isDecember) {
for (let i = 0; i < 15; i++) {
flakes.push("❄️");
flakes.push("❄");
}
for (let i = 0; i < 15; i++) {
flakes.push("❄️");
flakes.push("❄");
for (let i = 0; i < 2; i++) {
flakes.push("🎄");
flakes.push("☃️");
flakes.push("⛄");
}
return flakes;
}
if (isOctober) {
for (let i = 0; i < 15; i++) {
flakes.push("🎃");
flakes.push("💀");
}
for (let i = 0; i < 2; i++) {
flakes.push("👻");
flakes.push("⚰️");
flakes.push("🕷️");
}
return flakes;
}
for (let i = 0; i < 2; i++) {
flakes.push("🎄");
flakes.push("☃️");
flakes.push("⛄");
}
return flakes;
else return [];
}, []);
return (