diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index b0ca83b..848156b 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -171,8 +171,8 @@

- total visits = {data.visitCount.toString().padStart(9, "0")} - uniq recent visits = {data.lastVisitors.size.toString().padStart(3, "0")} + total visits = {data.visitCount.toString().padStart(9, ".")} + uniq recent visits = {data.lastVisitors.size.toString().padStart(3, ".")}

diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts index 8644260..7f0c474 100644 --- a/src/routes/+page.server.ts +++ b/src/routes/+page.server.ts @@ -4,10 +4,18 @@ import { steamGetNowPlaying } from "$lib/steam" export const load = async ({}) => { const lastTrack = await lastFmGetNowPlaying() const lastGame = await steamGetNowPlaying() - const banners = [getBannerNo(), getBannerNo(), getBannerNo()] + let banners: number[] = [] + while (banners.length < 3) { + const no = getBannerNo(banners) + banners.push(no) + } return {banners, lastTrack, lastGame} } -const getBannerNo = () => { - return Math.floor(Math.random() * 18) + 1; +const getBannerNo = (others: number[]) => { + const no = Math.floor(Math.random() * 20) + 1 + if (others.includes(no)) { + return ((no + (Math.floor(Math.random() * 20))) % 20) + 1 + } + return no }; \ No newline at end of file diff --git a/static/banners/19.gif b/static/banners/19.gif new file mode 100644 index 0000000..6868650 Binary files /dev/null and b/static/banners/19.gif differ diff --git a/static/banners/20.gif b/static/banners/20.gif new file mode 100644 index 0000000..53a615a Binary files /dev/null and b/static/banners/20.gif differ