Seasonal engine
Shows snow and Christmas lights on every page, when the person turned them on. Off by default.
- What it does
- Holds whether the seasonal effects (snow and Christmas lights) are on.
- Exported from the package?
- Yes. Import
setSeasonalEffectsandseasonalStatefrom@davidnet-net/svelte-ui.
setSeasonalEffects
typescript
typescript
function setSeasonalEffects(enabled: boolean): voidsetSeasonalEffects(enabled) turns the effects on or off and stores the choice in the seasonal_cache cookie. It does not save the choice to the account.
When to use
Use it in a settings screen. AppShell reads the cookie on start, and the account preference replaces it after sign-in.
When not to use, and what to use instead
Do not draw your own snow or lights on top of the app: AppShell shows the effects, and never in a contrast theme.
Live example
Checking the session…
Result Effects on: off
typescript
typescript
import { setSeasonalEffects } from "@davidnet-net/svelte-ui";
setSeasonalEffects(true);
setSeasonalEffects(false);