|
1 | 1 | <template> |
2 | | - <div class="match-status"> |
3 | | - <div> |
| 2 | + <div class="match-status full-width"> |
| 3 | + <div class="full-width"> |
| 4 | + <div class="full-width" :class="{'highlight-command': true, 'stop-command': isStop, 'halt-command': isHalt}"> |
4 | 5 | <div class="stage">{{stage}}</div> |
5 | 6 |
|
6 | 7 | <span class="score"> |
|
9 | 10 |
|
10 | 11 | <div class="command" :class="{'team-yellow': commandForYellow, 'team-blue': commandForBlue}"> |
11 | 12 | {{gameState}} |
12 | | - <span v-if="isBallPlacement"> |
| 13 | + <span v-if="isBallPlacement && remainingTime >= 0"> |
13 | 14 | (<span v-format-us-duration="remainingTime"></span>) |
14 | 15 | </span> |
| 16 | + <span v-if="isTimeout"> |
| 17 | + (<span v-format-us-duration="timeoutTime"></span>) |
| 18 | + </span> |
| 19 | + </div> |
15 | 20 | </div> |
16 | 21 |
|
17 | 22 | <hr class="separator"/> |
|
38 | 43 | refereeMessage() { |
39 | 44 | return this.$store.state.refereeMsg; |
40 | 45 | }, |
| 46 | + isHalt() { |
| 47 | + return this.refereeMessage.command === Referee.Command.HALT; |
| 48 | + }, |
| 49 | + isStop() { |
| 50 | + return this.refereeMessage.command === Referee.Command.STOP; |
| 51 | + }, |
41 | 52 | stage() { |
42 | 53 | return mapStageToText(this.refereeMessage.stage); |
43 | 54 | }, |
|
51 | 62 | remainingTime() { |
52 | 63 | return this.refereeMessage.currentActionTimeRemaining; |
53 | 64 | }, |
| 65 | + isTimeout() { |
| 66 | + return this.refereeMessage.command === Referee.Command.TIMEOUT_BLUE || |
| 67 | + this.refereeMessage.command === Referee.Command.TIMEOUT_YELLOW; |
| 68 | + }, |
| 69 | + timeoutTime() { |
| 70 | + if (this.refereeMessage.command === Referee.Command.TIMEOUT_BLUE) { |
| 71 | + return this.refereeMessage.blue.timeoutTime; |
| 72 | + } else if (this.refereeMessage.command === Referee.Command.TIMEOUT_YELLOW) { |
| 73 | + return this.refereeMessage.yellow.timeoutTime; |
| 74 | + } |
| 75 | + return 0; |
| 76 | + }, |
54 | 77 | commandForBlue() { |
55 | 78 | switch (this.refereeMessage.command) { |
56 | 79 | case Referee.Command.PREPARE_KICKOFF_BLUE: |
|
91 | 114 | align-items: center; |
92 | 115 | } |
93 | 116 |
|
| 117 | + .full-width { |
| 118 | + width: 100%; |
| 119 | + } |
| 120 | +
|
94 | 121 | .time-container { |
95 | 122 | border-style: dashed; |
96 | 123 | display: inline-block; |
|
124 | 151 | margin-top: 3vmin; |
125 | 152 | } |
126 | 153 |
|
| 154 | + .highlight-command { |
| 155 | + transition: background-color 1000ms ease; |
| 156 | + border-radius: 1em; |
| 157 | + padding: 0.1em; |
| 158 | + margin-top: 0.1em; |
| 159 | + } |
| 160 | +
|
| 161 | + .highlight-command.stop-command { |
| 162 | + background-color: #E23D28; |
| 163 | + } |
| 164 | +
|
| 165 | + .highlight-command.halt-command { |
| 166 | + background-color: #A50021; |
| 167 | + } |
| 168 | +
|
127 | 169 | </style> |
0 commit comments