made entire app only work in dark mode
This commit is contained in:
parent
753ecd968e
commit
e229311190
@ -7,77 +7,104 @@
|
|||||||
simklAnime,
|
simklAnime,
|
||||||
simklLoggedIn,
|
simklLoggedIn,
|
||||||
} from "../helperModules/GlobalVariablesAndHelperFunctions.svelte";
|
} from "../helperModules/GlobalVariablesAndHelperFunctions.svelte";
|
||||||
import {push} from "svelte-spa-router";
|
import { push } from "svelte-spa-router";
|
||||||
import {Button} from "flowbite-svelte";
|
import { Button } from "flowbite-svelte";
|
||||||
import type {AniListGetSingleAnime} from "../anilist/types/AniListCurrentUserWatchListType";
|
import type { AniListGetSingleAnime } from "../anilist/types/AniListCurrentUserWatchListType";
|
||||||
import Rating from "./Rating.svelte";
|
import Rating from "./Rating.svelte";
|
||||||
import convertAniListDateToString from "../helperFunctions/convertAniListDateToString";
|
import convertAniListDateToString from "../helperFunctions/convertAniListDateToString";
|
||||||
import AnimeTable from "./AnimeTable.svelte";
|
import AnimeTable from "./AnimeTable.svelte";
|
||||||
import type {MALAnime, MalListStatus, MALUploadStatus} from "../mal/types/MALTypes";
|
import type {
|
||||||
import type {SimklAnime} from "../simkl/types/simklTypes";
|
MALAnime,
|
||||||
import {writable} from "svelte/store";
|
MalListStatus,
|
||||||
import type {StatusOption, StatusOptions} from "../helperTypes/StatusTypes";
|
MALUploadStatus,
|
||||||
import type {AniListUpdateVariables} from "../anilist/types/AniListTypes";
|
} from "../mal/types/MALTypes";
|
||||||
|
import type { SimklAnime } from "../simkl/types/simklTypes";
|
||||||
|
import { writable } from "svelte/store";
|
||||||
|
import type {
|
||||||
|
StatusOption,
|
||||||
|
StatusOptions,
|
||||||
|
} from "../helperTypes/StatusTypes";
|
||||||
|
import type { AniListUpdateVariables } from "../anilist/types/AniListTypes";
|
||||||
import convertDateStringToAniList from "../helperFunctions/convertDateStringToAniList";
|
import convertDateStringToAniList from "../helperFunctions/convertDateStringToAniList";
|
||||||
import {
|
import {
|
||||||
AniListDeleteEntry,
|
AniListDeleteEntry,
|
||||||
AniListUpdateEntry, DeleteMyAnimeListEntry,
|
AniListUpdateEntry,
|
||||||
|
DeleteMyAnimeListEntry,
|
||||||
MyAnimeListUpdate,
|
MyAnimeListUpdate,
|
||||||
SimklSyncEpisodes,
|
SimklSyncEpisodes,
|
||||||
SimklSyncRating, SimklSyncRemove,
|
SimklSyncRating,
|
||||||
SimklSyncStatus
|
SimklSyncRemove,
|
||||||
|
SimklSyncStatus,
|
||||||
} from "../../wailsjs/go/main/App";
|
} from "../../wailsjs/go/main/App";
|
||||||
import {AddAnimeServiceToTable} from "../helperModules/AddAnimeServiceToTable.svelte";
|
import { AddAnimeServiceToTable } from "../helperModules/AddAnimeServiceToTable.svelte";
|
||||||
import {CheckIfAniListLoggedInAndLoadWatchList} from "../helperModules/CheckIfAniListLoggedInAndLoadWatchList.svelte";
|
import { CheckIfAniListLoggedInAndLoadWatchList } from "../helperModules/CheckIfAniListLoggedInAndLoadWatchList.svelte";
|
||||||
|
|
||||||
let isAniListLoggedIn: boolean
|
let isAniListLoggedIn: boolean;
|
||||||
let isMalLoggedIn: boolean
|
let isMalLoggedIn: boolean;
|
||||||
let isSimklLoggedIn: boolean
|
let isSimklLoggedIn: boolean;
|
||||||
let currentAniListAnime: AniListGetSingleAnime
|
let currentAniListAnime: AniListGetSingleAnime;
|
||||||
let currentMalAnime: MALAnime
|
let currentMalAnime: MALAnime;
|
||||||
let currentSimklAnime: SimklAnime
|
let currentSimklAnime: SimklAnime;
|
||||||
let submitting = writable(false)
|
let submitting = writable(false);
|
||||||
let isSubmitting: boolean
|
let isSubmitting: boolean;
|
||||||
let submitSuccess = writable(false)
|
let submitSuccess = writable(false);
|
||||||
|
|
||||||
aniListLoggedIn.subscribe((value) => isAniListLoggedIn = value)
|
aniListLoggedIn.subscribe((value) => (isAniListLoggedIn = value));
|
||||||
malLoggedIn.subscribe((value) => isMalLoggedIn = value)
|
malLoggedIn.subscribe((value) => (isMalLoggedIn = value));
|
||||||
simklLoggedIn.subscribe((value) => isSimklLoggedIn = value)
|
simklLoggedIn.subscribe((value) => (isSimklLoggedIn = value));
|
||||||
aniListAnime.subscribe((value) => currentAniListAnime = value)
|
aniListAnime.subscribe((value) => (currentAniListAnime = value));
|
||||||
malAnime.subscribe((value) => currentMalAnime = value)
|
malAnime.subscribe((value) => (currentMalAnime = value));
|
||||||
simklAnime.subscribe((value) => currentSimklAnime = value)
|
simklAnime.subscribe((value) => (currentSimklAnime = value));
|
||||||
submitting.subscribe((value) => isSubmitting = value)
|
submitting.subscribe((value) => (isSubmitting = value));
|
||||||
|
|
||||||
const title = currentAniListAnime.data.MediaList.media.title.english !== "" ?
|
const title =
|
||||||
currentAniListAnime.data.MediaList.media.title.english :
|
currentAniListAnime.data.MediaList.media.title.english !== ""
|
||||||
currentAniListAnime.data.MediaList.media.title.romaji
|
? currentAniListAnime.data.MediaList.media.title.english
|
||||||
|
: currentAniListAnime.data.MediaList.media.title.romaji;
|
||||||
const statusOptions: StatusOptions = [
|
const statusOptions: StatusOptions = [
|
||||||
{id: 0, aniList: "CURRENT", mal: "watching", simkl: "watching"},
|
{ id: 0, aniList: "CURRENT", mal: "watching", simkl: "watching" },
|
||||||
{id: 1, aniList: "PLANNING", mal: "plan_to_watch", simkl: "plantowatch"},
|
{
|
||||||
{id: 2, aniList: "COMPLETED", mal: "completed", simkl: "completed"},
|
id: 1,
|
||||||
{id: 3, aniList: "DROPPED", mal: "dropped", simkl: "dropped"},
|
aniList: "PLANNING",
|
||||||
{id: 4, aniList: "PAUSED", mal: "on_hold", simkl: "hold"},
|
mal: "plan_to_watch",
|
||||||
{id: 5, aniList: "REPEATING", mal: "rewatching", simkl: "watching"}
|
simkl: "plantowatch",
|
||||||
]
|
},
|
||||||
let startingAnilistStatusOption: StatusOption = statusOptions.filter(option => currentAniListAnime.data.MediaList.status === option.aniList)[0]
|
{ id: 2, aniList: "COMPLETED", mal: "completed", simkl: "completed" },
|
||||||
const startedAtDate = convertAniListDateToString(currentAniListAnime.data.MediaList.startedAt)
|
{ id: 3, aniList: "DROPPED", mal: "dropped", simkl: "dropped" },
|
||||||
const completedAtDate = convertAniListDateToString(currentAniListAnime.data.MediaList.completedAt)
|
{ id: 4, aniList: "PAUSED", mal: "on_hold", simkl: "hold" },
|
||||||
|
{ id: 5, aniList: "REPEATING", mal: "rewatching", simkl: "watching" },
|
||||||
|
];
|
||||||
|
let startingAnilistStatusOption: StatusOption = statusOptions.filter(
|
||||||
|
(option) =>
|
||||||
|
currentAniListAnime.data.MediaList.status === option.aniList,
|
||||||
|
)[0];
|
||||||
|
const startedAtDate = convertAniListDateToString(
|
||||||
|
currentAniListAnime.data.MediaList.startedAt,
|
||||||
|
);
|
||||||
|
const completedAtDate = convertAniListDateToString(
|
||||||
|
currentAniListAnime.data.MediaList.completedAt,
|
||||||
|
);
|
||||||
|
|
||||||
if (isAniListLoggedIn) AddAnimeServiceToTable({
|
if (isAniListLoggedIn)
|
||||||
|
AddAnimeServiceToTable({
|
||||||
id: currentAniListAnime.data.MediaList.mediaId,
|
id: currentAniListAnime.data.MediaList.mediaId,
|
||||||
title,
|
title,
|
||||||
service: "AniList",
|
service: "AniList",
|
||||||
progress: currentAniListAnime.data.MediaList.progress,
|
progress: currentAniListAnime.data.MediaList.progress,
|
||||||
status: currentAniListAnime.data.MediaList.status,
|
status: currentAniListAnime.data.MediaList.status,
|
||||||
startedAt: convertAniListDateToString(currentAniListAnime.data.MediaList.startedAt),
|
startedAt: convertAniListDateToString(
|
||||||
completedAt: convertAniListDateToString(currentAniListAnime.data.MediaList.completedAt),
|
currentAniListAnime.data.MediaList.startedAt,
|
||||||
|
),
|
||||||
|
completedAt: convertAniListDateToString(
|
||||||
|
currentAniListAnime.data.MediaList.completedAt,
|
||||||
|
),
|
||||||
score: currentAniListAnime.data.MediaList.score,
|
score: currentAniListAnime.data.MediaList.score,
|
||||||
repeat: currentAniListAnime.data.MediaList.repeat,
|
repeat: currentAniListAnime.data.MediaList.repeat,
|
||||||
notes: currentAniListAnime.data.MediaList.notes
|
notes: currentAniListAnime.data.MediaList.notes,
|
||||||
})
|
});
|
||||||
|
|
||||||
|
if (isMalLoggedIn)
|
||||||
if (isMalLoggedIn) AddAnimeServiceToTable({
|
AddAnimeServiceToTable({
|
||||||
id: currentMalAnime.id,
|
id: currentMalAnime.id,
|
||||||
title: currentMalAnime.title,
|
title: currentMalAnime.title,
|
||||||
service: "MyAnimeList",
|
service: "MyAnimeList",
|
||||||
@ -87,10 +114,11 @@
|
|||||||
completedAt: currentMalAnime.my_list_status.finish_date,
|
completedAt: currentMalAnime.my_list_status.finish_date,
|
||||||
score: currentMalAnime.my_list_status.score,
|
score: currentMalAnime.my_list_status.score,
|
||||||
repeat: currentMalAnime.my_list_status.num_times_rewatched,
|
repeat: currentMalAnime.my_list_status.num_times_rewatched,
|
||||||
notes: currentMalAnime.my_list_status.comments
|
notes: currentMalAnime.my_list_status.comments,
|
||||||
})
|
});
|
||||||
|
|
||||||
if (isSimklLoggedIn && Object.keys(currentSimklAnime).length > 0) AddAnimeServiceToTable({
|
if (isSimklLoggedIn && Object.keys(currentSimklAnime).length > 0)
|
||||||
|
AddAnimeServiceToTable({
|
||||||
id: currentSimklAnime.show.ids.simkl,
|
id: currentSimklAnime.show.ids.simkl,
|
||||||
title: currentSimklAnime.show.title,
|
title: currentSimklAnime.show.title,
|
||||||
service: "Simkl",
|
service: "Simkl",
|
||||||
@ -100,19 +128,19 @@
|
|||||||
completedAt: "",
|
completedAt: "",
|
||||||
score: currentSimklAnime.user_rating,
|
score: currentSimklAnime.user_rating,
|
||||||
repeat: 0,
|
repeat: 0,
|
||||||
notes: ""
|
notes: "",
|
||||||
})
|
});
|
||||||
|
|
||||||
const handleSubmit = async (e: any) => {
|
const handleSubmit = async (e: any) => {
|
||||||
submitting.set(true)
|
submitting.set(true);
|
||||||
let submitData: {
|
let submitData: {
|
||||||
rating: number,
|
rating: number;
|
||||||
episodes: number,
|
episodes: number;
|
||||||
status: StatusOption,
|
status: StatusOption;
|
||||||
startedAt: string,
|
startedAt: string;
|
||||||
completedAt: string,
|
completedAt: string;
|
||||||
repeat: number,
|
repeat: number;
|
||||||
notes: string,
|
notes: string;
|
||||||
} = {
|
} = {
|
||||||
rating: 0,
|
rating: 0,
|
||||||
episodes: 0,
|
episodes: 0,
|
||||||
@ -126,30 +154,33 @@
|
|||||||
completedAt: "",
|
completedAt: "",
|
||||||
repeat: 0,
|
repeat: 0,
|
||||||
notes: "",
|
notes: "",
|
||||||
}
|
};
|
||||||
const formData = new FormData(e.target)
|
const formData = new FormData(e.target);
|
||||||
for (let field of formData) {
|
for (let field of formData) {
|
||||||
const [key, value] = field
|
const [key, value] = field;
|
||||||
if (key === "rating") {
|
if (key === "rating") {
|
||||||
submitData.rating = (Number(value) * 2)
|
submitData.rating = Number(value) * 2;
|
||||||
continue
|
continue;
|
||||||
}
|
}
|
||||||
if (key === "episodes") {
|
if (key === "episodes") {
|
||||||
submitData.episodes = Number(value)
|
submitData.episodes = Number(value);
|
||||||
continue
|
continue;
|
||||||
}
|
}
|
||||||
if (key === "repeat") {
|
if (key === "repeat") {
|
||||||
submitData.repeat = Number(value)
|
submitData.repeat = Number(value);
|
||||||
continue
|
continue;
|
||||||
}
|
}
|
||||||
if (key === "status") {
|
if (key === "status") {
|
||||||
submitData.status = startingAnilistStatusOption
|
submitData.status = startingAnilistStatusOption;
|
||||||
continue
|
continue;
|
||||||
}
|
}
|
||||||
submitData[key] = value
|
submitData[key] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAniListLoggedIn && currentAniListAnime.data.MediaList.mediaId !== 0) {
|
if (
|
||||||
|
isAniListLoggedIn &&
|
||||||
|
currentAniListAnime.data.MediaList.mediaId !== 0
|
||||||
|
) {
|
||||||
let body: AniListUpdateVariables = {
|
let body: AniListUpdateVariables = {
|
||||||
mediaId: currentAniListAnime.data.MediaList.mediaId,
|
mediaId: currentAniListAnime.data.MediaList.mediaId,
|
||||||
progress: submitData.episodes,
|
progress: submitData.episodes,
|
||||||
@ -158,29 +189,35 @@
|
|||||||
repeat: submitData.repeat,
|
repeat: submitData.repeat,
|
||||||
notes: submitData.notes,
|
notes: submitData.notes,
|
||||||
startedAt: convertDateStringToAniList(submitData.startedAt),
|
startedAt: convertDateStringToAniList(submitData.startedAt),
|
||||||
completedAt: convertDateStringToAniList(submitData.completedAt)
|
completedAt: convertDateStringToAniList(submitData.completedAt),
|
||||||
}
|
};
|
||||||
await AniListUpdateEntry(body).then((value: AniListGetSingleAnime) => {
|
await AniListUpdateEntry(body).then(
|
||||||
|
(value: AniListGetSingleAnime) => {
|
||||||
// in future when you inevitably add tags to typescript, until Anilist fixes the api bug
|
// in future when you inevitably add tags to typescript, until Anilist fixes the api bug
|
||||||
// where tags break the SaveMediaListEntry return, you'll want to use this delete line
|
// where tags break the SaveMediaListEntry return, you'll want to use this delete line
|
||||||
// delete value.data.MediaList.media.tags
|
// delete value.data.MediaList.media.tags
|
||||||
aniListAnime.update(newValue => {
|
aniListAnime.update((newValue) => {
|
||||||
newValue = value
|
newValue = value;
|
||||||
return newValue
|
return newValue;
|
||||||
})
|
});
|
||||||
AddAnimeServiceToTable({
|
AddAnimeServiceToTable({
|
||||||
id: currentAniListAnime.data.MediaList.mediaId,
|
id: currentAniListAnime.data.MediaList.mediaId,
|
||||||
title,
|
title,
|
||||||
service: "AniList",
|
service: "AniList",
|
||||||
progress: currentAniListAnime.data.MediaList.progress,
|
progress: currentAniListAnime.data.MediaList.progress,
|
||||||
status: currentAniListAnime.data.MediaList.status,
|
status: currentAniListAnime.data.MediaList.status,
|
||||||
startedAt: convertAniListDateToString(currentAniListAnime.data.MediaList.startedAt),
|
startedAt: convertAniListDateToString(
|
||||||
completedAt: convertAniListDateToString(currentAniListAnime.data.MediaList.completedAt),
|
currentAniListAnime.data.MediaList.startedAt,
|
||||||
|
),
|
||||||
|
completedAt: convertAniListDateToString(
|
||||||
|
currentAniListAnime.data.MediaList.completedAt,
|
||||||
|
),
|
||||||
score: currentAniListAnime.data.MediaList.score,
|
score: currentAniListAnime.data.MediaList.score,
|
||||||
repeat: currentAniListAnime.data.MediaList.repeat,
|
repeat: currentAniListAnime.data.MediaList.repeat,
|
||||||
notes: currentAniListAnime.data.MediaList.notes,
|
notes: currentAniListAnime.data.MediaList.notes,
|
||||||
})
|
});
|
||||||
})
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (malLoggedIn && currentMalAnime.id !== 0) {
|
if (malLoggedIn && currentMalAnime.id !== 0) {
|
||||||
@ -190,37 +227,49 @@
|
|||||||
score: submitData.rating,
|
score: submitData.rating,
|
||||||
num_watched_episodes: submitData.episodes,
|
num_watched_episodes: submitData.episodes,
|
||||||
num_times_rewatched: submitData.repeat,
|
num_times_rewatched: submitData.repeat,
|
||||||
comments: submitData.notes
|
comments: submitData.notes,
|
||||||
}
|
};
|
||||||
|
|
||||||
await MyAnimeListUpdate(currentMalAnime, body).then((malAnimeReturn: MalListStatus) => {
|
await MyAnimeListUpdate(currentMalAnime, body).then(
|
||||||
malAnime.update(value => {
|
(malAnimeReturn: MalListStatus) => {
|
||||||
value.my_list_status.status = malAnimeReturn.status
|
malAnime.update((value) => {
|
||||||
value.my_list_status.is_rewatching = malAnimeReturn.is_rewatching
|
value.my_list_status.status = malAnimeReturn.status;
|
||||||
value.my_list_status.score = malAnimeReturn.score
|
value.my_list_status.is_rewatching =
|
||||||
value.my_list_status.num_episodes_watched = malAnimeReturn.num_episodes_watched
|
malAnimeReturn.is_rewatching;
|
||||||
value.my_list_status.num_times_rewatched = malAnimeReturn.num_times_rewatched
|
value.my_list_status.score = malAnimeReturn.score;
|
||||||
value.my_list_status.comments = malAnimeReturn.comments
|
value.my_list_status.num_episodes_watched =
|
||||||
return value
|
malAnimeReturn.num_episodes_watched;
|
||||||
})
|
value.my_list_status.num_times_rewatched =
|
||||||
|
malAnimeReturn.num_times_rewatched;
|
||||||
|
value.my_list_status.comments = malAnimeReturn.comments;
|
||||||
|
return value;
|
||||||
|
});
|
||||||
AddAnimeServiceToTable({
|
AddAnimeServiceToTable({
|
||||||
id: currentMalAnime.id,
|
id: currentMalAnime.id,
|
||||||
title: currentMalAnime.title,
|
title: currentMalAnime.title,
|
||||||
service: "MyAnimeList",
|
service: "MyAnimeList",
|
||||||
progress: currentMalAnime.my_list_status.num_episodes_watched,
|
progress:
|
||||||
|
currentMalAnime.my_list_status.num_episodes_watched,
|
||||||
status: currentMalAnime.my_list_status.status,
|
status: currentMalAnime.my_list_status.status,
|
||||||
startedAt: currentMalAnime.my_list_status.start_date,
|
startedAt: currentMalAnime.my_list_status.start_date,
|
||||||
completedAt: currentMalAnime.my_list_status.finish_date,
|
completedAt: currentMalAnime.my_list_status.finish_date,
|
||||||
score: currentMalAnime.my_list_status.score,
|
score: currentMalAnime.my_list_status.score,
|
||||||
repeat: currentMalAnime.my_list_status.num_times_rewatched,
|
repeat: currentMalAnime.my_list_status
|
||||||
|
.num_times_rewatched,
|
||||||
notes: currentMalAnime.my_list_status.comments,
|
notes: currentMalAnime.my_list_status.comments,
|
||||||
})
|
});
|
||||||
})
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (simklLoggedIn && currentSimklAnime.show.ids.simkl !== 0) {
|
if (simklLoggedIn && currentSimklAnime.show.ids.simkl !== 0) {
|
||||||
if (currentSimklAnime.watched_episodes_count !== submitData.episodes) {
|
if (
|
||||||
await SimklSyncEpisodes(currentSimklAnime, submitData.episodes).then((value: SimklAnime) => {
|
currentSimklAnime.watched_episodes_count !== submitData.episodes
|
||||||
|
) {
|
||||||
|
await SimklSyncEpisodes(
|
||||||
|
currentSimklAnime,
|
||||||
|
submitData.episodes,
|
||||||
|
).then((value: SimklAnime) => {
|
||||||
AddAnimeServiceToTable({
|
AddAnimeServiceToTable({
|
||||||
id: value.show.ids.simkl,
|
id: value.show.ids.simkl,
|
||||||
title: value.show.title,
|
title: value.show.title,
|
||||||
@ -231,17 +280,20 @@
|
|||||||
completedAt: "",
|
completedAt: "",
|
||||||
score: value.user_rating,
|
score: value.user_rating,
|
||||||
repeat: 0,
|
repeat: 0,
|
||||||
notes: ""
|
notes: "",
|
||||||
})
|
});
|
||||||
simklAnime.update(newValue => {
|
simklAnime.update((newValue) => {
|
||||||
newValue = value
|
newValue = value;
|
||||||
return newValue
|
return newValue;
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentSimklAnime.user_rating !== submitData.rating) {
|
if (currentSimklAnime.user_rating !== submitData.rating) {
|
||||||
await SimklSyncRating(currentSimklAnime, submitData.rating).then(value => {
|
await SimklSyncRating(
|
||||||
|
currentSimklAnime,
|
||||||
|
submitData.rating,
|
||||||
|
).then((value) => {
|
||||||
AddAnimeServiceToTable({
|
AddAnimeServiceToTable({
|
||||||
id: value.show.ids.simkl,
|
id: value.show.ids.simkl,
|
||||||
title: value.show.title,
|
title: value.show.title,
|
||||||
@ -252,17 +304,20 @@
|
|||||||
completedAt: "",
|
completedAt: "",
|
||||||
score: value.user_rating,
|
score: value.user_rating,
|
||||||
repeat: 0,
|
repeat: 0,
|
||||||
notes: ""
|
notes: "",
|
||||||
})
|
});
|
||||||
simklAnime.update(newValue => {
|
simklAnime.update((newValue) => {
|
||||||
newValue = value
|
newValue = value;
|
||||||
return newValue
|
return newValue;
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentSimklAnime.status !== submitData.status.simkl) {
|
if (currentSimklAnime.status !== submitData.status.simkl) {
|
||||||
await SimklSyncStatus(currentSimklAnime, submitData.status.simkl).then(value => {
|
await SimklSyncStatus(
|
||||||
|
currentSimklAnime,
|
||||||
|
submitData.status.simkl,
|
||||||
|
).then((value) => {
|
||||||
AddAnimeServiceToTable({
|
AddAnimeServiceToTable({
|
||||||
id: value.show.ids.simkl,
|
id: value.show.ids.simkl,
|
||||||
title: value.show.title,
|
title: value.show.title,
|
||||||
@ -273,25 +328,28 @@
|
|||||||
completedAt: "",
|
completedAt: "",
|
||||||
score: value.user_rating,
|
score: value.user_rating,
|
||||||
repeat: 0,
|
repeat: 0,
|
||||||
notes: ""
|
notes: "",
|
||||||
})
|
});
|
||||||
simklAnime.update(newValue => {
|
simklAnime.update((newValue) => {
|
||||||
newValue = value
|
newValue = value;
|
||||||
return newValue
|
return newValue;
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
submitting.set(false)
|
submitting.set(false);
|
||||||
submitSuccess.set(true)
|
submitSuccess.set(true);
|
||||||
setTimeout(() => submitSuccess.set(false), 2000)
|
setTimeout(() => submitSuccess.set(false), 2000);
|
||||||
}
|
};
|
||||||
|
|
||||||
const deleteEntries = async () => {
|
const deleteEntries = async () => {
|
||||||
submitting.set(true)
|
submitting.set(true);
|
||||||
if (isAniListLoggedIn && currentAniListAnime.data.MediaList.mediaId !== 0) {
|
if (
|
||||||
await AniListDeleteEntry(currentAniListAnime.data.MediaList.id)
|
isAniListLoggedIn &&
|
||||||
|
currentAniListAnime.data.MediaList.mediaId !== 0
|
||||||
|
) {
|
||||||
|
await AniListDeleteEntry(currentAniListAnime.data.MediaList.id);
|
||||||
AddAnimeServiceToTable({
|
AddAnimeServiceToTable({
|
||||||
id: currentAniListAnime.data.MediaList.mediaId,
|
id: currentAniListAnime.data.MediaList.mediaId,
|
||||||
title,
|
title,
|
||||||
@ -303,10 +361,10 @@
|
|||||||
score: 0,
|
score: 0,
|
||||||
repeat: 0,
|
repeat: 0,
|
||||||
notes: "",
|
notes: "",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
if (malLoggedIn && currentMalAnime.id !== 0) {
|
if (malLoggedIn && currentMalAnime.id !== 0) {
|
||||||
await DeleteMyAnimeListEntry(currentMalAnime.id)
|
await DeleteMyAnimeListEntry(currentMalAnime.id);
|
||||||
AddAnimeServiceToTable({
|
AddAnimeServiceToTable({
|
||||||
id: currentMalAnime.id,
|
id: currentMalAnime.id,
|
||||||
title: currentMalAnime.title,
|
title: currentMalAnime.title,
|
||||||
@ -318,10 +376,10 @@
|
|||||||
score: 0,
|
score: 0,
|
||||||
repeat: 0,
|
repeat: 0,
|
||||||
notes: "",
|
notes: "",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
if (simklLoggedIn && currentSimklAnime.show.ids.simkl !== 0) {
|
if (simklLoggedIn && currentSimklAnime.show.ids.simkl !== 0) {
|
||||||
await SimklSyncRemove(currentSimklAnime)
|
await SimklSyncRemove(currentSimklAnime);
|
||||||
AddAnimeServiceToTable({
|
AddAnimeServiceToTable({
|
||||||
id: currentSimklAnime.show.ids.simkl,
|
id: currentSimklAnime.show.ids.simkl,
|
||||||
title: currentSimklAnime.show.title,
|
title: currentSimklAnime.show.title,
|
||||||
@ -333,51 +391,67 @@
|
|||||||
score: 0,
|
score: 0,
|
||||||
repeat: 0,
|
repeat: 0,
|
||||||
notes: "",
|
notes: "",
|
||||||
})
|
});
|
||||||
}
|
|
||||||
submitting.set(false)
|
|
||||||
submitSuccess.set(true)
|
|
||||||
setTimeout(() => submitSuccess.set(false), 2000)
|
|
||||||
}
|
}
|
||||||
|
submitting.set(false);
|
||||||
|
submitSuccess.set(true);
|
||||||
|
setTimeout(() => submitSuccess.set(false), 2000);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<form on:submit|preventDefault={handleSubmit} class="container py-10">
|
|
||||||
|
|
||||||
|
<form on:submit|preventDefault={handleSubmit} class="container py-10">
|
||||||
<div class="grid grid-cols-1 md:grid-cols-10 grid-flow-col gap-4">
|
<div class="grid grid-cols-1 md:grid-cols-10 grid-flow-col gap-4">
|
||||||
<div class="md:col-span-2 space-y-3">
|
<div class="md:col-span-2 space-y-3">
|
||||||
<img class="rounded-lg" src={currentAniListAnime.data.MediaList.media.coverImage.large}
|
<img
|
||||||
alt="{title} Cover Image">
|
class="rounded-lg"
|
||||||
<Rating bind:score={currentAniListAnime.data.MediaList.score}/>
|
src={currentAniListAnime.data.MediaList.media.coverImage.large}
|
||||||
|
alt="{title} Cover Image"
|
||||||
|
/>
|
||||||
|
<Rating bind:score={currentAniListAnime.data.MediaList.score} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="md:col-span-8 ">
|
<div class="md:col-span-8">
|
||||||
<div class="flex flex-col md:flex-row md:pl-10 md:pr-10 pt-5 pb-5 justify-center md:gap-x-24 lg:gap-x-56">
|
<div
|
||||||
|
class="flex flex-col md:flex-row md:pl-10 md:pr-10 pt-5 pb-5 justify-center md:gap-x-24 lg:gap-x-56"
|
||||||
|
>
|
||||||
<div>
|
<div>
|
||||||
<label for="episodes"
|
<label
|
||||||
class="text-left block mb-2 text-sm font-medium text-gray-900 dark:text-white">Episode
|
for="episodes"
|
||||||
Progress</label>
|
class="text-left block mb-2 text-sm font-medium text-white"
|
||||||
|
>Episode Progress</label
|
||||||
|
>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
name="episodes"
|
name="episodes"
|
||||||
min="0"
|
min="0"
|
||||||
max="{currentAniListAnime.data.MediaList.media.episodes}"
|
max={currentAniListAnime.data.MediaList.media.episodes}
|
||||||
id="episodes"
|
id="episodes"
|
||||||
class="bg-gray-50 border {currentAniListAnime.data.MediaList.progress < 0 || currentAniListAnime.data.MediaList.progress > currentAniListAnime.data.MediaList.media.episodes ?
|
class="border {currentAniListAnime.data.MediaList
|
||||||
'border-red-300 dark:border-red-500 border-[2px] text-rose-500 dark:text-rose-300 focus:ring-red-500 focus:border-red-500 dark:focus:ring-red-500 dark:focus:border-red-500' :
|
.progress < 0 ||
|
||||||
'border-gray-300 dark:border-gray-500 text-gray-900 dark:text-white focus:ring-blue-500 focus:border-blue-500 dark:focus:ring-blue-500 dark:focus:border-blue-500'
|
currentAniListAnime.data.MediaList.progress >
|
||||||
} text-sm rounded-lg block w-24 p-2.5 dark:bg-gray-600 dark:placeholder-gray-400"
|
currentAniListAnime.data.MediaList.media.episodes
|
||||||
|
? 'border-red-500 border-[2px] text-rose-300 focus:ring-red-500 focus:border-red-500'
|
||||||
|
: 'border-gray-500 text-white focus:ring-blue-500 focus:border-blue-500'} text-sm rounded-lg block w-24 p-2.5 bg-gray-600 placeholder-gray-400"
|
||||||
bind:value={currentAniListAnime.data.MediaList.progress}
|
bind:value={currentAniListAnime.data.MediaList.progress}
|
||||||
required>
|
required
|
||||||
<div>of {currentAniListAnime.data.MediaList.media.episodes}</div>
|
/>
|
||||||
|
<div>
|
||||||
|
of {currentAniListAnime.data.MediaList.media.episodes}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label for="status"
|
<label
|
||||||
class="text-left block mb-2 text-sm font-medium text-gray-900 dark:text-white">Status</label>
|
for="status"
|
||||||
<select id="status" name="status"
|
class="text-left block mb-2 text-sm font-medium text-gray-900 dark:text-white"
|
||||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500
|
>Status</label
|
||||||
focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400
|
>
|
||||||
dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
<select
|
||||||
|
id="status"
|
||||||
|
name="status"
|
||||||
|
class="border text-sm rounded-lg
|
||||||
|
block p-2.5 bg-gray-700 border-gray-600 placeholder-gray-400
|
||||||
|
text-white focus:ring-blue-500 focus:border-blue-500"
|
||||||
bind:value={startingAnilistStatusOption}
|
bind:value={startingAnilistStatusOption}
|
||||||
>
|
>
|
||||||
{#each statusOptions as option}
|
{#each statusOptions as option}
|
||||||
@ -386,150 +460,218 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col md:flex-row md:pl-10 md:pr-10 pt-5 pb-5 justify-center md:gap-x-16 lg:gap-x-36">
|
<div
|
||||||
|
class="flex flex-col md:flex-row md:pl-10 md:pr-10 pt-5 pb-5 justify-center md:gap-x-16 lg:gap-x-36"
|
||||||
|
>
|
||||||
<div>
|
<div>
|
||||||
|
<label
|
||||||
<label for="startedAt"
|
for="startedAt"
|
||||||
class="text-left block mb-2 text-sm font-medium text-gray-900 dark:text-white">Date
|
class="text-left block mb-2 text-sm font-medium text-white"
|
||||||
Started</label>
|
>Date Started</label
|
||||||
|
>
|
||||||
<div class="relative max-w-sm">
|
<div class="relative max-w-sm">
|
||||||
<div class="absolute inset-y-0 start-0 flex items-center ps-3.5 pointer-events-none">
|
<div
|
||||||
<svg class="w-4 h-4 text-gray-500 dark:text-gray-400" aria-hidden="true"
|
class="absolute inset-y-0 start-0 flex items-center ps-3.5 pointer-events-none"
|
||||||
xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
|
>
|
||||||
<path d="M20 4a2 2 0 0 0-2-2h-2V1a1 1 0 0 0-2 0v1h-3V1a1 1 0 0 0-2 0v1H6V1a1 1 0 0 0-2 0v1H2a2 2 0 0 0-2 2v2h20V4ZM0 18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8H0v10Zm5-8h10a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z"/>
|
<svg
|
||||||
|
class="w-4 h-4 text-gray-400"
|
||||||
|
aria-hidden="true"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
fill="currentColor"
|
||||||
|
viewBox="0 0 20 20"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M20 4a2 2 0 0 0-2-2h-2V1a1 1 0 0 0-2 0v1h-3V1a1 1 0 0 0-2 0v1H6V1a1 1 0 0 0-2 0v1H2a2 2 0 0 0-2 2v2h20V4ZM0 18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8H0v10Zm5-8h10a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z"
|
||||||
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<input
|
<input
|
||||||
id="startedAt"
|
id="startedAt"
|
||||||
type="date"
|
type="date"
|
||||||
name="startedAt"
|
name="startedAt"
|
||||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500
|
class="border text-sm rounded-lg
|
||||||
focus:border-blue-500 dark:focus:ring-blue-500 dark:focus:border-blue-500 block w-full ps-10 p-2.5 dark:bg-gray-700 dark:border-gray-600
|
focus:ring-blue-500 focus:border-blue-500 block w-full ps-10 p-2.5 bg-gray-700 border-gray-600
|
||||||
dark:placeholder-gray-400 dark:text-white"
|
placeholder-gray-400 text-white"
|
||||||
value={startedAtDate}
|
value={startedAtDate}
|
||||||
placeholder="Date Started"
|
placeholder="Date Started"
|
||||||
>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
<label
|
||||||
<label for="completedAt"
|
for="completedAt"
|
||||||
class="text-left block mb-2 text-sm font-medium text-gray-900 dark:text-white">Date
|
class="text-left block mb-2 text-sm font-medium text-white"
|
||||||
Completed</label>
|
>Date Completed</label
|
||||||
|
>
|
||||||
<div class="relative max-w-sm">
|
<div class="relative max-w-sm">
|
||||||
<div class="absolute inset-y-0 start-0 flex items-center ps-3.5 pointer-events-none">
|
<div
|
||||||
<svg class="w-4 h-4 text-gray-500 dark:text-gray-400" aria-hidden="true"
|
class="absolute inset-y-0 start-0 flex items-center ps-3.5 pointer-events-none"
|
||||||
xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
|
>
|
||||||
<path d="M20 4a2 2 0 0 0-2-2h-2V1a1 1 0 0 0-2 0v1h-3V1a1 1 0 0 0-2 0v1H6V1a1 1 0 0 0-2 0v1H2a2 2 0 0 0-2 2v2h20V4ZM0 18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8H0v10Zm5-8h10a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z"/>
|
<svg
|
||||||
|
class="w-4 h-4 text-gray-400"
|
||||||
|
aria-hidden="true"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
fill="currentColor"
|
||||||
|
viewBox="0 0 20 20"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M20 4a2 2 0 0 0-2-2h-2V1a1 1 0 0 0-2 0v1h-3V1a1 1 0 0 0-2 0v1H6V1a1 1 0 0 0-2 0v1H2a2 2 0 0 0-2 2v2h20V4ZM0 18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8H0v10Zm5-8h10a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z"
|
||||||
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<input
|
<input
|
||||||
id="completedAt"
|
id="completedAt"
|
||||||
type="date"
|
type="date"
|
||||||
name="completedAt"
|
name="completedAt"
|
||||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500
|
class="border text-sm rounded-lg
|
||||||
focus:border-blue-500 block w-full ps-10 p-2.5 dark:bg-gray-700 dark:border-gray-600
|
block w-full ps-10 p-2.5 bg-gray-700 border-gray-600
|
||||||
dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
placeholder-gray-400 text-white focus:ring-blue-500 focus:border-blue-500"
|
||||||
value={completedAtDate}
|
value={completedAtDate}
|
||||||
placeholder="Date Completed"
|
placeholder="Date Completed"
|
||||||
>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label for="repeat"
|
<label
|
||||||
class="text-left block mb-2 text-sm font-medium text-gray-900 dark:text-white">Rewatched</label>
|
for="repeat"
|
||||||
|
class="text-left block mb-2 text-sm font-medium text-white"
|
||||||
|
>Rewatched</label
|
||||||
|
>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
name="repeat"
|
name="repeat"
|
||||||
min="0"
|
min="0"
|
||||||
id="repeat"
|
id="repeat"
|
||||||
class="bg-gray-50 border {currentAniListAnime.data.MediaList.repeat < 0 ?
|
class="border {currentAniListAnime.data.MediaList
|
||||||
'border-red-300 dark:border-red-500 border-[2px] text-rose-500 dark:text-rose-300 focus:ring-red-500 focus:border-red-500 dark:focus:ring-red-500 dark:focus:border-red-500' :
|
.repeat < 0
|
||||||
'border-gray-300 dark:border-gray-500 text-gray-900 dark:text-white focus:ring-blue-500 focus:border-blue-500 dark:focus:ring-blue-500 dark:focus:border-blue-500'
|
? 'border-red-500 border-[2px] text-rose-300 focus:ring-red-500 focus:border-red-500'
|
||||||
} text-sm rounded-lg block w-24 p-2.5 dark:bg-gray-600 dark:placeholder-gray-400 dark:text-white"
|
: 'border-gray-500 text-white focus:ring-blue-500 focus:border-blue-500'} text-sm rounded-lg block w-24 p-2.5 bg-gray-600 placeholder-gray-400 text-white"
|
||||||
bind:value={currentAniListAnime.data.MediaList.repeat}
|
bind:value={currentAniListAnime.data.MediaList.repeat}
|
||||||
required>
|
required
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col md:flex-row md:pl-10 md:pr-10 pt-5 pb-5 justify-center">
|
<div
|
||||||
|
class="flex flex-col md:flex-row md:pl-10 md:pr-10 pt-5 pb-5 justify-center"
|
||||||
|
>
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
<label for="notes" class="text-left block mb-2 text-sm font-medium text-gray-900 dark:text-white">Your
|
<label
|
||||||
notes</label>
|
for="notes"
|
||||||
<textarea id="notes" rows="3" name="notes"
|
class="text-left block mb-2 text-sm font-medium text-white"
|
||||||
class="block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
>Your notes</label
|
||||||
|
>
|
||||||
|
<textarea
|
||||||
|
id="notes"
|
||||||
|
rows="3"
|
||||||
|
name="notes"
|
||||||
|
class="block p-2.5 w-full text-sm rounded-lg border bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-blue-500 focus:border-blue-500"
|
||||||
placeholder="Write your thoughts here..."
|
placeholder="Write your thoughts here..."
|
||||||
bind:value={currentAniListAnime.data.MediaList.notes}></textarea>
|
bind:value={currentAniListAnime.data.MediaList.notes}
|
||||||
|
></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="external-data">
|
<div id="external-data">
|
||||||
<div id="anilist-data"
|
<div
|
||||||
class="flex flex-col md:flex-row md:pl-10 md:pr-10 pt-5 pb-5 justify-center md:gap-x-16 lg:gap-x-36 group">
|
id="anilist-data"
|
||||||
<h2 class="text-left mb-1 text-base font-semibold text-gray-900 dark:text-white">AniList</h2>
|
class="flex flex-col md:flex-row md:pl-10 md:pr-10 pt-5 pb-5 justify-center md:gap-x-16 lg:gap-x-36 group"
|
||||||
|
>
|
||||||
|
<h2 class="text-left mb-1 text-base font-semibold text-white">
|
||||||
|
AniList
|
||||||
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<AnimeTable/>
|
<AnimeTable />
|
||||||
|
|
||||||
<div class="bg-white flex rounded-lg shadow max-w-4-4 dark:bg-gray-800">
|
<div class="flex rounded-lg shadow max-w-4-4 bg-gray-800">
|
||||||
<div class="w-full mx-auto max-w-screen-xl p-4 md:flex md:items-center md:justify-start">
|
<div
|
||||||
<Button disabled={isSubmitting}
|
class="w-full mx-auto max-w-screen-xl p-4 md:flex md:items-center md:justify-start"
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
disabled={isSubmitting}
|
||||||
id="delete-button"
|
id="delete-button"
|
||||||
class="text-white bg-red-700 {$submitSuccess ?
|
class="text-white bg-red-700 {$submitSuccess
|
||||||
'dark:bg-green-600 hover:bg-green-800 dark:hover:bg-green-700 focus:ring-4 focus:ring-green-300 dark:focus:ring-green-800' :
|
? 'bg-green-600 hover:bg-green-700 focus:ring-4 focus:ring-green-300 dark:focus:ring-green-800'
|
||||||
'dark:bg-red-600 hover:bg-red-800 dark:hover:bg-red-700 focus:ring-4 focus:ring-red-300 dark:focus:ring-red-800'
|
: 'bg-red-600 hover:bg-red-700 focus:ring-4 focus:ring-red-300 dark:focus:ring-red-800'} font-medium
|
||||||
} font-medium
|
|
||||||
rounded-lg text-sm px-5 py-2.5 me-2 mb-2 focus:outline-none"
|
rounded-lg text-sm px-5 py-2.5 me-2 mb-2 focus:outline-none"
|
||||||
on:click={deleteEntries}>
|
on:click={deleteEntries}
|
||||||
<svg id="submit-loader" aria-hidden="true" role="status"
|
>
|
||||||
class="{isSubmitting ? 'inline': 'hidden'} w-4 h-4 me-3 text-white animate-spin"
|
<svg
|
||||||
viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
|
id="submit-loader"
|
||||||
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
|
aria-hidden="true"
|
||||||
fill="#E5E7EB"/>
|
role="status"
|
||||||
<path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
|
class="{isSubmitting
|
||||||
fill="currentColor"/>
|
? 'inline'
|
||||||
|
: 'hidden'} w-4 h-4 me-3 text-white animate-spin"
|
||||||
|
viewBox="0 0 100 101"
|
||||||
|
fill="none"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
|
||||||
|
fill="#E5E7EB"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
|
||||||
|
fill="currentColor"
|
||||||
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
Delete Entries
|
Delete Entries
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full mx-auto max-w-screen-xl p-4 md:flex md:items-center md:justify-end">
|
<div
|
||||||
<Button disabled={isSubmitting}
|
class="w-full mx-auto max-w-screen-xl p-4 md:flex md:items-center md:justify-end"
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
disabled={isSubmitting}
|
||||||
id="sync-button"
|
id="sync-button"
|
||||||
class="text-white bg-blue-700 {$submitSuccess ?
|
class="text-white bg-blue-700 {$submitSuccess
|
||||||
'dark:bg-green-600 hover:bg-green-800 dark:hover:bg-green-700 focus:ring-4 focus:ring-green-300 dark:focus:ring-green-800' :
|
? 'bg-green-600 hover:bg-green-700 focus:ring-4 focus:ring-green-300 dark:focus:ring-green-800'
|
||||||
'dark:bg-blue-600 hover:bg-blue-800 dark:hover:bg-blue-700 focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-800'
|
: 'bg-blue-600 hover:bg-blue-700 focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-800'} font-medium
|
||||||
} font-medium
|
|
||||||
rounded-lg text-sm px-5 py-2.5 me-2 mb-2 focus:outline-none"
|
rounded-lg text-sm px-5 py-2.5 me-2 mb-2 focus:outline-none"
|
||||||
type="submit">
|
type="submit"
|
||||||
<svg id="submit-loader" aria-hidden="true" role="status"
|
>
|
||||||
class="{isSubmitting ? 'inline': 'hidden'} w-4 h-4 me-3 text-white animate-spin"
|
<svg
|
||||||
viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
|
id="submit-loader"
|
||||||
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
|
aria-hidden="true"
|
||||||
fill="#E5E7EB"/>
|
role="status"
|
||||||
<path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
|
class="{isSubmitting
|
||||||
fill="currentColor"/>
|
? 'inline'
|
||||||
|
: 'hidden'} w-4 h-4 me-3 text-white animate-spin"
|
||||||
|
viewBox="0 0 100 101"
|
||||||
|
fill="none"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
|
||||||
|
fill="#E5E7EB"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
|
||||||
|
fill="currentColor"
|
||||||
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
Sync Changes
|
Sync Changes
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
class="text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4
|
class="border focus:outline-none focus:ring-4
|
||||||
focus:ring-gray-100 font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 dark:bg-gray-800 dark:text-white
|
font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 bg-gray-800 text-white
|
||||||
dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700"
|
border-gray-600 hover:bg-gray-700 hover:border-gray-600 focus:ring-gray-700"
|
||||||
on:click={async () => {
|
on:click={async () => {
|
||||||
await CheckIfAniListLoggedInAndLoadWatchList()
|
await CheckIfAniListLoggedInAndLoadWatchList();
|
||||||
return push('/')
|
return push("/");
|
||||||
}}>
|
}}
|
||||||
|
>
|
||||||
Go Home
|
Go Home
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<h3 class="text-2xl">
|
<h3 class="text-2xl">Summary</h3>
|
||||||
Summary
|
|
||||||
</h3>
|
|
||||||
<p>{@html currentAniListAnime.data.MediaList.media.description}</p>
|
<p>{@html currentAniListAnime.data.MediaList.media.description}</p>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
@ -1,88 +1,88 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {createTable, Render, Subscribe} from "svelte-headless-table";
|
import { createTable, Render, Subscribe } from "svelte-headless-table";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { addSortBy } from "svelte-headless-table/plugins";
|
import { addSortBy } from "svelte-headless-table/plugins";
|
||||||
import {tableItems} from "../helperModules/GlobalVariablesAndHelperFunctions.svelte"
|
import { tableItems } from "../helperModules/GlobalVariablesAndHelperFunctions.svelte";
|
||||||
|
|
||||||
//when adding sort here is code { sort: addSortBy() }
|
//when adding sort here is code { sort: addSortBy() }
|
||||||
const table = createTable(tableItems, { sort: addSortBy() })
|
const table = createTable(tableItems, { sort: addSortBy() });
|
||||||
|
|
||||||
const columns = table.createColumns([
|
const columns = table.createColumns([
|
||||||
table.column({
|
table.column({
|
||||||
header: "Service Id",
|
header: "Service Id",
|
||||||
accessor: 'id',
|
accessor: "id",
|
||||||
}),
|
}),
|
||||||
table.column({
|
table.column({
|
||||||
header: "Anime Title",
|
header: "Anime Title",
|
||||||
accessor: "title",
|
accessor: "title",
|
||||||
}),
|
}),
|
||||||
table.column({
|
table.column({
|
||||||
header: 'Service',
|
header: "Service",
|
||||||
accessor: 'service',
|
accessor: "service",
|
||||||
}),
|
}),
|
||||||
table.column({
|
table.column({
|
||||||
header: 'Episode Progress',
|
header: "Episode Progress",
|
||||||
accessor: 'progress',
|
accessor: "progress",
|
||||||
}),
|
}),
|
||||||
table.column({
|
table.column({
|
||||||
header: 'Status',
|
header: "Status",
|
||||||
accessor: 'status',
|
accessor: "status",
|
||||||
}),
|
}),
|
||||||
table.column({
|
table.column({
|
||||||
header: 'Started At',
|
header: "Started At",
|
||||||
accessor: 'startedAt',
|
accessor: "startedAt",
|
||||||
}),
|
}),
|
||||||
table.column({
|
table.column({
|
||||||
header: 'Completed At',
|
header: "Completed At",
|
||||||
accessor: 'completedAt',
|
accessor: "completedAt",
|
||||||
}),
|
}),
|
||||||
table.column({
|
table.column({
|
||||||
header: 'Rating',
|
header: "Rating",
|
||||||
accessor: 'score',
|
accessor: "score",
|
||||||
}),
|
}),
|
||||||
table.column({
|
table.column({
|
||||||
header: 'Repeat',
|
header: "Repeat",
|
||||||
accessor: 'repeat',
|
accessor: "repeat",
|
||||||
}),
|
}),
|
||||||
table.column({
|
table.column({
|
||||||
header: 'Notes',
|
header: "Notes",
|
||||||
accessor: 'notes',
|
accessor: "notes",
|
||||||
}),
|
}),
|
||||||
])
|
]);
|
||||||
|
|
||||||
//add pluginStates when add sort back
|
//add pluginStates when add sort back
|
||||||
const {
|
const { headerRows, rows, tableAttrs, tableBodyAttrs } =
|
||||||
headerRows,
|
table.createViewModel(columns);
|
||||||
rows,
|
|
||||||
tableAttrs,
|
|
||||||
tableBodyAttrs,
|
|
||||||
} = table.createViewModel(columns)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="relative overflow-x-auto rounded-lg mb-5">
|
<div class="relative overflow-x-auto rounded-lg mb-5">
|
||||||
<table
|
<table
|
||||||
class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400"
|
class="w-full text-sm text-left rtl:text-right text-gray-400"
|
||||||
{...$tableAttrs}
|
{...$tableAttrs}
|
||||||
>
|
>
|
||||||
<thead
|
<thead class="text-xs uppercase bg-gray-700 text-gray-400">
|
||||||
class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400"
|
|
||||||
>
|
|
||||||
{#each $headerRows as headerRow (headerRow.id)}
|
{#each $headerRows as headerRow (headerRow.id)}
|
||||||
<Subscribe attrs={headerRow.attrs()} let:attrs>
|
<Subscribe attrs={headerRow.attrs()} let:attrs>
|
||||||
<tr {...attrs}>
|
<tr {...attrs}>
|
||||||
{#each headerRow.cells as cell (cell.id)}
|
{#each headerRow.cells as cell (cell.id)}
|
||||||
<Subscribe attrs={cell.attrs()} let:attrs props={cell.props()} let:props>
|
<Subscribe
|
||||||
|
attrs={cell.attrs()}
|
||||||
|
let:attrs
|
||||||
|
props={cell.props()}
|
||||||
|
let:props
|
||||||
|
>
|
||||||
<th
|
<th
|
||||||
{...attrs}
|
{...attrs}
|
||||||
on:click={props.sort.toggle}
|
on:click={props.sort.toggle}
|
||||||
class:sorted={props.sort.order !== undefined}
|
class:sorted={props.sort.order !==
|
||||||
|
undefined}
|
||||||
class="px-6 py-3"
|
class="px-6 py-3"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<Render of={cell.render()}/>
|
<Render of={cell.render()} />
|
||||||
{#if props.sort.order === 'asc'}
|
{#if props.sort.order === "asc"}
|
||||||
⬇️
|
⬇️
|
||||||
{:else if props.sort.order === 'desc'}
|
{:else if props.sort.order === "desc"}
|
||||||
⬆️
|
⬆️
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
@ -96,14 +96,11 @@
|
|||||||
<tbody {...$tableBodyAttrs}>
|
<tbody {...$tableBodyAttrs}>
|
||||||
{#each $rows as row (row.id)}
|
{#each $rows as row (row.id)}
|
||||||
<Subscribe attrs={row.attrs()} let:attrs>
|
<Subscribe attrs={row.attrs()} let:attrs>
|
||||||
<tr
|
<tr {...attrs} class="bg-gray-800 border-gray-700">
|
||||||
{...attrs}
|
|
||||||
class="bg-white border-b dark:bg-gray-800 dark:border-gray-700"
|
|
||||||
>
|
|
||||||
{#each row.cells as cell (cell.id)}
|
{#each row.cells as cell (cell.id)}
|
||||||
<Subscribe attrs={cell.attrs()} let:attrs>
|
<Subscribe attrs={cell.attrs()} let:attrs>
|
||||||
<td {...attrs} class="px-6 py-4">
|
<td {...attrs} class="px-6 py-4">
|
||||||
<Render of={cell.render()}/>
|
<Render of={cell.render()} />
|
||||||
</td>
|
</td>
|
||||||
</Subscribe>
|
</Subscribe>
|
||||||
{/each}
|
{/each}
|
||||||
|
@ -1,76 +1,99 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { Avatar } from "flowbite-svelte";
|
||||||
import {Avatar} from "flowbite-svelte";
|
import type { AniListUser } from "../anilist/types/AniListTypes";
|
||||||
import type {AniListUser} from "../anilist/types/AniListTypes";
|
import {
|
||||||
import {aniListLoggedIn, aniListUser, malLoggedIn, simklLoggedIn, logoutOfAniList, logoutOfMAL, logoutOfSimkl} from "../helperModules/GlobalVariablesAndHelperFunctions.svelte"
|
aniListLoggedIn,
|
||||||
|
aniListUser,
|
||||||
|
malLoggedIn,
|
||||||
|
simklLoggedIn,
|
||||||
|
logoutOfAniList,
|
||||||
|
logoutOfMAL,
|
||||||
|
logoutOfSimkl,
|
||||||
|
} from "../helperModules/GlobalVariablesAndHelperFunctions.svelte";
|
||||||
import * as runtime from "../../wailsjs/runtime";
|
import * as runtime from "../../wailsjs/runtime";
|
||||||
|
|
||||||
let currentAniListUser: AniListUser
|
let currentAniListUser: AniListUser;
|
||||||
let isAniListLoggedIn: boolean
|
let isAniListLoggedIn: boolean;
|
||||||
let isSimklLoggedIn: boolean
|
let isSimklLoggedIn: boolean;
|
||||||
let isMALLoggedIn: boolean
|
let isMALLoggedIn: boolean;
|
||||||
|
|
||||||
aniListUser.subscribe((value) => currentAniListUser = value)
|
aniListUser.subscribe((value) => (currentAniListUser = value));
|
||||||
aniListLoggedIn.subscribe((value) => isAniListLoggedIn = value)
|
aniListLoggedIn.subscribe((value) => (isAniListLoggedIn = value));
|
||||||
simklLoggedIn.subscribe((value) => isSimklLoggedIn = value)
|
simklLoggedIn.subscribe((value) => (isSimklLoggedIn = value));
|
||||||
malLoggedIn.subscribe((value) => isMALLoggedIn = value)
|
malLoggedIn.subscribe((value) => (isMALLoggedIn = value));
|
||||||
|
|
||||||
function dropdownUser(): void {
|
function dropdownUser(): void {
|
||||||
let dropdown = document.querySelector("#userDropdown")
|
let dropdown = document.querySelector("#userDropdown");
|
||||||
dropdown.classList.toggle("hidden")
|
dropdown.classList.toggle("hidden");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
<button id="userDropdownButton" on:click={dropdownUser}>
|
<button id="userDropdownButton" on:click={dropdownUser}>
|
||||||
{#if isAniListLoggedIn}
|
{#if isAniListLoggedIn}
|
||||||
<Avatar src="{currentAniListUser.data.Viewer.avatar.medium}" class="cursor-pointer"
|
<Avatar
|
||||||
dot={{ color: 'green' }}/>
|
src={currentAniListUser.data.Viewer.avatar.medium}
|
||||||
|
class="cursor-pointer"
|
||||||
|
dot={{ color: "green" }}
|
||||||
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<Avatar class="cursor-pointer" dot={{ color: 'red' }}/>
|
<Avatar class="cursor-pointer" dot={{ color: "red" }} />
|
||||||
{/if}
|
{/if}
|
||||||
</button>
|
</button>
|
||||||
<div id="userDropdown"
|
<div
|
||||||
class="absolute hidden right-0 2xl:left-1/2 2xl:-translate-x-1/2 z-10 bg-white divide-y divide-gray-100 rounded-lg shadow w-44 dark:bg-gray-700 dark:divide-gray-600">
|
id="userDropdown"
|
||||||
<div class="px-4 py-3 text-sm text-gray-900 dark:text-white">
|
class="absolute hidden right-0 2xl:left-1/2 2xl:-translate-x-1/2 z-10 divide-y rounded-lg shadow w-44 bg-gray-700 divide-gray-600"
|
||||||
|
>
|
||||||
|
<div class="px-4 py-3 text-sm text-white">
|
||||||
{#if isAniListLoggedIn}
|
{#if isAniListLoggedIn}
|
||||||
<div>{currentAniListUser.data.Viewer.name}</div>
|
<div>{currentAniListUser.data.Viewer.name}</div>
|
||||||
{:else}
|
{:else}
|
||||||
<div>You are not logged into AniList</div>
|
<div>You are not logged into AniList</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<ul class="py-2 text-sm text-gray-700 dark:text-gray-200"
|
<ul
|
||||||
aria-labelledby="dropdownUserAvatarButton">
|
class="py-2 text-sm text-gray-200"
|
||||||
|
aria-labelledby="dropdownUserAvatarButton"
|
||||||
|
>
|
||||||
{#if isAniListLoggedIn}
|
{#if isAniListLoggedIn}
|
||||||
<li>
|
<li>
|
||||||
<button on:click={logoutOfAniList}
|
<button
|
||||||
class="block px-4 py-2 w-full hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">
|
on:click={logoutOfAniList}
|
||||||
|
class="block px-4 py-2 w-full hover:bg-gray-600 hover:text-white"
|
||||||
|
>
|
||||||
Logout Anilist
|
Logout Anilist
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
{/if}
|
{/if}
|
||||||
{#if isMALLoggedIn}
|
{#if isMALLoggedIn}
|
||||||
<li>
|
<li>
|
||||||
<button on:click={logoutOfMAL}
|
<button
|
||||||
class="block px-4 py-2 w-full hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">
|
on:click={logoutOfMAL}
|
||||||
|
class="block px-4 py-2 w-full hover:bg-gray-600 hover:text-white"
|
||||||
|
>
|
||||||
Logout MAL
|
Logout MAL
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
{/if}
|
{/if}
|
||||||
{#if isSimklLoggedIn}
|
{#if isSimklLoggedIn}
|
||||||
<li>
|
<li>
|
||||||
<button on:click={logoutOfSimkl}
|
<button
|
||||||
class="block px-4 py-2 w-full hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">
|
on:click={logoutOfSimkl}
|
||||||
|
class="block px-4 py-2 w-full hover:bg-gray-600 hover:text-white"
|
||||||
|
>
|
||||||
Logout Simkl
|
Logout Simkl
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
{/if}
|
{/if}
|
||||||
</ul>
|
</ul>
|
||||||
<div class="py-2">
|
<div class="py-2">
|
||||||
<button on:click={() => runtime.Quit()}
|
<button
|
||||||
class="block px-4 py-2 w-full text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white">
|
on:click={() => runtime.Quit()}
|
||||||
|
class="block px-4 py-2 w-full text-sm hover:bg-gray-600 text-gray-200 over:text-white"
|
||||||
|
>
|
||||||
Exit Application
|
Exit Application
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -50,14 +50,14 @@
|
|||||||
{#if page === 1}
|
{#if page === 1}
|
||||||
<li>
|
<li>
|
||||||
<button disabled
|
<button disabled
|
||||||
class="flex items-center justify-center px-4 h-10 ms-0 leading-tight text-gray-500 bg-white border border-e-0 border-gray-300 rounded-s-lg dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 cursor-default">
|
class="flex items-center justify-center px-4 h-10 ms-0 leading-tight border border-e-0 rounded-s-lg border-gray-700 text-gray-400 cursor-default">
|
||||||
Previous
|
Previous
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
{:else}
|
{:else}
|
||||||
<li>
|
<li>
|
||||||
<button on:click={() => ChangeWatchListPage(page-1)}
|
<button on:click={() => ChangeWatchListPage(page-1)}
|
||||||
class="flex items-center justify-center px-4 h-10 ms-0 leading-tight text-gray-500 bg-white border border-e-0 border-gray-300 rounded-s-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white">
|
class="flex items-center justify-center px-4 h-10 ms-0 leading-tight border border-e-0 rounded-s-lg border-gray-700 text-gray-400 hover:bg-gray-700 hover:text-white">
|
||||||
Previous
|
Previous
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
@ -66,26 +66,26 @@
|
|||||||
{#if i + 1 === page}
|
{#if i + 1 === page}
|
||||||
<li>
|
<li>
|
||||||
<button on:click={() => ChangeWatchListPage(i+1)}
|
<button on:click={() => ChangeWatchListPage(i+1)}
|
||||||
class="flex items-center justify-center px-4 h-10 leading-tight border border-gray-300 bg-gray-100 dark:border-gray-700 dark:bg-gray-700 dark:text-white">{i + 1}</button>
|
class="flex items-center justify-center px-4 h-10 leading-tight border bg-gray-100 border-gray-700 bg-gray-700 text-white">{i + 1}</button>
|
||||||
</li>
|
</li>
|
||||||
{:else}
|
{:else}
|
||||||
<li>
|
<li>
|
||||||
<button on:click={() => ChangeWatchListPage(i+1)}
|
<button on:click={() => ChangeWatchListPage(i+1)}
|
||||||
class="flex items-center justify-center px-4 h-10 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white">{i + 1}</button>
|
class="flex items-center justify-center px-4 h-10 leading-tight border dark border-gray-700 text-gray-400 hover:bg-gray-700 hover:text-white">{i + 1}</button>
|
||||||
</li>
|
</li>
|
||||||
{/if}
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
{#if page === aniListWatchListLoaded.data.Page.pageInfo.lastPage}
|
{#if page === aniListWatchListLoaded.data.Page.pageInfo.lastPage}
|
||||||
<li>
|
<li>
|
||||||
<button disabled
|
<button disabled
|
||||||
class="flex items-center justify-center px-4 h-10 leading-tight text-gray-500 bg-white border border-gray-300 rounded-e-lg dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 cursor-default">
|
class="flex items-center justify-center px-4 h-10 leading-tight border rounded-e-lg dark border-gray-700 text-gray-400 cursor-default">
|
||||||
Next
|
Next
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
{:else}
|
{:else}
|
||||||
<li>
|
<li>
|
||||||
<button on:click={() => ChangeWatchListPage(page+1)}
|
<button on:click={() => ChangeWatchListPage(page+1)}
|
||||||
class="flex items-center justify-center px-4 h-10 leading-tight text-gray-500 bg-white border border-gray-300 rounded-e-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white">
|
class="flex items-center justify-center px-4 h-10 leading-tight border rounded-e-lg dark border-gray-700 text-gray-400 hover:bg-gray-700 hover:text-white">
|
||||||
Next
|
Next
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
@ -96,7 +96,7 @@
|
|||||||
<div class="flex mt-5">
|
<div class="flex mt-5">
|
||||||
<div class="w-20 mx-auto">
|
<div class="w-20 mx-auto">
|
||||||
<select bind:value={perPage} on:change={(e) => changeCountPerPage(e)} id="countPerPage"
|
<select bind:value={perPage} on:change={(e) => changeCountPerPage(e)} id="countPerPage"
|
||||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500">
|
class="border text-sm rounded-lg block w-full p-2.5 bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-blue-500 focus:border-blue-500">
|
||||||
{#each perPageOptions as option}
|
{#each perPageOptions as option}
|
||||||
<option value={option}>
|
<option value={option}>
|
||||||
{option}
|
{option}
|
||||||
@ -117,8 +117,8 @@
|
|||||||
<div class="max-w-xs mx-auto">
|
<div class="max-w-xs mx-auto">
|
||||||
<div class="relative flex items-center max-w-[11rem]">
|
<div class="relative flex items-center max-w-[11rem]">
|
||||||
<button type="button" id="decrement-button" on:click={() => ChangeWatchListPage(page-1)}
|
<button type="button" id="decrement-button" on:click={() => ChangeWatchListPage(page-1)}
|
||||||
class="bg-gray-100 dark:bg-gray-700 dark:hover:bg-gray-600 dark:border-gray-600 hover:bg-gray-200 border border-gray-300 rounded-s-lg p-3 h-11 focus:ring-gray-100 dark:focus:ring-gray-700 focus:ring-2 focus:outline-none">
|
class="bg-gray-700 hover:bg-gray-600 border-gray-600 border rounded-s-lg p-3 h-11 focus:ring-gray-700 focus:ring-2 focus:outline-none">
|
||||||
<svg class="w-3 h-3 text-gray-900 dark:text-white" aria-hidden="true"
|
<svg class="w-3 h-3 text-white" aria-hidden="true"
|
||||||
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 2">
|
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 2">
|
||||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||||
d="M1 1h16"/>
|
d="M1 1h16"/>
|
||||||
@ -126,14 +126,14 @@
|
|||||||
</button>
|
</button>
|
||||||
<input type="number" min="1" max="{aniListWatchListLoaded.data.Page.pageInfo.lastPage}"
|
<input type="number" min="1" max="{aniListWatchListLoaded.data.Page.pageInfo.lastPage}"
|
||||||
on:keydown={changePage} id="page-counter"
|
on:keydown={changePage} id="page-counter"
|
||||||
class="[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none bg-gray-50 border-x-0 border-gray-300 h-11 font-medium text-center text-gray-900 text-sm focus:ring-blue-500 focus:border-blue-500 block w-full pb-6 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
class="[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none border-x-0 h-11 font-medium text-center text-sm block w-full pb-6 bg-gray-700 border-gray-600 placeholder-gray-400 text-white focus:ring-blue-500 focus:border-blue-500"
|
||||||
value={page} required/>
|
value={page} required/>
|
||||||
<div class="absolute bottom-1 start-1/2 -translate-x-1/2 rtl:translate-x-1/2 flex items-center text-xs text-gray-400 space-x-1 rtl:space-x-reverse">
|
<div class="absolute bottom-1 start-1/2 -translate-x-1/2 rtl:translate-x-1/2 flex items-center text-xs text-gray-400 space-x-1 rtl:space-x-reverse">
|
||||||
<span>Page #</span>
|
<span>Page #</span>
|
||||||
</div>
|
</div>
|
||||||
<button type="button" id="increment-button" on:click={() => ChangeWatchListPage(page+1)}
|
<button type="button" id="increment-button" on:click={() => ChangeWatchListPage(page+1)}
|
||||||
class="bg-gray-100 dark:bg-gray-700 dark:hover:bg-gray-600 dark:border-gray-600 hover:bg-gray-200 border border-gray-300 rounded-e-lg p-3 h-11 focus:ring-gray-100 dark:focus:ring-gray-700 focus:ring-2 focus:outline-none">
|
class="hover:bg-gray-600 border-gray-600 border rounded-e-lg p-3 h-11 focus:ring-gray-700 focus:ring-2 focus:outline-none">
|
||||||
<svg class="w-3 h-3 text-gray-900 dark:text-white" aria-hidden="true"
|
<svg class="w-3 h-3 text-white" aria-hidden="true"
|
||||||
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 18">
|
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 18">
|
||||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||||
d="M9 1v16M1 9h16"/>
|
d="M9 1v16M1 9h16"/>
|
||||||
|
@ -25,11 +25,11 @@
|
|||||||
|
|
||||||
<div id="searchDropdown" class="relative w-64 md:w-48">
|
<div id="searchDropdown" class="relative w-64 md:w-48">
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<label for="anime-search" class="mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white">Find
|
<label for="anime-search" class="mb-2 text-sm font-medium sr-only text-white">Find
|
||||||
Anime</label>
|
Anime</label>
|
||||||
<div class="relative w-full">
|
<div class="relative w-full">
|
||||||
<input type="search" id="anime-search" bind:value={aniSearch}
|
<input type="search" id="anime-search" bind:value={aniSearch}
|
||||||
class="rounded-s-lg block p-2.5 w-full z-20 text-sm text-gray-900 bg-gray-50 rounded-e-lg border-s-gray-50 border-s-2 border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-s-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:border-blue-500"
|
class="rounded-s-lg block p-2.5 w-full z-20 text-sm rounded-e-lg bg-gray-700 border-s-gray-700 border-gray-600 placeholder-gray-400 text-white focus:border-blue-500"
|
||||||
placeholder="Search for Anime"
|
placeholder="Search for Anime"
|
||||||
on:keypress={(e) => {
|
on:keypress={(e) => {
|
||||||
if (e.key === "Enter") {
|
if (e.key === "Enter") {
|
||||||
@ -39,7 +39,7 @@
|
|||||||
}}
|
}}
|
||||||
required/>
|
required/>
|
||||||
<button id="aniListSearchButton"
|
<button id="aniListSearchButton"
|
||||||
class="absolute top-0 end-0 h-full p-2.5 text-sm font-medium text-white bg-blue-700 rounded-e-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
|
class="absolute top-0 end-0 h-full p-2.5 text-sm font-medium rounded-e-lg border focus:ring-4 focus:outline-none bg-blue-600 hover:bg-blue-700 focus:ring-blue-800"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
searchDropdown()
|
searchDropdown()
|
||||||
if(aniSearch.length > 0) runAniListSearch()
|
if(aniSearch.length > 0) runAniListSearch()
|
||||||
@ -60,7 +60,7 @@
|
|||||||
aria-labelledby="aniListSearchButton">
|
aria-labelledby="aniListSearchButton">
|
||||||
{#each aniListSearch.data.Page.media as media}
|
{#each aniListSearch.data.Page.media as media}
|
||||||
<li class="w-full">
|
<li class="w-full">
|
||||||
<div class="flex w-full items-start p-1 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white rounded-lg">
|
<div class="flex w-full items-start p-1 hover:bg-gray-600 hover:text-white rounded-lg">
|
||||||
<button on:click={() => {
|
<button on:click={() => {
|
||||||
searchDropdown()
|
searchDropdown()
|
||||||
push(`#/anime/${media.id}`)
|
push(`#/anime/${media.id}`)
|
||||||
|
Loading…
Reference in New Issue
Block a user