Bring back winter snow effect, gated by an admin setting

The site has flip-flopped on the snow effect every winter (add it,
remove it, repeat), meaning a PR round-trip each time. Instead, restore
the winter.js/is-land assets and gate them behind a new admin-toggleable
setting so the effect can be switched on/off from /admin/settings
without touching code.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0113BVPXDpEk9HPEqXvSG2WQ
This commit is contained in:
Jonny Barnes 2026-08-23 10:17:26 +01:00
commit 9532aae37e
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
18 changed files with 377 additions and 0 deletions

View file

@ -0,0 +1,26 @@
@extends('master')
@section('title')Site Settings « Admin CP « @stop
@section('content')
<h1>Site settings</h1>
<form action="/admin/settings" method="post" accept-charset="utf-8" class="admin-form form">
{{ csrf_field() }}
{{ method_field('PUT') }}
<div>
<label for="winter_effect_enabled">
<input
type="checkbox"
name="winter_effect_enabled"
id="winter_effect_enabled"
value="1"
@checked(old('winter_effect_enabled', $settings?->winter_effect_enabled))
>
Show winter snow effect
</label>
</div>
<div>
<button type="submit" name="save">Save</button>
</div>
</form>
@stop

View file

@ -61,4 +61,9 @@
<p>
Manager <a href="/admin/passkeys">your passkeys</a>.
</p>
<h2>Settings</h2>
<p>
Edit <a href="/admin/settings">site settings</a>.
</p>
@stop

View file

@ -80,6 +80,17 @@
<!--scripts go here when needed-->
@section('scripts')
<script type="module" src="/assets/js/app.js"></script>
@if($winterEffectEnabled ?? false)
<script type="module" src="/assets/js/is-land.min.js"></script>
<script type="module" src="/assets/js/winter.js"></script>
<is-land on:media="(prefers-reduced-motion: no-preference)">
<snow-fall
count="150"
style="--snow-fall-color: var(--clr-snow-fall)"
></snow-fall>
</is-land>
@endif
@show
</body>
</html>