File tree Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <v-card class =" player-view" >
2
+ <v-card
3
+ dark
4
+ class =" player-view"
5
+ :class =" [isMyTurn ? 'active' : '', 'player' + index]"
6
+ >
3
7
<v-container fluid >
4
8
<v-layout align-center justify-center column >
5
9
<v-layout
@@ -59,6 +63,15 @@ export default {
59
63
}
60
64
},
61
65
computed: {
66
+ index () {
67
+ return this .playerData .player .index ;
68
+ },
69
+ isMyTurn () {
70
+ return (
71
+ this .playerData .player .index ==
72
+ this .playerData .player .map .currentPlayerIndex
73
+ );
74
+ },
62
75
... mapState (" lobby" , {
63
76
userPicture (state ) {
64
77
let user = state .onlineUsers [this .name ];
@@ -84,4 +97,25 @@ export default {
84
97
.player-view {
85
98
width : 100% ;
86
99
}
100
+
101
+ .player0 {
102
+ background-color : blue ;
103
+ }
104
+
105
+ .player1 {
106
+ background-color : red ;
107
+ }
108
+
109
+ .active {
110
+ animation : glow 1s infinite alternate ;
111
+ }
112
+
113
+ @keyframes glow {
114
+ from {
115
+ box-shadow : 0 0 10px -10px #aef4af ;
116
+ }
117
+ to {
118
+ box-shadow : 0 0 10px 10px #aef4af ;
119
+ }
120
+ }
87
121
</style >
You can’t perform that action at this time.
0 commit comments