summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-06-03 00:17:02 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-06-03 00:17:02 +0000
commit7133088e8a15007b514d105870ea8b3b9dc69e20 (patch)
tree462076d8c0b034a08e6b98e1be4aeb4fbcf482fa /internal
parent787f0967307062d2a94530f9831c925e5dad6690 (diff)
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 <noreply@anthropic.com>
Diffstat (limited to 'internal')
-rw-r--r--internal/handlers/handlers.go5
1 files changed, 2 insertions, 3 deletions
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 {