diff options
| author | Fuwn <[email protected]> | 2024-10-09 00:41:20 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-10-09 00:41:43 -0700 |
| commit | 998b63a35256ac985a5a2714dd1ca451af4dfd8a (patch) | |
| tree | 50796121a9d5ab0330fdc5d7e098bda2860d9726 /src/routes/tools | |
| parent | feat(graphql): add badgeCount field (diff) | |
| download | due.moe-998b63a35256ac985a5a2714dd1ca451af4dfd8a.tar.xz due.moe-998b63a35256ac985a5a2714dd1ca451af4dfd8a.zip | |
chore(prettier): use spaces instead of tabs
Diffstat (limited to 'src/routes/tools')
| -rw-r--r-- | src/routes/tools/+page.svelte | 106 | ||||
| -rw-r--r-- | src/routes/tools/[tool]/+page.server.ts | 6 | ||||
| -rw-r--r-- | src/routes/tools/[tool]/+page.svelte | 136 |
3 files changed, 124 insertions, 124 deletions
diff --git a/src/routes/tools/+page.svelte b/src/routes/tools/+page.svelte index 01a73877..97e27e0e 100644 --- a/src/routes/tools/+page.svelte +++ b/src/routes/tools/+page.svelte @@ -1,10 +1,10 @@ <script lang="ts"> - import HeadTitle from '$lib/Home/HeadTitle.svelte'; - import Picker from '$lib/Tools/Picker.svelte'; - import { tools } from '$lib/Tools/tools.js'; - import root from '$lib/Utility/root'; + import HeadTitle from '$lib/Home/HeadTitle.svelte'; + import Picker from '$lib/Tools/Picker.svelte'; + import { tools } from '$lib/Tools/tools.js'; + import root from '$lib/Utility/root'; - let tool = 'default'; + let tool = 'default'; </script> <Picker {tool} /> @@ -12,63 +12,63 @@ <HeadTitle route={tools[tool].name()} path={`/tools?tool=${tool}`} /> <div class="card"> - <div class="tool-grid"> - {#each Object.keys(tools).filter((t) => t !== 'default') as t} - <a href={root(`/tools/${tools[t].id}`)} on:click={() => (tool = t)}> - <div class="tool-grid-tool card"> - <span class="title"> - {tools[t].name()} - </span> + <div class="tool-grid"> + {#each Object.keys(tools).filter((t) => t !== 'default') as t} + <a href={root(`/tools/${tools[t].id}`)} on:click={() => (tool = t)}> + <div class="tool-grid-tool card"> + <span class="title"> + {tools[t].name()} + </span> - <p /> + <p /> - {#if tools[t].description} - <span class="description"> - {tools[t].description?.()} - </span> - {/if} - </div> - </a> - {/each} - </div> + {#if tools[t].description} + <span class="description"> + {tools[t].description?.()} + </span> + {/if} + </div> + </a> + {/each} + </div> - <p /> + <p /> - <blockquote style="margin: 0 0 0 1.5rem;"> - Have any requests for cool tools that you think others might find useful? Send a private message - to - <a href="https://anilist.co/user/fuwn" target="_blank" rel="noopener">@fuwn</a> on AniList! - </blockquote> + <blockquote style="margin: 0 0 0 1.5rem;"> + Have any requests for cool tools that you think others might find useful? Send a private message + to + <a href="https://anilist.co/user/fuwn" target="_blank" rel="noopener">@fuwn</a> on AniList! + </blockquote> </div> <style lang="scss"> - .tool-grid { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); - grid-gap: 1rem; - } + .tool-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); + grid-gap: 1rem; + } - .tool-grid-tool { - display: flex; - flex-direction: column; - height: 100%; - $delay: 0.25s; - transition: transform $delay ease; + .tool-grid-tool { + display: flex; + flex-direction: column; + height: 100%; + $delay: 0.25s; + transition: transform $delay ease; - .description { - // font-size: 0.9rem; - color: var(--fg); - } + .description { + // font-size: 0.9rem; + color: var(--fg); + } - &:hover { - transform: scale(1.05); - position: relative; - z-index: 2; - transition: transform $delay ease; - } - } + &:hover { + transform: scale(1.05); + position: relative; + z-index: 2; + transition: transform $delay ease; + } + } - .title { - font-weight: 500; - } + .title { + font-weight: 500; + } </style> diff --git a/src/routes/tools/[tool]/+page.server.ts b/src/routes/tools/[tool]/+page.server.ts index c7e72d18..11ba6d15 100644 --- a/src/routes/tools/[tool]/+page.server.ts +++ b/src/routes/tools/[tool]/+page.server.ts @@ -1,5 +1,5 @@ export const load = ({ params }) => { - return { - tool: params.tool - }; + return { + tool: params.tool + }; }; diff --git a/src/routes/tools/[tool]/+page.svelte b/src/routes/tools/[tool]/+page.svelte index 3749c096..9140ae1c 100644 --- a/src/routes/tools/[tool]/+page.svelte +++ b/src/routes/tools/[tool]/+page.svelte @@ -1,84 +1,84 @@ <script lang="ts"> - import Hayai from './../../../lib/Tools/Hayai.svelte'; - import UmaMusumeBirthdays from './../../../lib/Tools/UmaMusumeBirthdays.svelte'; - import ActivityHistory from '$lib/Tools/ActivityHistory/Tool.svelte'; - import Wrapped from '$lib/Tools/Wrapped/Tool.svelte'; - import EpisodeDiscussionCollector from '$lib/Tools/EpisodeDiscussionCollector.svelte'; - import CharacterBirthdays from '$lib/Tools/Birthdays.svelte'; - import SequelSpy from '$lib/Tools/SequelSpy/Tool.svelte'; - import { closest } from '$lib/Error/path'; - import HeadTitle from '$lib/Home/HeadTitle.svelte'; - import RandomFollower from '$lib/Tools/RandomFollower.svelte'; - import DumpProfile from '$lib/Tools/DumpProfile.svelte'; - import { tools } from '$lib/Tools/tools.js'; - import { onMount } from 'svelte'; - import { goto } from '$app/navigation'; - import Picker from '$lib/Tools/Picker.svelte'; - import Likes from '$lib/Tools/Likes.svelte'; - import root from '$lib/Utility/root.js'; - import Popup from '$lib/Layout/Popup.svelte'; - import HololiveBirthdays from '$lib/Tools/HololiveBirthdays.svelte'; - import SequelCatcher from '$lib/Tools/SequelCatcher/Tool.svelte'; + import Hayai from './../../../lib/Tools/Hayai.svelte'; + import UmaMusumeBirthdays from './../../../lib/Tools/UmaMusumeBirthdays.svelte'; + import ActivityHistory from '$lib/Tools/ActivityHistory/Tool.svelte'; + import Wrapped from '$lib/Tools/Wrapped/Tool.svelte'; + import EpisodeDiscussionCollector from '$lib/Tools/EpisodeDiscussionCollector.svelte'; + import CharacterBirthdays from '$lib/Tools/Birthdays.svelte'; + import SequelSpy from '$lib/Tools/SequelSpy/Tool.svelte'; + import { closest } from '$lib/Error/path'; + import HeadTitle from '$lib/Home/HeadTitle.svelte'; + import RandomFollower from '$lib/Tools/RandomFollower.svelte'; + import DumpProfile from '$lib/Tools/DumpProfile.svelte'; + import { tools } from '$lib/Tools/tools.js'; + import { onMount } from 'svelte'; + import { goto } from '$app/navigation'; + import Picker from '$lib/Tools/Picker.svelte'; + import Likes from '$lib/Tools/Likes.svelte'; + import root from '$lib/Utility/root.js'; + import Popup from '$lib/Layout/Popup.svelte'; + import HololiveBirthdays from '$lib/Tools/HololiveBirthdays.svelte'; + import SequelCatcher from '$lib/Tools/SequelCatcher/Tool.svelte'; - export let data; + export let data; - let tool = data.tool ?? 'default'; + let tool = data.tool ?? 'default'; - onMount(() => { - if (tool === 'default') goto(root('/tools')); - }); + onMount(() => { + if (tool === 'default') goto(root('/tools')); + }); - $: suggestion = closest(tool, Object.keys(tools)); + $: suggestion = closest(tool, Object.keys(tools)); - $: if (tool == 'girls') goto(root('/girls')); + $: if (tool == 'girls') goto(root('/girls')); </script> <Picker bind:tool /> {#if !Object.keys(tools).includes(tool)} - <HeadTitle route="Tools" path="/tools" /> + <HeadTitle route="Tools" path="/tools" /> - <Popup> - <p style="text-align: center;"> - Tool "<a href={root(`/tools/${tool}`)}>{tool}</a>" not found - </p> + <Popup> + <p style="text-align: center;"> + Tool "<a href={root(`/tools/${tool}`)}>{tool}</a>" not found + </p> - <blockquote style="margin: 0 0 0 1.5rem;"> - Did you mean "<a - href={root(`/tools/${tools[suggestion].id}`)} - on:click={() => (tool = suggestion)} - style={suggestion === '...' ? 'pointer-events: none; color: inherit;' : ''} - > - {suggestion === '...' ? '...' : tools[suggestion].name()}</a - >"? - </blockquote> - </Popup> + <blockquote style="margin: 0 0 0 1.5rem;"> + Did you mean "<a + href={root(`/tools/${tools[suggestion].id}`)} + on:click={() => (tool = suggestion)} + style={suggestion === '...' ? 'pointer-events: none; color: inherit;' : ''} + > + {suggestion === '...' ? '...' : tools[suggestion].name()}</a + >"? + </blockquote> + </Popup> {:else} - <HeadTitle route={tools[tool].name()} path={`/tools?tool=${tool}`} /> + <HeadTitle route={tools[tool].name()} path={`/tools?tool=${tool}`} /> - {#if tool === 'activity_history'} - <ActivityHistory user={data.user} /> - {:else if tool === 'wrapped'} - <Wrapped user={data.user} /> - {:else if tool === 'discussions'} - <EpisodeDiscussionCollector /> - {:else if tool === 'birthdays'} - <CharacterBirthdays /> - {:else if tool === 'sequel_spy'} - <SequelSpy user={data.user} /> - {:else if tool === 'random_follower'} - <RandomFollower /> - {:else if tool === 'dump_profile'} - <DumpProfile /> - {:else if tool === 'likes'} - <Likes /> - {:else if tool === 'uma_musume_birthdays'} - <UmaMusumeBirthdays /> - {:else if tool === 'hayai'} - <Hayai /> - {:else if tool === 'hololive_birthdays'} - <HololiveBirthdays /> - {:else if tool === 'sequel_catcher'} - <SequelCatcher user={data.user} /> - {/if} + {#if tool === 'activity_history'} + <ActivityHistory user={data.user} /> + {:else if tool === 'wrapped'} + <Wrapped user={data.user} /> + {:else if tool === 'discussions'} + <EpisodeDiscussionCollector /> + {:else if tool === 'birthdays'} + <CharacterBirthdays /> + {:else if tool === 'sequel_spy'} + <SequelSpy user={data.user} /> + {:else if tool === 'random_follower'} + <RandomFollower /> + {:else if tool === 'dump_profile'} + <DumpProfile /> + {:else if tool === 'likes'} + <Likes /> + {:else if tool === 'uma_musume_birthdays'} + <UmaMusumeBirthdays /> + {:else if tool === 'hayai'} + <Hayai /> + {:else if tool === 'hololive_birthdays'} + <HololiveBirthdays /> + {:else if tool === 'sequel_catcher'} + <SequelCatcher user={data.user} /> + {/if} {/if} |