+
@@ -185,7 +196,7 @@
width: 100vw;
height: 100vh;
transform: translate(-50%, -50%) scale(1.6);
- transition: transform 0.5s ease-in-out, opacity 1s ease-in-out;
+ transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
z-index: 0;
}
diff --git a/src/lib/pages/TitlePages/HeroTitleInfo.svelte b/src/lib/pages/TitlePages/HeroTitleInfo.svelte
index 15f0c4e..1f4f24f 100644
--- a/src/lib/pages/TitlePages/HeroTitleInfo.svelte
+++ b/src/lib/pages/TitlePages/HeroTitleInfo.svelte
@@ -1,12 +1,10 @@
@@ -26,18 +24,28 @@
- {#each properties.filter((p) => !!p.label) as property, i}
+ {#each properties.filter((p) => !!p.label || !!p.icon) as property, i}
{#if i !== 0}
{/if}
{#if property.href}
- {property.label}
+
+ {#if property.label}
+ {property.label}
+ {:else if property.icon}
+
+ {/if}
+
- {:else}
+ {:else if property.label}
{property.label}
+ {:else if property.icon}
+
+
+
{/if}
{/each}
diff --git a/src/lib/pages/TitlePages/HeroTitleInfo.ts b/src/lib/pages/TitlePages/HeroTitleInfo.ts
new file mode 100644
index 0000000..465066f
--- /dev/null
+++ b/src/lib/pages/TitlePages/HeroTitleInfo.ts
@@ -0,0 +1,7 @@
+import type { ComponentType } from 'svelte';
+
+export type TitleInfoProperty = {
+ href?: string;
+ label?: string;
+ icon?: ComponentType;
+};
diff --git a/src/lib/pages/TitlePages/MoviePage/MoviePage.svelte b/src/lib/pages/TitlePages/MoviePage/MoviePage.svelte
index 2762877..e43da01 100644
--- a/src/lib/pages/TitlePages/MoviePage/MoviePage.svelte
+++ b/src/lib/pages/TitlePages/MoviePage/MoviePage.svelte
@@ -12,9 +12,11 @@
import { tmdbMovieDataStore } from '$lib/stores/data.store';
import { useMovieUserData } from '$lib/stores/media-user-data.store';
import { formatMinutesToTime, formatThousands } from '$lib/utils';
- import { Bookmark, Check, ExternalLink, Minus, Play } from 'radix-icons-svelte';
+ import { Bookmark, Check, ExternalLink, Minus, Play, Video } from 'radix-icons-svelte';
import { onDestroy } from 'svelte';
import HeroTitleInfo from '../HeroTitleInfo.svelte';
+ import { localSettings } from '$lib/stores/localstorage.store';
+ import type { TitleInfoProperty } from '../HeroTitleInfo';
export let id: string;
const tmdbId = Number(id);
@@ -54,8 +56,12 @@
);
});
- let titleProperties: { href?: string; label: string }[] = [];
+ let titleProperties: TitleInfoProperty[] = [];
$tmdbMovie.then((movie) => {
+ const trailer = movie?.videos?.results?.find(
+ (video) => video.type === 'Trailer' && video.site === 'YouTube'
+ )?.key;
+
if (movie?.runtime) {
titleProperties.push({
label: formatMinutesToTime(movie.runtime)
@@ -74,6 +80,13 @@
label: movie.genres.map((g) => g.name).join(', ')
});
}
+
+ if ($localSettings.enableTrailers && trailer) {
+ titleProperties.push({
+ icon: Video,
+ href: `https://www.youtube.com/watch?v=${trailer}`
+ });
+ }
});
onDestroy(() => {
diff --git a/src/lib/pages/TitlePages/SeriesPage/SeriesPage.svelte b/src/lib/pages/TitlePages/SeriesPage/SeriesPage.svelte
index 8c5e913..c7da4ed 100644
--- a/src/lib/pages/TitlePages/SeriesPage/SeriesPage.svelte
+++ b/src/lib/pages/TitlePages/SeriesPage/SeriesPage.svelte
@@ -12,10 +12,12 @@
import { scrollIntoView, useRegistrar } from '$lib/selectable';
import { useSeriesUserData } from '$lib/stores/media-user-data.store';
import { formatThousands } from '$lib/utils';
- import { Bookmark, Check, ExternalLink, Minus, Play } from 'radix-icons-svelte';
+ import { Bookmark, Check, ExternalLink, Minus, Play, Video } from 'radix-icons-svelte';
import { onDestroy } from 'svelte';
import TitleProperties from '../HeroTitleInfo.svelte';
import EpisodeGrid from './EpisodeGrid.svelte';
+ import { localSettings } from '$lib/stores/localstorage.store';
+ import type { TitleInfoProperty } from '../HeroTitleInfo';
export let id: string;
const tmdbId = Number(id);
@@ -56,8 +58,12 @@
);
});
- let titleProperties: { href?: string; label: string }[] = [];
+ let titleProperties: TitleInfoProperty[] = [];
$tmdbSeries.then((series) => {
+ const trailer = series?.videos?.results?.find(
+ (video) => video.type === 'Trailer' && video.site === 'YouTube'
+ )?.key;
+
if (series && series.status !== 'Ended') {
titleProperties.push({
label: `Since ${new Date(series.first_air_date || Date.now())?.getFullYear()}`
@@ -82,6 +88,13 @@
label: series.genres.map((g) => g.name).join(', ')
});
}
+
+ if ($localSettings.enableTrailers && trailer) {
+ titleProperties.push({
+ icon: Video,
+ href: `https://www.youtube.com/watch?v=${trailer}`
+ });
+ }
});
onDestroy(() => {