diff options
Diffstat (limited to 'src/routes')
| -rw-r--r-- | src/routes/+layout.svelte | 97 | ||||
| -rw-r--r-- | src/routes/+page.svelte | 14 | ||||
| -rw-r--r-- | src/routes/completed/+page.svelte | 10 |
3 files changed, 22 insertions, 99 deletions
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 35555269..39a2e40b 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -28,17 +28,11 @@ import settingsSyncPulled from "$stores/settingsSyncPulled"; import settingsSyncTimes from "$stores/settingsSyncTimes"; import Announcement from "$lib/Announcement.svelte"; import Message from "$lib/Loading/Message.svelte"; -import { addNotification } from "$lib/Notification/store"; import { requestNotifications } from "$lib/Utility/notifications"; -import { executiveCopy } from "$lib/Utility/executiveMode"; import { database as userDatabase } from "$lib/Database/IDB/user"; import CommandPalette from "$lib/CommandPalette/CommandPalette.svelte"; import { defaultActions } from "$lib/CommandPalette/actions"; import { toolsAsCommandPaletteActions } from "$lib/Tools/tools"; -import aprilFools, { - aprilFoolsVisible, - hydrateAprilFools, -} from "$stores/aprilFools"; import localforage from "localforage"; import { dev } from "$app/environment"; import { injectAnalytics } from "@vercel/analytics/sveltekit"; @@ -54,23 +48,6 @@ let previousScrollPosition = 0; let notificationInterval: ReturnType<typeof setInterval> | undefined = undefined; -const notifyExecutiveMode = (enabled: boolean) => { - addNotification({ - heading: "April Fools", - description: enabled - ? "Executive Mode has been activated for April Fools. All media are now deliverables. Use the header control if you need to revert to standard operations." - : "Executive Mode is off. Toggle it from the header if you want the April Fools joke back.", - duration: 5000, - }); -}; - -const toggleExecutiveMode = () => { - const nextEnabled = !$aprilFools; - - aprilFools.set(nextEnabled); - notifyExecutiveMode(nextEnabled); -}; - addMessages("en", english as unknown as LocaleDictionary); addMessages("ja", japanese as unknown as LocaleDictionary); init({ fallbackLocale: "en", initialLocale: $settings.displayLanguage }); @@ -113,17 +90,7 @@ const handleScroll = () => { }; onMount(async () => { - hydrateAprilFools(); - if (browser) { - if ( - aprilFoolsVisible() && - (await localforage.getItem("aprilFoolsNoticeShown")) !== data.commit - ) { - notifyExecutiveMode($aprilFools); - await localforage.setItem("aprilFoolsNoticeShown", data.commit); - } - if (await localforage.getItem("redirect")) { window.location.href = (await localforage.getItem("redirect")) ?? "/"; @@ -249,66 +216,38 @@ $: { <div class="container"> <div class="card card-centered header" class:header-hidden={!isHeaderVisible}> <div> - <a href={root('/')} class="header-item" - >{executiveCopy($aprilFools, $locale().navigation.home)}</a - ><a + <a href={root('/')} class="header-item">{$locale().navigation.home}</a><a href={root('/completed')} class="header-item" > - {executiveCopy($aprilFools, $locale().navigation.completed)} + {$locale().navigation.completed} </a> <Dropdown items={[ - { - name: executiveCopy($aprilFools, $locale().navigation.subtitleSchedule), - url: root('/schedule') - }, + { name: $locale().navigation.subtitleSchedule, url: root('/schedule') }, { name: $locale().navigation.hololive, url: root('/hololive') }, { name: $locale().tools.tool.characterBirthdays.short, url: root('/birthdays') }, - { name: executiveCopy($aprilFools, $locale().navigation.newReleases), url: root('/updates') } + { name: $locale().navigation.newReleases, url: root('/updates') } ]} header={false} > - <span slot="title" class="header-item"> - {executiveCopy($aprilFools, $locale().navigation.schedule)} - </span> + <span slot="title" class="header-item">{$locale().navigation.schedule}</span> </Dropdown> - <a href={root('/tools')} class="header-item" - >{executiveCopy($aprilFools, $locale().navigation.tools)}</a - > - <a href={root('/settings')} class="header-item" - >{executiveCopy($aprilFools, $locale().navigation.settings)}</a - > - {#if aprilFoolsVisible()} - <span class="header-item opaque separator">•</span> - <a - href={root(data.url)} - class="header-item executive-mode-toggle" - onclick={(event) => { - event.preventDefault(); - toggleExecutiveMode(); - }} - title={$aprilFools ? 'Disable Executive Mode' : 'Enable Executive Mode'} - > - Executive {$aprilFools ? 'On' : 'Off'} - </a> - {/if} + <a href={root('/tools')} class="header-item">{$locale().navigation.tools}</a> + <a href={root('/settings')} class="header-item">{$locale().navigation.settings}</a> <span class="header-item opaque separator">•</span> {#if data.user} <Dropdown items={[ + { name: $locale().navigation.myProfile, url: root(`/user/${$userIdentity.name}`) }, { - name: executiveCopy($aprilFools, $locale().navigation.myProfile), - url: root(`/user/${$userIdentity.name}`) - }, - { - name: executiveCopy($aprilFools, $locale().navigation.myBadgeWall), + name: $locale().navigation.myBadgeWall, url: root(`/user/${$userIdentity.name}/badges`) }, { - name: executiveCopy($aprilFools, $locale().navigation.logOut), + name: $locale().navigation.logOut, url: '#', preventDefault: true, onClick: async () => { @@ -324,7 +263,7 @@ $: { header={false} > <span slot="title" class="header-item"> - {executiveCopy($aprilFools, $locale().navigation.profile)} + {$locale().navigation.profile} </span> </Dropdown> {/if} @@ -340,7 +279,7 @@ $: { ); }} > - {executiveCopy($aprilFools, $locale().navigation.logIn)} + {$locale().navigation.logIn} </a> {:else if data.user} <a href={root(`/user/${$userIdentity.name}`)} class="header-item"> @@ -434,18 +373,6 @@ $: { outline: none; } - .executive-mode-toggle { - background: none; - border: none; - cursor: pointer; - font: inherit; - padding: 0; - } - - .executive-mode-toggle:hover { - text-decoration: none; - } - .avatar { width: 2em; display: inline-block; diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index a3fcad28..268e9713 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -8,8 +8,6 @@ import ListTitle from "$lib/List/ListTitle.svelte"; import HeadTitle from "$lib/Home/HeadTitle.svelte"; import { createHeightObserver } from "$lib/Utility/html.js"; import Skeleton from "$lib/Loading/Skeleton.svelte"; -import aprilFools from "$stores/aprilFools"; -import { executiveTitle } from "$lib/Utility/executiveMode"; import locale from "$stores/locale.js"; import Landing from "$lib/Landing.svelte"; import LandingHero from "$lib/LandingHero.svelte"; @@ -108,12 +106,12 @@ onDestroy(() => removeHeightObserver?.()); {#if UpcomingAnimeListComponent} <UpcomingAnimeListComponent user={data.user} /> {:else} - <ListTitle title={executiveTitle($aprilFools, $locale().lists.upcoming.episodes)} /> + <ListTitle title={$locale().lists.upcoming.episodes} /> <Skeleton card={false} count={5} height="0.9rem" list /> {/if} {:else} - <ListTitle title={executiveTitle($aprilFools, $locale().lists.upcoming.episodes)} /> + <ListTitle title={$locale().lists.upcoming.episodes} /> <Skeleton card={false} count={5} height="0.9rem" list /> {/if} @@ -125,7 +123,7 @@ onDestroy(() => removeHeightObserver?.()); <IndexColumnComponent user={data.user} userIdentity={$userIdentity} /> {:else} <details bind:open={$stateBin.dueAnimeListOpen} class="list list-due"> - <ListTitle title={executiveTitle($aprilFools, $locale().lists.due.episodes)} /> + <ListTitle title={$locale().lists.due.episodes} /> <Skeleton card={false} count={5} height="0.9rem" list /> </details> @@ -139,7 +137,7 @@ onDestroy(() => removeHeightObserver?.()); <IndexColumnComponent user={data.user} userIdentity={$userIdentity} /> {:else} <details bind:open={$stateBin.dueAnimeListOpen} class="list list-due"> - <ListTitle title={executiveTitle($aprilFools, $locale().lists.due.episodes)} /> + <ListTitle title={$locale().lists.due.episodes} /> <Skeleton card={false} count={5} height="0.9rem" list /> </details> @@ -156,12 +154,12 @@ onDestroy(() => removeHeightObserver?.()); due={true} /> {:else} - <ListTitle title={executiveTitle($aprilFools, $locale().lists.due.mangaAndLightNovels)} /> + <ListTitle title={$locale().lists.due.mangaAndLightNovels} /> <Skeleton card={false} count={5} height="0.9rem" list /> {/if} {:else} - <ListTitle title={executiveTitle($aprilFools, $locale().lists.due.mangaAndLightNovels)} /> + <ListTitle title={$locale().lists.due.mangaAndLightNovels} /> <Skeleton card={false} count={5} height="0.9rem" list /> {/if} diff --git a/src/routes/completed/+page.svelte b/src/routes/completed/+page.svelte index 69706b8e..bcad912b 100644 --- a/src/routes/completed/+page.svelte +++ b/src/routes/completed/+page.svelte @@ -9,8 +9,6 @@ import HeadTitle from "$lib/Home/HeadTitle.svelte"; import { createHeightObserver } from "$lib/Utility/html.js"; import Skeleton from "$lib/Loading/Skeleton.svelte"; import locale from "$stores/locale.js"; -import aprilFools from "$stores/aprilFools"; -import { executiveTitle } from "$lib/Utility/executiveMode"; import Landing from "$lib/Landing.svelte"; import stateBin, { hydrateStateBin } from "$stores/stateBin.js"; import type { PageData } from "./$types"; @@ -86,12 +84,12 @@ onDestroy(() => removeHeightObserver?.()); {#if WatchingAnimeListComponent} <WatchingAnimeListComponent user={data.user} /> {:else} - <ListTitle title={executiveTitle($aprilFools, $locale().lists.completed.anime)} /> + <ListTitle title={$locale().lists.completed.anime} /> <Skeleton card={false} count={5} height="0.9rem" list /> {/if} {:else} - <ListTitle title={executiveTitle($aprilFools, $locale().lists.completed.anime)} /> + <ListTitle title={$locale().lists.completed.anime} /> <Skeleton card={false} count={5} height="0.9rem" list /> {/if} @@ -108,12 +106,12 @@ onDestroy(() => removeHeightObserver?.()); due={false} /> {:else} - <ListTitle title={executiveTitle($aprilFools, $locale().lists.completed.mangaAndLightNovels)} /> + <ListTitle title={$locale().lists.completed.mangaAndLightNovels} /> <Skeleton card={false} count={5} height="0.9rem" list /> {/if} {:else} - <ListTitle title={executiveTitle($aprilFools, $locale().lists.completed.mangaAndLightNovels)} /> + <ListTitle title={$locale().lists.completed.mangaAndLightNovels} /> <Skeleton card={false} count={5} height="0.9rem" list /> {/if} |