aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Media/Cover/HoverCover.svelte
blob: 92c0e6fd5245ebfada33fdcdf2fe0c0e3c1db189 (plain) (blame)
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 { HoverCoverResponse } from './hoverCover';

	export let options: HoverCoverResponse;
	export let width = 250;
</script>

{#if options.hovering}
	<img
		class="hover-image show card card-small"
		src={options.media
			? options.media.coverImage.extraLarge
			: `https://subsplease.org${options.item?.image_url}`}
		alt="Media Cover"
		style={`width: ${width}px; ${options.style}`}
	/>
{/if}

<style>
	.hover-image {
		position: fixed;
		z-index: 1000;
		height: auto;
		display: none;
		border-radius: 8px;
	}

	.show {
		display: block;
	}
</style>