Canvas-based seasonal weather effects + demo page

Server picks variant from Lisbon-local date (rain/petals/jacaranda/motes/leaves)
and renders behind content via a canvas particle layer. Each variant has a
hand-drawn silhouette so shapes are recognizable. /weather demo route exposes
variant + intensity + phase pickers, locking the time-of-day phase override.
This commit is contained in:
prosolis
2026-05-25 09:20:35 -07:00
parent 5ea64c1d32
commit 24103394ae
7 changed files with 413 additions and 3 deletions

View File

@@ -48,7 +48,7 @@ type Server struct {
// gets its own template set sharing layout.html + _card.html, which avoids
// `main` define collisions between pages.
func New(cfg config.WebConfig) (*Server, error) {
pages := []string{"index", "channel"}
pages := []string{"index", "channel", "weather"}
tpls := make(map[string]*template.Template, len(pages))
for _, p := range pages {
t, err := template.New("").Funcs(funcs).ParseFS(templateFS,
@@ -72,6 +72,7 @@ func New(cfg config.WebConfig) (*Server, error) {
mux.HandleFunc("GET /img/{name}", s.handleImg)
mux.HandleFunc("GET /{$}", s.handleIndex)
mux.HandleFunc("GET /weather", s.handleWeatherDemo)
for _, ch := range channels {
ch := ch
mux.HandleFunc("GET /"+ch.Slug, func(w http.ResponseWriter, r *http.Request) {