From f5001cff048159250e85ac9b5f8263da1f246b50 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Wed, 4 Sep 2024 12:05:41 -0400 Subject: [PATCH] changed from modal to client-side router --- .../Simkl/Get Items/Get Anime Full Info.bru | 2 +- frontend/package.json | 2 +- frontend/src/App.svelte | 103 +++--------- .../{ => helperComponents}/AvatarMenu.svelte | 4 +- .../GlobalVariablesAndHelperFunctions.svelte | 15 +- .../src/{ => helperComponents}/Header.svelte | 21 ++- .../{ => helperComponents}/Pagination.svelte | 6 +- .../src/{ => helperComponents}/Search.svelte | 22 ++- frontend/src/helperComponents/Spinner.svelte | 11 ++ .../src/helperComponents/WatchList.svelte | 68 ++++++++ frontend/src/helperFunctions/loader.ts | 18 ++ frontend/src/modal/Modal.svelte | 155 ------------------ frontend/src/modal/Modal.svelte.d.ts | 77 --------- .../Anime.svelte} | 38 ++--- frontend/src/routes/Home.svelte | 25 +++ frontend/src/star-rating/Stars.svelte | 63 +++++++ .../src/star-rating/components/Star.svelte | 21 +++ frontend/tailwind.config.js | 55 +++++-- frontend/wailsjs/runtime/package.json | 0 frontend/wailsjs/runtime/runtime.d.ts | 0 frontend/wailsjs/runtime/runtime.js | 0 21 files changed, 327 insertions(+), 379 deletions(-) rename frontend/src/{ => helperComponents}/AvatarMenu.svelte (96%) rename frontend/src/{ => helperComponents}/GlobalVariablesAndHelperFunctions.svelte (92%) rename frontend/src/{ => helperComponents}/Header.svelte (89%) rename frontend/src/{ => helperComponents}/Pagination.svelte (97%) rename frontend/src/{ => helperComponents}/Search.svelte (82%) create mode 100644 frontend/src/helperComponents/Spinner.svelte create mode 100644 frontend/src/helperComponents/WatchList.svelte create mode 100644 frontend/src/helperFunctions/loader.ts delete mode 100644 frontend/src/modal/Modal.svelte delete mode 100644 frontend/src/modal/Modal.svelte.d.ts rename frontend/src/{ChangeDataDialogue.svelte => routes/Anime.svelte} (97%) create mode 100644 frontend/src/routes/Home.svelte create mode 100644 frontend/src/star-rating/Stars.svelte create mode 100644 frontend/src/star-rating/components/Star.svelte mode change 100755 => 100644 frontend/wailsjs/runtime/package.json mode change 100755 => 100644 frontend/wailsjs/runtime/runtime.d.ts mode change 100755 => 100644 frontend/wailsjs/runtime/runtime.js diff --git a/bruno/AniTrack/Simkl/Get Items/Get Anime Full Info.bru b/bruno/AniTrack/Simkl/Get Items/Get Anime Full Info.bru index 6a19d27..2e28fab 100644 --- a/bruno/AniTrack/Simkl/Get Items/Get Anime Full Info.bru +++ b/bruno/AniTrack/Simkl/Get Items/Get Anime Full Info.bru @@ -5,7 +5,7 @@ meta { } get { - url: https://api.simkl.com/anime/40398?extended=full + url: https://api.simkl.com/anime/862523?extended=full body: none auth: none } diff --git a/frontend/package.json b/frontend/package.json index 733b771..f78b56d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -17,6 +17,7 @@ "svelte": "^3.49.0", "svelte-check": "^2.8.0", "svelte-preprocess": "^4.10.7", + "svelte-spa-router": "^4.0.1", "tailwind-merge": "^2.4.0", "tailwindcss": "^3.4.6", "tslib": "^2.4.0", @@ -24,7 +25,6 @@ "vite": "^3.0.7" }, "dependencies": { - "@ernane/svelte-star-rating": "^1.1.7", "@popperjs/core": "^2.11.8", "flowbite": "^2.4.1", "flowbite-svelte": "^0.46.15", diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index 6bb1ec9..d62bcc8 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -1,12 +1,10 @@ -
- -
- {#if isAniListLoggedIn} -
- -

Your AniList WatchList

- - - -
- {#each aniListWatchListLoaded.data.Page.mediaList as media} -
-
- - - -

{media.progress} - / {media.media.nextAiringEpisode.episode !== 0 ? - media.media.nextAiringEpisode.episode - 1 : media.media.episodes}

- {#if media.media.episodes > 0} -

Total - Episodes: {media.media.episodes}

- {/if} -
-
- {/each} -
- - -
- {/if} - - - - -
+
+ { + await GetAniListSingleItem(Number(detail.params.id), true) + return Object.keys($aniListAnime).length!==0 + }, + ], + loadingComponent: Spinner + }), + // '*': "Not Found" +}} /> diff --git a/frontend/src/AvatarMenu.svelte b/frontend/src/helperComponents/AvatarMenu.svelte similarity index 96% rename from frontend/src/AvatarMenu.svelte rename to frontend/src/helperComponents/AvatarMenu.svelte index e1880bc..cd886d4 100644 --- a/frontend/src/AvatarMenu.svelte +++ b/frontend/src/helperComponents/AvatarMenu.svelte @@ -1,9 +1,9 @@