From 7133088e8a15007b514d105870ea8b3b9dc69e20 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Wed, 3 Jun 2026 00:17:02 +0000 Subject: feat: synchronize background image rotation across sessions Server seeds bg URL from a 5-minute time bucket so all open sessions show the same image simultaneously. Client-side JS rotates in sync and prefetches the next image on the same interval. Co-Authored-By: Claude Sonnet 4.6 --- internal/handlers/handlers.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'internal/handlers') diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index bd14e65..19d26be 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -92,9 +92,8 @@ func (h *Handler) HandleDashboard(w http.ResponseWriter, r *http.Request) { return } - // Generate random background URL (Lorem Picsum - CORS-friendly) - // Add random seed to get different image each load - backgroundURL := fmt.Sprintf("https://picsum.photos/1920/1080?random=%d", time.Now().UnixNano()) + // Background URL: seed from 5-minute time bucket so all sites show the same image simultaneously + backgroundURL := fmt.Sprintf("https://picsum.photos/1920/1080?random=%d", time.Now().Unix()/300) // Wrap dashboard data with active tab for template data := struct { -- cgit v1.2.3