From 41c0481380661d4db52112d061b7db1af164a5c4 Mon Sep 17 00:00:00 2001 From: Wim Brand Date: Fri, 2 Oct 2026 13:31:16 +0200 Subject: [PATCH] Add two random glows with dithering as background. --- svelte/src/wrap/MainMenu.svelte | 47 ++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/svelte/src/wrap/MainMenu.svelte b/svelte/src/wrap/MainMenu.svelte index f0070fc..7f7388c 100644 --- a/svelte/src/wrap/MainMenu.svelte +++ b/svelte/src/wrap/MainMenu.svelte @@ -30,6 +30,15 @@ const min_screen_size_fullscreen_menu = 500 // If the screen is smaller than this the menu will be closed by default const min_screen_size_menu_open = 800 +// The two background glows get a random position on each page load, in percent +// of the viewport. The second one is rerolled until it's at least 40% away from +// the first +const glow = [Math.random() * 100, Math.random() * 100, 0, 0] +do { + glow[2] = Math.random() * 100 + glow[3] = Math.random() * 100 +} while (Math.hypot(glow[0] - glow[2], glow[1] - glow[3]) < 40) + onMount(async () => { if (document.documentElement.clientWidth < min_screen_size_menu_open) { menu_close() @@ -163,7 +172,13 @@ const set_offset = (off: number) => { -
+