summaryrefslogtreecommitdiff
path: root/web/src/lib/ui/cards/AbilityCardBack.svelte
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/lib/ui/cards/AbilityCardBack.svelte')
-rw-r--r--web/src/lib/ui/cards/AbilityCardBack.svelte60
1 files changed, 60 insertions, 0 deletions
diff --git a/web/src/lib/ui/cards/AbilityCardBack.svelte b/web/src/lib/ui/cards/AbilityCardBack.svelte
new file mode 100644
index 0000000..362ced1
--- /dev/null
+++ b/web/src/lib/ui/cards/AbilityCardBack.svelte
@@ -0,0 +1,60 @@
+<!--
+ The back of a monster ability card (the reference
+ `MonsterAbilityCardRear`): the card artwork with the draw-pile size in
+ the bottom-right corner (hidden when `size` is negative).
+-->
+<script lang="ts">
+ let {
+ fh = true,
+ size = -1,
+ scale = 1
+ }: {
+ fh?: boolean;
+ /** The draw-pile count shown bottom-right; negative hides it. */
+ size?: number;
+ scale?: number;
+ } = $props();
+
+ const width = 142.4 * scale;
+ const height = 94.4 * scale;
+</script>
+
+<div
+ class="acback"
+ style="width: {width}px; height: {height}px"
+>
+ <img
+ class="acback__bg"
+ src={fh ? '/images/psd/MonsterAbility-back_fh.png' : '/images/psd/MonsterAbility-back.png'}
+ alt=""
+ draggable="false"
+ />
+ {#if size >= 0}
+ <div class="acback__size" style="font-size: {12.8 * scale}px">{size}</div>
+ {/if}
+</div>
+
+<style>
+ .acback {
+ position: relative;
+ border-radius: 4px;
+ flex-shrink: 0;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
+ }
+ .acback__bg {
+ position: absolute;
+ inset: 0;
+ width: 100%;
+ height: 100%;
+ border-radius: 4px;
+ object-fit: fill;
+ }
+ .acback__size {
+ position: absolute;
+ right: 4.8px;
+ bottom: 0;
+ font-family: system-ui, sans-serif;
+ color: #fff;
+ text-shadow: 0.8px 0.8px 1px #000;
+ }
+</style>