From 1d0ffdba530fa166ac577ef1fba3b5a0a959959a Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 3 Jan 2024 22:05:24 -0800 Subject: refactor(wrapped): move panels to components --- src/lib/Tools/Wrapped.svelte | 403 +++++-------------------------------------- 1 file changed, 41 insertions(+), 362 deletions(-) (limited to 'src/lib/Tools/Wrapped.svelte') diff --git a/src/lib/Tools/Wrapped.svelte b/src/lib/Tools/Wrapped.svelte index 07c722ee..29ef0919 100644 --- a/src/lib/Tools/Wrapped.svelte +++ b/src/lib/Tools/Wrapped.svelte @@ -20,12 +20,15 @@ import { page } from '$app/stores'; import { clearAllParameters } from '../Utility/parameters'; import { nbsp } from '../Utility/html'; - import { estimatedDayReading } from '$lib/Media/Manga/time'; - import ActivityHistoryGrid from './ActivityHistory/Grid.svelte'; import SettingHint from '$lib/Settings/SettingHint.svelte'; import { database } from '$lib/Database/activities'; - import MediaTitleDisplay from '$lib/List/MediaTitleDisplay.svelte'; - import proxy from '$lib/Utility/proxy'; + import Activity from './Wrapped/Top/Activity.svelte'; + import Anime from './Wrapped/Top/Anime.svelte'; + import Manga from './Wrapped/Top/Manga.svelte'; + import ActivityHistory from './Wrapped/ActivityHistory.svelte'; + import MediaExtras from './Wrapped/MediaExtras.svelte'; + import MediaPanel from './Wrapped/Media.svelte'; + import Watermark from './Wrapped/Watermark.svelte'; export let user: AniListAuthorisation; @@ -497,278 +500,53 @@ class:transparent={transparency} > {#if !disableActivityHistory && activityHistoryPosition === 'TOP' && activities.length > 0 && selectedYear === currentYear} -
-
-
- -
-
-
+ {/if}
-
- - User Avatar - -
- -
- Status Posts: {wrapped.activities.statusCount} -
-
- Messages: {wrapped.activities.messageCount} -
-
- Days Active: {#if selectedYear !== currentYear} - ?/365 - {:else} - {activities.length}/{useFullActivityHistory ? 365 : 189} - {/if} -
-
-
-
-
- Anime -
-
- Time Watched: {((minutesWatched || 0) / 60 / 24).toFixed(2)} days -
-
- Completed: {animeList?.length || 0} -
-
Episodes: {episodes}
-
-
-
- Manga -
-
- Time Read: {estimatedDayReading(chapters).toFixed(2)} days -
-
- Completed: {mangaList?.length || 0} -
-
- Chapters: {chapters} -
-
+ + +
{#if !disableActivityHistory && activityHistoryPosition === 'BELOW_TOP' && activities.length > 0 && selectedYear === currentYear} -
-
-
- -
-
-
- {/if} - {#if animeList !== undefined || mangaList !== undefined} -
-
-
- - Highest Rated Anime Cover - -
- {animeMostTitle} Anime -
    - {#if animeList !== undefined && animeList.length !== 0} - {#each animeList?.slice(0, highestRatedCount) as anime} -
  1. - - - {highestRatedMediaPercentage && - anime.mediaListEntry && - anime.mediaListEntry?.score > 0 - ? `: ${anime.mediaListEntry?.score}%` - : ''} -
  2. - {/each} - {:else} -
  3. -

    (⌣_⌣”)

    -
  4. - {/if} -
-
-
-
-
-
- - Highest Rated Manga Cover - -
- {mangaMostTitle} Manga -
    - {#if mangaList !== undefined && mangaList.length !== 0} - {#each mangaList?.slice(0, highestRatedCount) as manga} -
  1. - - - {highestRatedMediaPercentage && - manga.mediaListEntry && - manga.mediaListEntry?.score > 0 - ? `: ${manga.mediaListEntry?.score}%` - : ''} -
  2. - {/each} - {:else} -
  3. -

    (⌣_⌣”)

    -
  4. - {/if} -
-
-
-
-
+ {/if} + {#if topMedia && topGenresTags && ((topMedia.topGenreMedia && topMedia.genres.length > 0) || (topMedia.topTagMedia && topMedia.tags.length > 0))} -
- {#if topMedia.topGenreMedia && topMedia.genres.length > 0} -
-
- - Highest Rated Genre Cover - -
- {genreTagTitle} Genres -
    - {#each topMedia.genres as genre} -
  1. - - {genre.genre}{highestRatedGenreTagPercentage - ? `: ${genre.averageScore}%` - : ''} - -
  2. - {/each} -
-
-
-
- {/if} - {#if topMedia.topTagMedia && topMedia.tags.length > 0} -
-
- - Highest Rated Tag Cover - -
- {genreTagTitle} Tags -
    - {#each topMedia.tags as tag} -
  1. - - {tag.tag}{highestRatedGenreTagPercentage - ? `: ${tag.averageScore}%` - : ''} - -
  2. - {/each} -
-
-
-
- {/if} -
+ {/if} {#if !disableActivityHistory && activityHistoryPosition === 'ORIGINAL' && activities.length > 0 && selectedYear === currentYear} -
-
-
- -
-
-
+ {/if} {#if watermark} -
- -
+ {/if}

- Generate image + + Generate image +

@@ -905,104 +683,5 @@ {/if} -- cgit v1.2.3