From c32db7b90bd13f065ca74fdf2caacc4df4470bb3 Mon Sep 17 00:00:00 2001
From: axtloss <axtlos@disroot.org>
Date: Tue, 17 Sep 2024 20:25:25 +0200
Subject: optimize imagesx

---
 src/routes/Header.svelte | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

(limited to 'src/routes/Header.svelte')

diff --git a/src/routes/Header.svelte b/src/routes/Header.svelte
index d343a17..4490f1a 100644
--- a/src/routes/Header.svelte
+++ b/src/routes/Header.svelte
@@ -1,4 +1,5 @@
 <script context="module" lang="ts">
+
   export type Header = {
     addMessage (message: string, options?: Partial<MessageOptions>): void
   };
@@ -14,22 +15,22 @@
     dismissable: boolean,
   };
 
-  var chrome: boolean = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
 </script>
 
 <script lang="ts">
   import { page } from '$app/stores';
-  import logo from '/rose.gif';
-  import boowomp from '/wilted-flower.gif';
+  import logo from '/rose.apng';
+  import boowomp from '/wilted-flower.apng';
   import close from '$lib/assets/close.svg?raw';
   import { setContext } from "svelte";
   import { fly } from "svelte/transition";
   import { readable, writable } from "svelte/store";
   import { isNavigating } from "$lib/navigation.ts";
-
+  import { onMount } from 'svelte';
+ 
   const newestMessage = writable<HeaderMessage|null>(null);
 
-  const Rose = chrome ? boowomp : logo;
+  var Rose = chrome ? boowomp : logo;
 
   const currentMessage = writable<HeaderMessage|null>(null, (set) => {
     let $currentMessage: HeaderMessage|null = null;
@@ -75,7 +76,12 @@
 
     },
   });
-
+  
+  var chrome: boolean = false;
+  onMount(async () => {
+    chrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
+    Rose = chrome ? boowomp : logo;
+  });
 </script>
 
 <div class="main">
@@ -85,7 +91,7 @@
 	{#if $isNavigating}
 	  <span class="loader"></span>
 	{:else}
-	  <img id="logo" src={Rose} alt="rose"/>
+	    <img id="logo" src={Rose} alt="rose"/>
 	{/if}
 	<p>rose</p>
       </a>
-- 
cgit v1.2.3

