From b03fa42c2d81cf34aa518a420c894c4ae86fac50 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sat, 24 Jan 2026 20:37:54 -1000 Subject: Add Conditions page with live volcano and weather feeds - Standalone full-screen page at /conditions - Tiled grid layout with autoplaying video feeds - USGS Kilauea webcams (V1cam, V2cam) via YouTube embeds - Windy weather maps (local Hawaii + national US) - Opens in new tab from dashboard nav Closes #29 Co-Authored-By: Claude Opus 4.5 --- cmd/dashboard/main.go | 2 + internal/handlers/handlers.go | 13 ++++ web/templates/conditions.html | 104 +++++++++++++++++++++++++ web/templates/index.html | 5 ++ web/templates/partials/conditions-tab.html | 121 +++++++++++++++++++++++++++++ 5 files changed, 245 insertions(+) create mode 100644 web/templates/conditions.html create mode 100644 web/templates/partials/conditions-tab.html diff --git a/cmd/dashboard/main.go b/cmd/dashboard/main.go index ce447ff..620b889 100644 --- a/cmd/dashboard/main.go +++ b/cmd/dashboard/main.go @@ -130,6 +130,7 @@ func main() { // Dashboard r.Get("/", h.HandleDashboard) + r.Get("/conditions", h.HandleConditionsPage) r.Post("/api/refresh", h.HandleRefresh) r.Get("/api/tasks", h.HandleGetTasks) r.Get("/api/meals", h.HandleGetMeals) @@ -142,6 +143,7 @@ func main() { r.Get("/tabs/meals", h.HandleTabMeals) r.Get("/tabs/timeline", h.HandleTimeline) r.Get("/tabs/shopping", h.HandleTabShopping) + r.Get("/tabs/conditions", h.HandleTabConditions) r.Post("/tabs/refresh", h.HandleRefreshTab) // Trello card operations diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index 366402e..5014f39 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -1274,6 +1274,19 @@ func (h *Handler) aggregateShoppingLists(ctx context.Context) []models.ShoppingS return stores } +// HandleTabConditions renders the Conditions tab with live feeds +func (h *Handler) HandleTabConditions(w http.ResponseWriter, r *http.Request) { + HTMLResponse(w, h.templates, "conditions-tab", nil) +} + +// HandleConditionsPage renders the standalone Conditions page with live feeds +func (h *Handler) HandleConditionsPage(w http.ResponseWriter, r *http.Request) { + if err := h.templates.ExecuteTemplate(w, "conditions.html", nil); err != nil { + http.Error(w, "Failed to render conditions page", http.StatusInternalServerError) + log.Printf("Error rendering conditions page: %v", err) + } +} + // isActionableList returns true if the list name indicates an actionable list func isActionableList(name string) bool { lower := strings.ToLower(name) diff --git a/web/templates/conditions.html b/web/templates/conditions.html new file mode 100644 index 0000000..5859a9c --- /dev/null +++ b/web/templates/conditions.html @@ -0,0 +1,104 @@ + + + + + + Conditions - Live Feeds + + + + + + ← Dashboard + +
+ +
+ + V1cam - Kilauea West +
+ + +
+ + V2cam - Kilauea East +
+ + +
+ + Local Weather +
+ + +
+ + National Weather +
+
+ + diff --git a/web/templates/index.html b/web/templates/index.html index 9687884..b55f348 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -72,6 +72,11 @@ onclick="setActiveTab(this)"> 🛒 Shopping + + 🌋 Conditions + diff --git a/web/templates/partials/conditions-tab.html b/web/templates/partials/conditions-tab.html new file mode 100644 index 0000000..94c2f99 --- /dev/null +++ b/web/templates/partials/conditions-tab.html @@ -0,0 +1,121 @@ +{{define "conditions-tab"}} +
+ +
+

+ 🌋 Kilauea Webcams + (auto-refresh every 60s) +

+
+ +
+ + V1cam - West Rim + +
+ V1cam - West Rim +
+
+ + +
+ + V2cam - East Rim + +
+ V2cam - East Rim +
+
+ + +
+ + F1cam - Thermal + +
+ F1cam - Thermal +
+
+
+ +
+ + +
+ +
+

+ 🌴 Local Weather +

+
+
+ +
+ +
+
+ + +
+

+ 🇺🇸 National Weather +

+
+
+ +
+ +
+
+
+
+ + +{{end}} -- cgit v1.2.3