aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Tools/UmaMusumeBirthdays.svelte
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-03-01 16:20:51 -0800
committerFuwn <[email protected]>2026-03-01 16:21:02 -0800
commiteae5d24d9e79e59a19d4721caaeaa0ca650ecb33 (patch)
tree1b685bb248e051dfa26d2bfdebe6689402dd93c5 /src/lib/Tools/UmaMusumeBirthdays.svelte
parentchore(tooling): remove legacy eslint and prettier (diff)
downloaddue.moe-eae5d24d9e79e59a19d4721caaeaa0ca650ecb33.tar.xz
due.moe-eae5d24d9e79e59a19d4721caaeaa0ca650ecb33.zip
chore(biome): drop formatter style overrides
Diffstat (limited to 'src/lib/Tools/UmaMusumeBirthdays.svelte')
-rw-r--r--src/lib/Tools/UmaMusumeBirthdays.svelte70
1 files changed, 37 insertions, 33 deletions
diff --git a/src/lib/Tools/UmaMusumeBirthdays.svelte b/src/lib/Tools/UmaMusumeBirthdays.svelte
index 7d49cfaa..fc773bcb 100644
--- a/src/lib/Tools/UmaMusumeBirthdays.svelte
+++ b/src/lib/Tools/UmaMusumeBirthdays.svelte
@@ -1,50 +1,54 @@
<script lang="ts">
-import { browser } from '$app/environment';
-import { page } from '$app/stores';
-import RateLimitedError from '$lib/Error/RateLimited.svelte';
-import { onMount } from 'svelte';
-import { clearAllParameters, parseOrDefault } from '../Utility/parameters';
-import Skeleton from '$lib/Loading/Skeleton.svelte';
-import Message from '$lib/Loading/Message.svelte';
-import tooltip from '$lib/Tooltip/tooltip';
-import settings from '$stores/settings';
-import locale from '$stores/locale';
+import { browser } from "$app/environment";
+import { page } from "$app/stores";
+import RateLimitedError from "$lib/Error/RateLimited.svelte";
+import { onMount } from "svelte";
+import { clearAllParameters, parseOrDefault } from "../Utility/parameters";
+import Skeleton from "$lib/Loading/Skeleton.svelte";
+import Message from "$lib/Loading/Message.svelte";
+import tooltip from "$lib/Tooltip/tooltip";
+import settings from "$stores/settings";
+import locale from "$stores/locale";
interface Birthday {
- birth_day: number;
- birth_month: number;
- game_id: number;
- id: number;
- name_en: string;
- name_jp: string;
- preferred_url: string;
- sns_icon: string;
+ birth_day: number;
+ birth_month: number;
+ game_id: number;
+ id: number;
+ name_en: string;
+ name_jp: string;
+ preferred_url: string;
+ sns_icon: string;
}
-const urlParameters = browser ? new URLSearchParams(window.location.search) : null;
+const urlParameters = browser
+ ? new URLSearchParams(window.location.search)
+ : null;
let date = new Date();
-let month = parseOrDefault(urlParameters, 'month', date.getMonth() + 1);
-let day = parseOrDefault(urlParameters, 'day', date.getDate());
+let month = parseOrDefault(urlParameters, "month", date.getMonth() + 1);
+let day = parseOrDefault(urlParameters, "day", date.getDate());
let umapyoi: Promise<Birthday[]>;
$: {
- month = Math.min(month, 12);
- month = Math.max(month, 1);
- day = Math.min(day, new Date(new Date().getFullYear(), month, 0).getDate());
- day = Math.max(day, 1);
+ month = Math.min(month, 12);
+ month = Math.max(month, 1);
+ day = Math.min(day, new Date(new Date().getFullYear(), month, 0).getDate());
+ day = Math.max(day, 1);
- if (browser) {
- $page.url.searchParams.set('month', month.toString());
- $page.url.searchParams.set('day', day.toString());
- clearAllParameters(['month', 'day']);
- history.replaceState(null, '', `?${$page.url.searchParams.toString()}`);
- }
+ if (browser) {
+ $page.url.searchParams.set("month", month.toString());
+ $page.url.searchParams.set("day", day.toString());
+ clearAllParameters(["month", "day"]);
+ history.replaceState(null, "", `?${$page.url.searchParams.toString()}`);
+ }
}
onMount(() => {
- clearAllParameters(['month', 'day']);
+ clearAllParameters(["month", "day"]);
- umapyoi = fetch('https://umapyoi.net/api/v1/character/birthday').then((r) => r.json());
+ umapyoi = fetch("https://umapyoi.net/api/v1/character/birthday").then((r) =>
+ r.json(),
+ );
});
</script>