aboutsummaryrefslogtreecommitdiff
path: root/src/components/card_thumb.svelte
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-02-21 23:04:36 +0800
committerMistivia <i@mistivia.com>2025-02-21 23:04:36 +0800
commita13b2290833f635453622ed330cc3895950ffcdb (patch)
tree2501d940e76585e4ca448f7f07529ea8ddb56663 /src/components/card_thumb.svelte
parent2ebdfe109bbff27b35a5e9ae208dabddd266191e (diff)
add banlist
Diffstat (limited to 'src/components/card_thumb.svelte')
-rw-r--r--src/components/card_thumb.svelte77
1 files changed, 64 insertions, 13 deletions
diff --git a/src/components/card_thumb.svelte b/src/components/card_thumb.svelte
index 8e701ea..e68a37e 100644
--- a/src/components/card_thumb.svelte
+++ b/src/components/card_thumb.svelte
@@ -1,9 +1,8 @@
<script lang="js">
-
import { setLeftPanelCard } from '../left_panel';
import { cardImageUrl } from '../utils';
- let {id, area, idx} = $props();
+ let {id, area, idx, limitNum} = $props();
function onhover() {
setLeftPanelCard(id);
@@ -12,22 +11,74 @@
function onDragStart(e) {
e.dataTransfer.setData('text', JSON.stringify({id, area, idx}))
}
-
</script>
{#if id}
- <img
- style="margin:2px;"
- draggable="true"
- onmouseover={onhover}
- onfocus={onhover}
- ondragstart={onDragStart}
- height="100%"
- src={cardImageUrl(id)}
- alt="yugioh card {id}"
- />
+ <img
+ style="margin:2px;"
+ draggable="true"
+ onmouseover={onhover}
+ onfocus={onhover}
+ ondragstart={onDragStart}
+ height="100%"
+ src={cardImageUrl(id)}
+ alt="yugioh card {id}"
+ />
+ {#if limitNum === 1 || limitNum == 2}
+ <div class="overlay">{limitNum}</div>
+ {:else if limitNum === 0}
+ <div class="ban-overlay"></div>
+ {/if}
{/if}
<style>
+ .overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ border: 3px solid red;
+ border-radius: 50%;
+ background-color: black;
+ width: 20px;
+ height: 20px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-weight: bold;
+ color: yellow;
+ font-size: 15px;
+ font-family: Arial, sans-serif;
+ box-sizing: border-box;
+ pointer-events: none;
+ }
+
+ .ban-overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ border: 3px solid red;
+ border-radius: 50%;
+ background-color: black;
+ width: 20px;
+ height: 20px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-weight: bold;
+ color: yellow;
+ font-size: 15px;
+ font-family: Arial, sans-serif;
+ box-sizing: border-box;
+ pointer-events: none;
+ }
+ .ban-overlay::after {
+ content: '';
+ width: 15px;
+ height: 3px;
+ background-color: red;
+ transform: rotate(45deg);
+ position: absolute;
+ pointer-events: none;
+ }
</style>