From 48b0892454f981b5b3e964b85e30daa087c44814 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Thu, 28 Dec 2023 20:04:27 -0800
Subject: refactor(schedule): move hover cover to component

---
 src/lib/Media/HoverCover.svelte | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 src/lib/Media/HoverCover.svelte

(limited to 'src/lib/Media/HoverCover.svelte')

diff --git a/src/lib/Media/HoverCover.svelte b/src/lib/Media/HoverCover.svelte
new file mode 100644
index 00000000..a3aea9d6
--- /dev/null
+++ b/src/lib/Media/HoverCover.svelte
@@ -0,0 +1,33 @@
+<script lang="ts">
+	import type { Media } from '$lib/AniList/media';
+	import type { SubsPleaseEpisode } from './Anime/Airing/Subtitled/subsPlease';
+
+	export let hoveredItem: SubsPleaseEpisode | null = null;
+	export let hoveredMedia: Media | null = null;
+	export let imageStyle = '';
+</script>
+
+{#if hoveredItem}
+	<img
+		class="hover-image show"
+		src={hoveredMedia
+			? hoveredMedia.coverImage.extraLarge
+			: `https://subsplease.org${hoveredItem.image_url}`}
+		alt="Media Cover"
+		style={imageStyle}
+	/>
+{/if}
+
+<style>
+	.hover-image {
+		position: fixed;
+		z-index: 1000;
+		width: 300px;
+		height: auto;
+		display: none;
+	}
+
+	.show {
+		display: block;
+	}
+</style>
-- 
cgit v1.2.3

