From fc030ace75dcd6f32ed63d11b34d1f0abc379c90 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 22 Nov 2023 18:14:36 -0800 Subject: feat(wrapped): adjust window length --- src/lib/Tools/Wrapped.svelte | 336 ++++++++++++++++++++++--------------------- 1 file changed, 170 insertions(+), 166 deletions(-) (limited to 'src/lib/Tools') diff --git a/src/lib/Tools/Wrapped.svelte b/src/lib/Tools/Wrapped.svelte index 3eb0a373..f8879814 100644 --- a/src/lib/Tools/Wrapped.svelte +++ b/src/lib/Tools/Wrapped.svelte @@ -30,6 +30,7 @@ let includeMusic = false; let includeSpecials = false; let includeRepeats = false; + let width = 980; $: { includeMusic = includeMusic; @@ -128,8 +129,8 @@ }; /* eslint-disable @typescript-eslint/no-explicit-any */ - const year = (statistic: { startYears: any }) => - statistic.startYears.find((y: { startYear: number }) => y.startYear === 2023); + // const year = (statistic: { startYears: any }) => + // statistic.startYears.find((y: { startYear: number }) => y.startYear === 2023); const screenshot = async (dark = false) => { let element = document.querySelector('.categories-grid') as HTMLElement; @@ -204,181 +205,184 @@ }; -{#if currentUserIdentity.id === -2} - Please log in to view this page. -{:else if currentUserIdentity.id !== -1} - {#await wrapped(user, currentUserIdentity)} - Loading ... - {:then wrapped} -
-
- - User Avatar - -
+
+ {#if currentUserIdentity.id === -2} + Please log in to view this page. + {:else if currentUserIdentity.id !== -1} + {#await wrapped(user, currentUserIdentity)} + Loading ... + {:then wrapped} +
+
+ + User Avatar +
- - - {currentUserIdentity.name} - - + +
+ Status Posts: {wrapped.activities.statusCount} +
+
+ Messages: {wrapped.activities.messageCount} +
+
+ Days Active: {#await activityHistory(currentUserIdentity)} + Loading ... + {:then activities} + {#if activities === undefined} + Loading ... + {:else} + {fillMissingDays(activities, true).filter((a) => a.amount !== 0).length}/365 + {/if} + {/await} +
-
- Status Posts: {wrapped.activities.statusCount} +
+
+
+ Anime
-
- Messages: {wrapped.activities.messageCount} +
+ Time Watched: {((minutesWatched || 0) / 60 / 24).toFixed(2)} days
-
- Days Active: {#await activityHistory(currentUserIdentity)} - Loading ... - {:then activities} - {#if activities === undefined} - Loading ... - {:else} - {fillMissingDays(activities, true).filter((a) => a.amount !== 0).length}/365 - {/if} - {/await} +
+ Completed: {animeList?.length}
+
Episodes: {episodes}
-
-
-
- Anime -
-
- Time Watched: {((minutesWatched || 0) / 60 / 24).toFixed(2)} days -
-
- Completed: {animeList?.length} -
-
Episodes: {episodes}
-
-
-
- Manga -
-
- Time Read: {((chapters * 8.58) / 60 / 24).toFixed(2)} days -
-
- Completed: {mangaList?.length} +
+
+ Manga +
+
+ Time Read: {((chapters * 8.58) / 60 / 24).toFixed(2)} days +
+
+ Completed: {mangaList?.length} +
+
+ Chapters: {chapters} +
-
- Chapters: {chapters} +
+
+ {#if animeList !== undefined} + + Highest Rated Anime Cover + + + {:else} + Loading ... + {/if} +
-
-
-
- {#if animeList !== undefined} - - Highest Rated Anime Cover - - - {:else} - Loading ... - {/if} +
+
+ {#if mangaList !== undefined} + + Highest Rated Manga Cover + + + {:else} + Loading ... + {/if} +
+ {#if watermark} +
due.moe/wrapped
+ {/if}
-
-
- {#if mangaList !== undefined} - - Highest Rated Manga Cover - - - {:else} - Loading ... - {/if} -
+ +
+ +

+ Don't be alarmed! The background will appear as its inverse in the preview, but will be + corrected in the final image. Media covers may not appear on mobile Apple devices. +

+ +
+ Enable watermark
+ Enable background transparency
+ Include music
+ Include rewatches & rereads
+ Include specials and OVAs
+ Width ({width} px):
+ Fit long titles
+ {#if abbreviateTitles} + Maximum title length
+ {/if}
- {#if watermark} -
due.moe/wrapped
- {/if} -
- -
- -

- Don't be alarmed! The background will appear as its inverse in the preview, but will be - corrected in the final image. Media covers may not appear on mobile Apple devices. -

- -
- Enable watermark
- Enable background transparency
- Include music
- Include rewatches & rereads
- Include specials and OVAs
- Fit long titles
- {#if abbreviateTitles} - Maximum title length
- {/if} -
- -
- - - -
- -
- {:catch} - - {/await} -{:else} - Loading ... -{/if} + +
+ + + +
+ +
+ {:catch} + + {/await} + {:else} + Loading ... + {/if} +