From cedc294b232e2f902fb73a867788e4b5e48beebd Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sat, 16 Dec 2023 00:19:52 -0800 Subject: feat(anime): right align countdown option --- src/lib/Media/anime.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/lib/Media/anime.ts') diff --git a/src/lib/Media/anime.ts b/src/lib/Media/anime.ts index 001a7798..380b20d6 100644 --- a/src/lib/Media/anime.ts +++ b/src/lib/Media/anime.ts @@ -70,17 +70,20 @@ export const airingTime = (anime: Media, upcoming = false) => { } const opacity = Math.max(50, 100 - (untilAiring / 60 / 60 / 24 / 7) * 50); + const alignment = get(settings).displayCountdownRightAligned ? 'float: right;' : ''; if (upcoming) return `${anime.nextAiringEpisode?.episode}${totalEpisodes( - anime - )} in ${timeFrame} ${few ? `(${time})` : ''}`; + }" style="opacity: ${opacity}%; ${alignment}">${ + anime.nextAiringEpisode?.episode + }${totalEpisodes(anime)} in ${timeFrame} ${ + few ? `(${time})` : '' + }`; else return `${anime.nextAiringEpisode?.episode} in ${ + }" style="opacity: ${opacity}%; ${alignment}">${anime.nextAiringEpisode?.episode} in ${ few ? '' : '' }${timeFrame}${few ? '' : ''} ${few ? `(${time})` : ''}`; } -- cgit v1.2.3