From 83d5d1491d7523352cd28dc3d77d450db9a1803f Mon Sep 17 00:00:00 2001 From: Philippe Loctaux
Date: Wed, 17 May 2023 23:59:03 +0200 Subject: [PATCH] wallpapers: be a bit more precise, hide precison on mobile --- src/components/wallpaper.astro | 7 ++++++- utils/wallpapers.ts | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/wallpaper.astro b/src/components/wallpaper.astro index 81e1a0c..69158bc 100644 --- a/src/components/wallpaper.astro +++ b/src/components/wallpaper.astro @@ -4,6 +4,11 @@ import wallpapers from "../../public/wallpapers.json"; const wallpaper = wallpapers[Math.floor(Math.random() * wallpapers.length)]; +// Get first part of location +const [location1, ...locationRest] = wallpaper.location.split(","); + +// Get rest of location +const location2 = locationRest.join(","); ---