From 9126e10dcc365eba50e9b45efb0e8a98d74a1027 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sat, 2 Dec 2023 19:43:45 -0800 Subject: fix(wrapped): make wrapped independent --- src/lib/Tools/Wrapped.svelte | 119 +++++++++++++++++++++---------------------- 1 file changed, 59 insertions(+), 60 deletions(-) (limited to 'src/lib/Tools') diff --git a/src/lib/Tools/Wrapped.svelte b/src/lib/Tools/Wrapped.svelte index d5e12326..d0fbab5b 100644 --- a/src/lib/Tools/Wrapped.svelte +++ b/src/lib/Tools/Wrapped.svelte @@ -78,14 +78,6 @@ }; onMount(async () => { - new MutationObserver((_mutations) => updateWidth()).observe( - document.querySelector('#wrapped')!, - { - childList: true, - subtree: true - } - ); - if (user !== undefined) { if ($userIdentity === '') { userIdentity.set(JSON.stringify(await getUserIdentity(user))); @@ -171,6 +163,14 @@ for (const media of mangaList) { chapters += media.mediaListEntry?.progress || 0; } + + new MutationObserver((_mutations) => updateWidth()).observe( + document.querySelector('#wrapped')!, + { + childList: true, + subtree: true + } + ); }; /* eslint-disable @typescript-eslint/no-explicit-any */ @@ -259,13 +259,13 @@ const proxy = (url: string) => `/api/proxy?url=${encodeURIComponent(url)}`; -
- {#if currentUserIdentity.id === -2} - Please log in to view this page. - {:else if currentUserIdentity.id !== -1} - {#await wrapped(user, currentUserIdentity)} - Loading ... - {:then wrapped} +{#if currentUserIdentity.id === -2} + Please log in to view this page. +{:else if currentUserIdentity.id !== -1} + {#await wrapped(user, currentUserIdentity)} + Loading ... + {:then wrapped} +
due.moe/wrapped
{/if}
+
+ +

+ +

+ This is a minimal, live preview. Generated images will be higher quality and themed properly. +
+ +

+ + + +

+ +

+ screenshot(!forceDark)}>Generate image +

+ +
+ Options +
+ Enable watermark
+ Enable background transparency
+ + Enable light mode (dark by default)
+ Include music
+ Include rewatches & rereads
+ Include specials and OVAs
+ + Highest rated media count +
+
-
- -
- This is a minimal, live preview. Generated images will be higher quality and themed - properly. -
- -

- - - -

- -

- screenshot(!forceDark)}>Generate image -

- -
- Options -
- Enable watermark
- Enable background transparency
- - Enable light mode (dark by default)
- Include music
- Include rewatches & rereads
- Include specials and OVAs
- - Highest rated media count -
-
- -
+

-

- {:catch} - - {/await} - {:else} - Loading ... - {/if} -
+
+ {:catch} + + {/await} +{:else} + Loading ... +{/if}