diff options
| author | Mistivia <i@mistivia.com> | 2025-02-05 14:03:38 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-02-05 14:03:38 +0800 |
| commit | f4d9dd9e349b377431fbc9a3b2a086c29cd6826e (patch) | |
| tree | fa2850216f252ffb54ab0068e2f75563cc808038 /src/components/CardThumb.svelte | |
| parent | 781917675a1f7a81d61dca8e5134fb4867750685 (diff) | |
impl left panel and card thumbnail
Diffstat (limited to 'src/components/CardThumb.svelte')
| -rw-r--r-- | src/components/CardThumb.svelte | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/components/CardThumb.svelte b/src/components/CardThumb.svelte index 6dcefd2..f733b32 100644 --- a/src/components/CardThumb.svelte +++ b/src/components/CardThumb.svelte @@ -1,12 +1,24 @@ <script lang="ts"> - let {id} = $props() + +import {setLeftPanelCard} from '../control/left_panel.svelte.js'; + +let {id} = $props(); + +function onhover() { + setLeftPanelCard(id); +} + </script> -<div class="card-thumbnail"> - {#if id} - <img height="100%" src="https://cdn.233.momobako.com/ygopro/pics/{id}.jpg!half" alt="yugioh card {id}"> - {/if} -</div> +{#if id} + <img + onmouseover={onhover} + onfocus={onhover} + height="100%" + src="https://cdn.233.momobako.com/ygopro/pics/{id}.jpg!half" + alt="yugioh card {id}" + /> +{/if} <style> |
