feat: add seasonal halloween theme (#784)

Co-authored-by: Sophie L <beartechtalks@gmail.com>
This commit is contained in:
4444dogs 2022-09-20 11:26:20 -06:00 committed by GitHub
parent b649b2a923
commit 9b6abe374a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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