dupont release
All checks were successful
Deploy App / build (push) Successful in 2m1s
Deploy App / deploy (push) Successful in 20s

This commit is contained in:
valere
2026-02-13 17:20:00 +01:00
parent 399519d1d4
commit 543b513e08
8 changed files with 130 additions and 45 deletions

View File

@@ -1,15 +1,14 @@
<template>
<section class="deck">
<div v-for="(card, index) in cards" :key="index">
<PlayingCard :card="card" :isFaceUp="isFaceUp[index] || false" />
</div>
<PlayingCard v-for="(card, index) in cards" :key="index" :card="card" :isFaceUp="isFaceUp[index] || false"
@click="isFaceUp[index] = true" />
</section>
</template>
<script setup lang="ts">
import type { Card } from '~~/types/types'
const nbCards = 1 // Nombre de cartes à afficher
const nbCards = Math.floor(Math.random() * 14) + 1 // Nombre de cartes à afficher (aléatoire entre 1 et 15)
const cards = ref<Card[]>([])
const isFaceUp = ref<boolean[]>([])
@@ -31,7 +30,7 @@ const loadCards = async () => {
const flipCards = () => {
isFaceUp.value.forEach((_, index) => {
setTimeout(() => {
isFaceUp.value[index] = true
isFaceUp.value[index] = false
}, 400 * (index + 1))
})
}
@@ -50,9 +49,14 @@ useHead({
<style lang="scss" scoped>
.deck {
@apply screen-centered h-screen;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 1fr 1fr 1fr;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
min-height: 100vh;
.playing-card {
margin: 1rem;
}
}
</style>