From 48f0c30d47d62e4f35706edb93a1bb2f97eba14c Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.net>
Date: Sun, 1 Mar 2026 16:04:11 -0800
Subject: chore(biome): enable svelte formatting

---
 src/lib/User/BadgeWall/BadgePreview.svelte | 178 ++++++++++++++---------------
 1 file changed, 89 insertions(+), 89 deletions(-)

(limited to 'src/lib/User/BadgeWall/BadgePreview.svelte')

diff --git a/src/lib/User/BadgeWall/BadgePreview.svelte b/src/lib/User/BadgeWall/BadgePreview.svelte
index 062fdac7..cf0cb284 100644
--- a/src/lib/User/BadgeWall/BadgePreview.svelte
+++ b/src/lib/User/BadgeWall/BadgePreview.svelte
@@ -1,104 +1,104 @@
 <script lang="ts">
-  import Spacer from '$lib/Layout/Spacer.svelte';
-  import { thumbnail } from '$lib/Utility/image';
-  import type { Badge } from '$lib/Database/SB/User/badges';
-  import { cdn } from '$lib/Utility/image';
-  import { databaseTimeToDate } from '$lib/Utility/time';
-  import locale from '$stores/locale';
-  import { onMount } from 'svelte';
-  import root from '$lib/Utility/root';
-  import ParallaxImage from '$lib/Image/ParallaxImage.svelte';
-
-  export let selectedBadge: Badge | undefined;
-  export let onNext: () => void = () => undefined;
-  export let onPrevious: () => void = () => undefined;
-  export let hasNext: boolean;
-  export let hasPrevious: boolean;
-
-  let source = cdn(thumbnail(selectedBadge?.image || '')) || '';
-  let badgeReference: HTMLImageElement;
-
-  $: {
-    if (selectedBadge && selectedBadge.image) {
-      const image = new Image();
-
-      image.src = cdn(selectedBadge.image) || '';
-      image.onload = () => {
-        source = image.src;
-      };
-    }
-  }
-
-  $: {
-    if (selectedBadge)
-      fetch(root(`/api/badges?incrementClickCount=${selectedBadge.id}`), {
-        method: 'PUT'
-      });
+import Spacer from '$lib/Layout/Spacer.svelte';
+import { thumbnail } from '$lib/Utility/image';
+import type { Badge } from '$lib/Database/SB/User/badges';
+import { cdn } from '$lib/Utility/image';
+import { databaseTimeToDate } from '$lib/Utility/time';
+import locale from '$stores/locale';
+import { onMount } from 'svelte';
+import root from '$lib/Utility/root';
+import ParallaxImage from '$lib/Image/ParallaxImage.svelte';
+
+export let selectedBadge: Badge | undefined;
+export let onNext: () => void = () => undefined;
+export let onPrevious: () => void = () => undefined;
+export let hasNext: boolean;
+export let hasPrevious: boolean;
+
+let source = cdn(thumbnail(selectedBadge?.image || '')) || '';
+let badgeReference: HTMLImageElement;
+
+$: {
+  if (selectedBadge && selectedBadge.image) {
+    const image = new Image();
+
+    image.src = cdn(selectedBadge.image) || '';
+    image.onload = () => {
+      source = image.src;
+    };
   }
+}
 
-  onMount(() => {
-    badgeReference = document.querySelector('.badge-container-image') as HTMLImageElement;
+$: {
+  if (selectedBadge)
+    fetch(root(`/api/badges?incrementClickCount=${selectedBadge.id}`), {
+      method: 'PUT'
+    });
+}
 
-    const handleClickOutside = (event: MouseEvent) => {
-      if ((event.target as HTMLElement).classList.contains('popup')) selectedBadge = undefined;
-    };
+onMount(() => {
+  badgeReference = document.querySelector('.badge-container-image') as HTMLImageElement;
 
-    document.addEventListener('click', handleClickOutside);
+  const handleClickOutside = (event: MouseEvent) => {
+    if ((event.target as HTMLElement).classList.contains('popup')) selectedBadge = undefined;
+  };
 
-    return () => {
-      document.removeEventListener('click', handleClickOutside);
-    };
-  });
-
-  const classifySource = (source: string) => {
-    let name = source;
-    const sourceLower = source.toLowerCase();
-
-    if (sourceLower.includes('pixiv.net')) {
-      name = 'Pixiv';
-    } else if (sourceLower.includes('twitter.com') || sourceLower.includes('x.com')) {
-      name = 'X (Twitter)';
-    } else if (sourceLower.includes('zerochan.net')) {
-      name = 'Zerochan';
-    } else if (sourceLower.includes('imgur.com')) {
-      name = 'Imgur';
-    } else if (sourceLower.includes('lofter.com')) {
-      name = 'Lofter';
-    }
+  document.addEventListener('click', handleClickOutside);
 
-    return `<a href="${source}" target="_blank">${name}</a>`;
+  return () => {
+    document.removeEventListener('click', handleClickOutside);
   };
+});
+
+const classifySource = (source: string) => {
+  let name = source;
+  const sourceLower = source.toLowerCase();
+
+  if (sourceLower.includes('pixiv.net')) {
+    name = 'Pixiv';
+  } else if (sourceLower.includes('twitter.com') || sourceLower.includes('x.com')) {
+    name = 'X (Twitter)';
+  } else if (sourceLower.includes('zerochan.net')) {
+    name = 'Zerochan';
+  } else if (sourceLower.includes('imgur.com')) {
+    name = 'Imgur';
+  } else if (sourceLower.includes('lofter.com')) {
+    name = 'Lofter';
+  }
 
-  const classifyDesigner = (designer: string) => {
-    let name = designer;
-    let userLink = designer;
-    const designerLower = designer.toLowerCase();
-    const anilistUser = designer.match(/https?:\/\/anilist\.co\/user\/([^/]+)\/?/);
-
-    if (anilistUser) {
-      name = anilistUser[1];
-    } else if (designerLower.startsWith('@')) {
-      name = designer.replace('@', '');
-      userLink = `https://anilist.co/user/${name}/`;
-    } else if (!designerLower.startsWith('http')) {
-      userLink = `https://anilist.co/user/${name}/`;
-    }
+  return `<a href="${source}" target="_blank">${name}</a>`;
+};
+
+const classifyDesigner = (designer: string) => {
+  let name = designer;
+  let userLink = designer;
+  const designerLower = designer.toLowerCase();
+  const anilistUser = designer.match(/https?:\/\/anilist\.co\/user\/([^/]+)\/?/);
+
+  if (anilistUser) {
+    name = anilistUser[1];
+  } else if (designerLower.startsWith('@')) {
+    name = designer.replace('@', '');
+    userLink = `https://anilist.co/user/${name}/`;
+  } else if (!designerLower.startsWith('http')) {
+    userLink = `https://anilist.co/user/${name}/`;
+  }
 
-    return `<a href="${userLink}" target="_blank">@${name}</a>`;
-  };
+  return `<a href="${userLink}" target="_blank">@${name}</a>`;
+};
 
-  const onClick = (event: MouseEvent) => {
-    event.preventDefault();
+const onClick = (event: MouseEvent) => {
+  event.preventDefault();
 
-    if (
-      event.clientX <
-      badgeReference.getBoundingClientRect().left + badgeReference.getBoundingClientRect().width / 2
-    ) {
-      onPrevious();
-    } else {
-      onNext();
-    }
-  };
+  if (
+    event.clientX <
+    badgeReference.getBoundingClientRect().left + badgeReference.getBoundingClientRect().width / 2
+  ) {
+    onPrevious();
+  } else {
+    onNext();
+  }
+};
 </script>
 
 {#if selectedBadge}
-- 
cgit v1.2.3

