feat(midsummer): retire the theme out of season (holiday over)

Flip the seasonal master switch (SEASON_ACTIVE=false in useMidsummer) so the
Sma Grodorna theme is fully dormant — no rain/frogs/maypole/banner/palette,
regardless of any stored toggle preference — and remove the 🐸 toggle from the
sidebar. All theme code is kept; to bring it back next Midsummer, flip
SEASON_ACTIVE to true and re-add <FrogToggle /> in SidebarWindowButtons.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-24 08:12:00 +02:00
parent 0565a54ae5
commit cc686da532
15 changed files with 39 additions and 27 deletions

View file

@ -2,6 +2,13 @@ import React, { createContext, useContext, useState, useEffect, useCallback } fr
const KEY = 'mo-midsummer';
// Seasonal master switch. The Små grodorna theme is only active around
// Midsummer week. Out of season this is false → the theme is fully dormant
// (no rain/frogs/maypole/banner/palette) regardless of any stored preference,
// and the 🐸 toggle is removed from the sidebar. To bring it back next year:
// flip this to true and re-add <FrogToggle /> in SidebarWindowButtons.tsx.
const SEASON_ACTIVE = false;
interface MidsummerCtx {
enabled: boolean;
toggle: () => void;
@ -10,17 +17,24 @@ interface MidsummerCtx {
const Ctx = createContext<MidsummerCtx | null>(null);
export const MidsummerProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
// Default ON: only the literal "off" disables it.
const [enabled, setEnabled] = useState<boolean>(() => localStorage.getItem(KEY) !== 'off');
// In season, default ON (only the literal "off" disables). Out of season,
// always off — the stored preference is ignored.
const [pref, setPref] = useState<boolean>(() => localStorage.getItem(KEY) !== 'off');
const enabled = SEASON_ACTIVE && pref;
useEffect(() => {
const el = document.documentElement;
if (enabled) el.setAttribute('data-midsummer', '');
else el.removeAttribute('data-midsummer');
localStorage.setItem(KEY, enabled ? 'on' : 'off');
}, [enabled]);
const toggle = useCallback(() => setEnabled(e => !e), []);
const toggle = useCallback(() => {
setPref(p => {
const next = !p;
localStorage.setItem(KEY, next ? 'on' : 'off');
return next;
});
}, []);
return (
<Ctx.Provider value={{ enabled, toggle }}>