Replace default leaves with precipitation and procedural snowdrifts

This commit is contained in:
nyan404 committed 2026-11-24 16:50:24 +03:00
1 parent 2c17a52b5e
commit c85876f1db
13 files changed
+329 -83

No files matched your search

+10
View File
@@ -1,5 +1,15 @@
# Structure and Data
## Winter weather and procedural snowdrifts — 2026-11-24
- Calculator/admin have no default particles. ULLI METAR still controls rain, snow and mixed precipitation; clear weather, missing reports and API failure use `mode: none`. Initial HTML is an empty `.weather-field`, so no-JS/loading also stay quiet. Existing weather test expectations now use `none`; the calculator browser fixture also intercepts snow-cover requests.
- `app/belki/snow_cover.py` reads only [the owner's Climate Energy Saint Petersburg source](https://climate-energy.ru/weather/spravochnik/sndp/climate_sprav-sndp_260630687.php). The owner clarified that footer snow should use **total snow depth for the latest day**, not daily fresh snowfall. The source's “Свежевыпавший” option changes density for mass calculations; it does not report fresh snowfall.
- The parser reads `tek_parametry`, dated `data_N` literals and `tek_klim_znachenN` centimetres without executing JavaScript. It accepts explicit zero, decimal centimetres and dates at most 2 Moscow calendar days old. Missing, future, stale, malformed or oversized data are unavailable, never silently zero. Date labels lack years; the nearest calendar year handles New Year boundaries.
- `GET /api/weather/snow-cover` returns `{available, depth_cm, observed_on}`. The process cache is 30 minutes for valid data and 5 minutes after failure, with a nonblocking refresh lock, 4-second upstream timeout and 3 MiB cap. It is independent of METAR fetching; browser feeds also run independently, without credentials, and pause in hidden tabs. No database, runtime dependency, Docker or gateway change is needed.
- Both footers show a dated source link and white wind-sculpted snowdrifts. A DOM-created SVG generates 2–3 asymmetric banks, random widths/heights/crests and shaded lee faces once per page load. Polling preserves the silhouette; reload creates a new one. Visual height is `min(144, 20 + sqrt(depth_cm) * 20)` px for positive depth, otherwise zero. Particles/drifts never intercept pointer input; reduced motion stops precipitation.
- Inspected the real source and isolated HTTP endpoint: on 2026-11-24 it returned **0 cm dated 2026-11-24**, correctly showing no drifts. Local Chromium previews at 1280/390 px used synthetic 16 cm for visible drifts; inspected changing profiles after reload, snow/rain and reduced motion. Python AST, page/asset JavaScript syntax and `git diff --check` passed. Project test suites were not run or expanded, per current instructions. No push/deployment or cluster change. Temporary preview venv, server, SQLite stores, browser and screenshots were kept outside Git and cleaned up.
- This section supersedes the October leaf-fallback/no-JS notes below. The October production verification remains historical; the November implementation is local until separately deployed.
## Trainer sound and manual ratings — 2026-11-22
- `audio.js` synthesizes counted rustles using Web Audio; no media downloads or runtime dependencies. The sound and simplified views share one `min(7, neighbors)` level. Switching modes preserves the field and ratings and updates prior messages without showing verified numbers in sound mode during play.