From c072599d6c78f289f48bcf5a5f23cfb587bcb45a Mon Sep 17 00:00:00 2001 From: Philippe Loctaux Date: Thu, 18 May 2023 16:57:45 +0200 Subject: [PATCH] wallpaper: display placeholder while image loads --- src/components/wallpaper.astro | 88 +++++++++++++++++----------------- 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/src/components/wallpaper.astro b/src/components/wallpaper.astro index 69158bc..7d7a4ba 100644 --- a/src/components/wallpaper.astro +++ b/src/components/wallpaper.astro @@ -1,5 +1,4 @@ --- - import wallpapers from "../../public/wallpapers.json"; const wallpaper = wallpapers[Math.floor(Math.random() * wallpapers.length)]; @@ -11,53 +10,56 @@ const [location1, ...locationRest] = wallpaper.location.split(","); const location2 = locationRest.join(","); --- -
- - - - - +
+ + - -
-
- - - - {location1} + +
+ +
+
+ + + + {location1} +
-
- -
-
- - - - {wallpaper.date} + +
+
+ + + + {wallpaper.date} +