Skip to content

Commit 1c50b9f

Browse files
committed
Add animations for cards entering and leaving
1 parent 98df07b commit 1c50b9f

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

src/assets/style.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,3 +308,19 @@ th {
308308
background-color: #E68080;
309309
border-radius: 10px;
310310
}
311+
312+
313+
.list-complete-item {
314+
transition: all 1s;
315+
display: inline-block;
316+
margin-right: 10px;
317+
}
318+
319+
.list-complete-enter, .list-complete-leave-to {
320+
opacity: 0;
321+
transform: translateY(30px);
322+
}
323+
324+
.list-complete-leave-active {
325+
position: absolute;
326+
}

src/components/GameBoard.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222

2323
<!-- Player cards -->
2424
<div v-for="(zoneInfo, zoneName) in info.zones" class="zone" :class="'zone-' + zoneName" :key="zoneName">
25-
<div v-if="zoneInfo.known">
25+
<transition-group v-if="zoneInfo.known" name="list-complete" tag="div">
2626
<!--<h3>{{zoneName}}</h3>-->
27-
<CardModel :card="card" :targets="targets" :doingAction="doingAction"
27+
<CardModel class="list-complete-item" :card="card" :targets="targets" :doingAction="doingAction"
2828
:selectEntity="selectEntity" :actions="actions" :startAction="startAction"
2929
v-for="(card, id) in zoneInfo.entities" :key="id" v-if="card.properties">
3030
</CardModel>
31-
</div>
31+
</transition-group>
3232

3333
<!-- For opponent's cards. Is there a better way? -->
3434
<div v-show="!zoneInfo.known && zoneName==='Hand'">

0 commit comments

Comments
 (0)