aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Tools
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-03-03 00:43:11 -0800
committerFuwn <[email protected]>2024-03-03 00:43:11 -0800
commit3d45e946bf22a682cafa16e945d74b2553ae91ad (patch)
treed3a13b0e6cfbbd8855bd114141147d652fadefb9 /src/lib/Tools
parentfeat(tools): senpy shortcut (diff)
downloaddue.moe-3d45e946bf22a682cafa16e945d74b2553ae91ad.tar.xz
due.moe-3d45e946bf22a682cafa16e945d74b2553ae91ad.zip
feat(tools): auto-populate picker
Diffstat (limited to 'src/lib/Tools')
-rw-r--r--src/lib/Tools/Picker.svelte15
-rw-r--r--src/lib/Tools/tools.ts14
2 files changed, 13 insertions, 16 deletions
diff --git a/src/lib/Tools/Picker.svelte b/src/lib/Tools/Picker.svelte
index 75005efb..8b2d183f 100644
--- a/src/lib/Tools/Picker.svelte
+++ b/src/lib/Tools/Picker.svelte
@@ -2,7 +2,7 @@
import { browser } from '$app/environment';
import { goto } from '$app/navigation';
import root from '$lib/Utility/root';
- import locale from '$stores/locale';
+ import { tools } from './tools';
export let tool: string;
</script>
@@ -15,14 +15,9 @@
}}
>
<option value="default" selected disabled hidden>Select a tool to continue</option>
- <option value="wrapped">AniList Wrapped</option>
- <option value="birthdays">{$locale().tools.tool.characterBirthdays.long}</option>
- <option value="sequel_spy">Sequel Spy</option>
- <option value="discussions">Episode Discussion Collector</option>
- <option value="random_follower">Random Follower Finder</option>
- <option value="dump_profile">Dump Profile</option>
- <option value="likes">Likes</option>
- <option value="activity_history">Activity History Analyser</option>
- <option value="girls">Anime Girls Holding Programming Books</option>
+
+ {#each Object.keys(tools).filter((t) => t !== 'default') as t}
+ <option value={t}>{tools[t].short || tools[t].name()}</option>
+ {/each}
</select>
</blockquote>
diff --git a/src/lib/Tools/tools.ts b/src/lib/Tools/tools.ts
index 0f4da0a4..27a5f2b6 100644
--- a/src/lib/Tools/tools.ts
+++ b/src/lib/Tools/tools.ts
@@ -4,6 +4,7 @@ import { get } from 'svelte/store';
export const tools: {
[key: string]: {
name: () => string;
+ short?: string;
description?: () => string;
id: string;
};
@@ -15,6 +16,7 @@ export const tools: {
},
wrapped: {
name: () => 'AniList Wrapped & Statistics Panel',
+ short: 'AniList Wrapped',
description: () =>
'Instantly generate an AniList themed Wrapped for your profile, doubling as a statistics panel for your bio',
id: 'wrapped'
@@ -43,22 +45,22 @@ export const tools: {
description: () => "Generate random followers from any user's following list",
id: 'random_follower'
},
- likes: {
- name: () => 'Likes',
- description: () => 'Get all likes of an activity or forum thread',
- id: 'likes'
- },
dump_profile: {
name: () => 'Dump Profile',
description: () => "Dump a user's profile to JSON",
id: 'dump_profile'
},
+ likes: {
+ name: () => 'Likes',
+ description: () => 'Get all likes of an activity or forum thread',
+ id: 'likes'
+ },
activity_history: {
name: () => 'Activity History Analyser',
id: 'activity_history',
description: () => 'Activity history utilities & image exporter'
},
- anime_girls_holding_programming_books: {
+ girls: {
name: () => 'Anime Girls Holding Programming Books',
id: 'girls',
description: () => 'Find anime girls holding programming books by language'