Files
gold_land_user/src/pages/GamesPage.vue
T

44 lines
1.1 KiB
Vue
Raw Normal View History

2026-08-01 10:52:38 +02:00
<script setup lang="ts">
import { useRouter } from 'vue-router'
import AppHeader from '@/components/common/AppHeader.vue'
import GameCard from '@/components/common/GameCard.vue'
import { GAMES } from '@/data/mockData'
import { useToast } from '@/composables/useToast'
const router = useRouter()
const toast = useToast()
function startGame(game: (typeof GAMES)[0]) {
game.route ? router.push(game.route) : toast.show('به زودی!', 'info')
}
</script>
<template>
<div class="page-content page-content--no-nav">
<AppHeader title="بازی‌ها" show-back @back="router.back()" />
<div class="games-list">
<GameCard
v-for="(game, i) in GAMES"
:key="game.id"
:id="game.id"
:title="game.title"
:description="game.description"
:icon="game.icon"
:color="game.color"
class="card-enter"
:style="{ animationDelay: `${i * 0.05}s` }"
@start="startGame(game)"
/>
</div>
</div>
</template>
<style scoped>
.games-list {
display: flex;
flex-direction: column;
gap: 12px;
}
</style>