-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
66 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,66 @@ | ||
<script lang="ts"> | ||
import Carousel from "$lib/components/Carousel.svelte"; | ||
import Hero from "./Hero.svelte"; | ||
export let data; | ||
import { smoothload } from '$lib/actions.js'; | ||
import { media } from '$lib/api'; | ||
import Carousel from '$lib/components/Carousel.svelte'; | ||
console.log(data); | ||
export let data; | ||
$: images = data.featured.images; | ||
$: backdrop = images.backdrops.find((image) => !image.iso_639_1) || images.backdrops[0]; | ||
$: logo = images.logos.find((image) => image.iso_639_1 === 'en'); | ||
</script> | ||
|
||
<h1 class="column">Top trending wines</h1> | ||
<svelte:head> | ||
<title>SvelteFlix</title> | ||
</svelte:head> | ||
|
||
<div class="column"> | ||
<h1>Today's top movies</h1> | ||
|
||
<a href="/movies/{data.featured.id}"> | ||
<img | ||
class="backdrop" | ||
alt={data.featured.title} | ||
src={media(backdrop.file_path, 1280)} | ||
style="aspect-ratio: {backdrop.aspect_ratio}" | ||
use:smoothload | ||
/> | ||
|
||
{#if logo} | ||
<img | ||
class="logo" | ||
alt={data.featured.title} | ||
src={media(logo.file_path, 500)} | ||
style="aspect-ratio: {logo.aspect_ratio}" | ||
use:smoothload | ||
/> | ||
{/if} | ||
</a> | ||
</div> | ||
|
||
<Carousel title="Trending" href="/movies/trending" movies={data.trending} /> | ||
<Carousel title="Now playing" href="/movies/now_playing" movies={data.now_playing} /> | ||
<Carousel title="Upcoming" href="/movies/upcoming" movies={data.upcoming} /> | ||
|
||
<style> | ||
a { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
} | ||
<Hero movie={data.featured} /> | ||
.backdrop { | ||
width: 100%; | ||
} | ||
<Carousel movies={data.trending.results} /> | ||
<Carousel movies={data.now_playing.results} /> | ||
<Carousel movies={data.upcoming.results} /> | ||
.logo { | ||
position: absolute; | ||
width: 30%; | ||
height: 100%; | ||
left: 1rem; | ||
bottom: 0; | ||
object-fit: contain; | ||
object-position: 50% 75%; | ||
filter: drop-shadow(0 0 3rem black) drop-shadow(0 0 0.5rem black); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters