From b8f7e622bbee068ac9e6a96c2307dbc7d7b02b14 Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Wed, 14 Oct 2020 22:52:21 +0200 Subject: Lazy load background image using XHR We now don't immediately reload the reddit background image, as this delays the initial page load quite a bit. Instead we trigger an XHR request on page load to update the background image. --- template.html | 69 +++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 55 insertions(+), 14 deletions(-) (limited to 'template.html') diff --git a/template.html b/template.html index ffb833c..4b20536 100644 --- a/template.html +++ b/template.html @@ -4,16 +4,17 @@ Startpage - + {{ if .Weather }}
@@ -99,13 +100,53 @@
Weather forecast from Yr, delivered by the Norwegian Meteorological Institute and NRK
{{ end }} - {{ if .BgImage }} - - {{ .BgImage.Title }}{{ if .CanSaveBg}} - | {{ if .BgImage.Saved }}saved{{ else }}save{{ end }} - {{ end }} - - {{ end}} + + + -- cgit v1.2.3-70-g09d2