summaryrefslogtreecommitdiff
path: root/src/components/jet/item/ProductMedia/ProductMediaMacItem.svelte
blob: 516ed3247d46743eaff22122e904de8064141066 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<script lang="ts">
    import type { ProductMediaItem } from '@jet-app/app-store/api/models';
    import Artwork from '~/components/Artwork.svelte';
    import Video from '~/components/jet/Video.svelte';

    export let item: ProductMediaItem;
</script>

{#if item.screenshot}
    <article>
        <Artwork artwork={item.screenshot} profile="screenshot-mac" />
    </article>
{:else if item.video}
    <article>
        <Video autoplay video={item.video} profile="screenshot-mac" />
    </article>
{/if}

<style>
    article {
        overflow: hidden;
    }

    article :global(.video) {
        aspect-ratio: 16/10;
    }

    article :global(video) {
        object-fit: cover;
    }
</style>