From 9d1f8edc9ea2871fd234a15140a52726b8ffb583 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 21 Jan 2024 17:56:22 -0800 Subject: refactor(wrapped): move tool to module --- src/lib/Tools/Wrapped/Tool.svelte | 790 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 790 insertions(+) create mode 100644 src/lib/Tools/Wrapped/Tool.svelte (limited to 'src/lib/Tools/Wrapped') diff --git a/src/lib/Tools/Wrapped/Tool.svelte b/src/lib/Tools/Wrapped/Tool.svelte new file mode 100644 index 00000000..b2f715cb --- /dev/null +++ b/src/lib/Tools/Wrapped/Tool.svelte @@ -0,0 +1,790 @@ + + +{#if currentUserIdentity.id === -2} +
Please log in to view this page.
+{:else if currentUserIdentity.id !== -1} + {#await selectedYear !== currentYear || useFullActivityHistory || new Date().getMonth() <= 6 ? fullActivityHistory(user, currentUserIdentity, selectedYear) : getActivityHistory(currentUserIdentity)} + + {@html nbsp(`Loading${useFullActivityHistory ? ' full-year' : ''} activity history ...`)} + + {:then activities} + {#await wrapped(user, currentUserIdentity, selectedYear)} + + {@html nbsp('Loading user data ...')} + + {:then wrapped} +
+
+
+ {#if !disableActivityHistory && activityHistoryPosition === 'TOP' && activities.length > 0 && selectedYear === currentYear} + + {/if} +
+ + + +
+ {#if !disableActivityHistory && activityHistoryPosition === 'BELOW_TOP' && activities.length > 0 && selectedYear === currentYear} + + {/if} + + {#if topMedia && topGenresTags && ((topMedia.topGenreMedia && topMedia.genres.length > 0) || (topMedia.topTagMedia && topMedia.tags.length > 0))} + + {/if} + {#if !disableActivityHistory && activityHistoryPosition === 'ORIGINAL' && activities.length > 0 && selectedYear === currentYear} + + {/if} + {#if watermark} + + {/if} +
+
+
+
+
+ + {#if generated} +

+ +

+ Click on the image to download, or right click and select "Save Image As...". +
+ {/if} +
+ + {#if generated} +

+ {/if} + +

+ + +
+ Display + + Show watermark
+ Enable background transparency
+ + Enable light mode
+ + Show top genres and tags
+ + Hide activity history
+ Show highest + rated media percentages
+ Show highest + rated genre and tag percentages
+ Show + ongoing media from previous years
+ + Activity history position
+ + Highest rated media count
+ + Highest genre and tag count
+ + + + Width adjustment
+
+ +
+ Calculation + + + Enable full-year activity +
+ + Calculate for year
+ + Anime and manga sort
+ + Genre and tag sort
+ Include music
+ Include rewatches & rereads
+ Include specials
+ Include OVAs
+ Include movies
+ { + e.key === 'Enter' && submitExcludedKeywords(); + }} + /> + Excluded keywords + +
+ Comma separated list (e.g., "My Hero, Kaguya") +
+
+
+
+ {:catch} + + {/await} + {:catch} + + {#if useFullActivityHistory} +

+ With many activities, it may take multiple attempts to obtain all of your activity history + from AniList. If this occurs, wait one minute and try again to continue populating your local + activity history database. +

+ {/if} +
+ {/await} +{:else} + + {@html nbsp('Loading user identity ...')} + +{/if} + + -- cgit v1.2.3