Files
front/components/CardsGrouped.vue
T
legonzaur 376484c3b2
release-tag / release-image (push) Successful in 28s
Add a darkened card when stack is empty
Closes #11
2024-05-13 17:12:34 +02:00

49 lines
1.0 KiB
Vue

<script setup lang="ts">
import type { Card } from '~/netcode/Card';
export interface Props {
stack: (Card | null)[]
}
const props = withDefaults(defineProps<Props>(), {
stack: () => [],
})
</script>
<template>
<div>
<div class="cards_container">
<template v-if="props.stack.length > 0" v-for="c in props.stack">
<CardPreview :card_id="c?.card_id" :wrapped="true">
<slot></slot>
</CardPreview>
</template>
<template v-if="props.stack.length == 0">
<img :class="`card_image empty`" :src="'/cards/background.png'" draggable="false">
</template>
</div>
</div>
</template>
<style scoped>
.cards_container::before {
width: calc(185px - 10px);
display: block;
content: "";
height: 0;
}
.cards_container {
display: flex;
flex-direction: row-reverse;
justify-content: center;
}
.card_image.empty {
filter: brightness(0.5);
max-height: 250px;
}
</style>