| 
														
															@@ -6,6 +6,7 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															           :card="el" 
														 | 
														
														 | 
														
															           :card="el" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															           :index="i" 
														 | 
														
														 | 
														
															           :index="i" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															           :isCaptain="isCaptain" 
														 | 
														
														 | 
														
															           :isCaptain="isCaptain" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+          :winner="winner" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															           @statusChange="onStatusChange"></Card> 
														 | 
														
														 | 
														
															           @statusChange="onStatusChange"></Card> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       </div> 
														 | 
														
														 | 
														
															       </div> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     </div> 
														 | 
														
														 | 
														
															     </div> 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -24,10 +25,24 @@ export default { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   data() { 
														 | 
														
														 | 
														
															   data() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     return { 
														 | 
														
														 | 
														
															     return { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       list: [], 
														 | 
														
														 | 
														
															       list: [], 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      winnerList: [], 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       isCaptain: false, 
														 | 
														
														 | 
														
															       isCaptain: false, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       code: '', 
														 | 
														
														 | 
														
															       code: '', 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       ws: null, 
														 | 
														
														 | 
														
															       ws: null, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-      height: '20vh' 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      height: '20vh', 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      winner: '' 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+  }, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+  watch: { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    winner(val) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      if (val) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if (val === 'unknow') { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+          alert('game over!') 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+          alert(`${val} is winner!`) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        this.ws.send(JSON.stringify({ code: this.code, status: 'over' })) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   }, 
														 | 
														
														 | 
														
															   }, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   created() { 
														 | 
														
														 | 
														
															   created() { 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -65,6 +80,9 @@ export default { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     onStatusChange(cardIndex, status) { 
														 | 
														
														 | 
														
															     onStatusChange(cardIndex, status) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       this.list[cardIndex].status = status 
														 | 
														
														 | 
														
															       this.list[cardIndex].status = status 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       this.ws.send(JSON.stringify({ code: this.code, status: 'update' })) 
														 | 
														
														 | 
														
															       this.ws.send(JSON.stringify({ code: this.code, status: 'update' })) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      setTimeout(() => { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        this.isOverHandle() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      }, 500) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     }, 
														 | 
														
														 | 
														
															     }, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     createWebsocket() { 
														 | 
														
														 | 
														
															     createWebsocket() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       const ws = new WebSocket(process.env.VUE_APP_WS_URL) 
														 | 
														
														 | 
														
															       const ws = new WebSocket(process.env.VUE_APP_WS_URL) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -87,6 +105,33 @@ export default { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       ws.onclose = () => { 
														 | 
														
														 | 
														
															       ws.onclose = () => { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         console.log('connection closed') 
														 | 
														
														 | 
														
															         console.log('connection closed') 
														 | 
													
												
											
												
													
														| 
														 | 
														
															       } 
														 | 
														
														 | 
														
															       } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    }, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    isOverHandle() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      if (this.isCaptain) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        return 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      let blue = 0 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      let red = 0 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      let black = 0 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      this.list.forEach(el => { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        const { status, group } = el 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if (status !== 0) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+          if (group === 1) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            blue += 1 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+          } else if (group === 2) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            red += 1 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+          } else if (group === 3) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            black = 1 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+          } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      }) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      if (blue === 9) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        this.winner = 'blue' 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      } else if (red === 8) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        this.winner = 'red' 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      } else if (black === 1) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        this.winner = 'unknow' 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+      } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   } 
														 | 
														
														 | 
														
															   } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 } 
														 | 
														
														 | 
														
															 } 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -99,13 +144,13 @@ export default { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   .prevserve { 
														 | 
														
														 | 
														
															   .prevserve { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     height: 100%; 
														 | 
														
														 | 
														
															     height: 100%; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     transform-style: preserve-3d; 
														 | 
														
														 | 
														
															     transform-style: preserve-3d; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    perspective: 1000px; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    perspective-origin: 30% 30%; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    /* display: grid; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    perspective: 2000px; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    perspective-origin: 30% 50%; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    display: grid; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     grid-template-columns: repeat(5, 20%); 
														 | 
														
														 | 
														
															     grid-template-columns: repeat(5, 20%); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    grid-template-rows: repeat(5, 20%); */ 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    display: flex; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    flex-wrap: wrap; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    grid-template-rows: repeat(5, 20%); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    /* display: flex; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    flex-wrap: wrap; */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   } 
														 | 
														
														 | 
														
															   } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															   .item { 
														 | 
														
														 | 
														
															   .item { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     width: 20vw; 
														 | 
														
														 | 
														
															     width: 20vw; 
														 |