From ada48329049467a89b97a505a9571d25a08b5bb3 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Sat, 27 Jul 2024 21:17:30 -0400 Subject: [PATCH] added rating to watchlist queue --- frontend/src/App.svelte | 88 +++++++++++++++++++++++++++++++++-------- 1 file changed, 71 insertions(+), 17 deletions(-) diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index e92cec7..3abeee1 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -4,11 +4,33 @@ import {MediaListSort} from "./anilist/types/AniListTypes"; import type {AniListCurrentUserWatchList} from "./anilist/types/AniListCurrentUserWatchListType" import Header from "./Header.svelte"; + import StarRatting from '@ernane/svelte-star-rating' import {Modal} from "flowbite-svelte"; import ChangeDataDialogue from "./ChangeDataDialogue.svelte"; - let aniListLoggedIn = false + const config = { + readOnly: false, + countStars: 5, + range: { + min: 0, + max: 5, + step: 0.5 + }, + score: 0.0, + showScore: true, + scoreFormat: function(){ return `(${this.score.toFixed(1)}/${this.countStars})` }, + name: "", + starConfig: { + size: 20, + fillColor: '#F9ED4F', + strokeColor: "#e2c714", + unfilledColor: '#FFF', + strokeUnfilledColor: '#000' + } + } + + let aniListLoggedIn = false let aniListWatchlist: AniListCurrentUserWatchList let page = 1 let perPage = 20 @@ -21,6 +43,18 @@ }) } + let count = 1; + + const decrement = () => { + if (count > 0) { + count-- + } + } + + const increment = () => { + count++ + } + @@ -41,31 +75,51 @@
{#each aniListWatchlist.data.Page.mediaList as media}
-
{/each}
{/if} - + +
+ + + +
+