Skip to content

Commit aad544d

Browse files
committed
Add command highlighter box
1 parent e7fb773 commit aad544d

File tree

2 files changed

+46
-4
lines changed

2 files changed

+46
-4
lines changed

src/components/MatchStatus.vue

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<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}">
45
<div class="stage">{{stage}}</div>
56

67
<span class="score">
@@ -9,9 +10,13 @@
910

1011
<div class="command" :class="{'team-yellow': commandForYellow, 'team-blue': commandForBlue}">
1112
{{gameState}}
12-
<span v-if="isBallPlacement">
13+
<span v-if="isBallPlacement && remainingTime >= 0">
1314
(<span v-format-us-duration="remainingTime"></span>)
1415
</span>
16+
<span v-if="isTimeout">
17+
(<span v-format-us-duration="timeoutTime"></span>)
18+
</span>
19+
</div>
1520
</div>
1621

1722
<hr class="separator"/>
@@ -38,6 +43,12 @@
3843
refereeMessage() {
3944
return this.$store.state.refereeMsg;
4045
},
46+
isHalt() {
47+
return this.refereeMessage.command === Referee.Command.HALT;
48+
},
49+
isStop() {
50+
return this.refereeMessage.command === Referee.Command.STOP;
51+
},
4152
stage() {
4253
return mapStageToText(this.refereeMessage.stage);
4354
},
@@ -51,6 +62,18 @@
5162
remainingTime() {
5263
return this.refereeMessage.currentActionTimeRemaining;
5364
},
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+
},
5477
commandForBlue() {
5578
switch (this.refereeMessage.command) {
5679
case Referee.Command.PREPARE_KICKOFF_BLUE:
@@ -91,6 +114,10 @@
91114
align-items: center;
92115
}
93116
117+
.full-width {
118+
width: 100%;
119+
}
120+
94121
.time-container {
95122
border-style: dashed;
96123
display: inline-block;
@@ -124,4 +151,19 @@
124151
margin-top: 3vmin;
125152
}
126153
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+
127169
</style>

src/components/StatusBoard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
computed: {
2828
refereeMessage() {
2929
return this.$store.state.refereeMsg;
30-
}
30+
},
3131
}
3232
}
3333
</script>

0 commit comments

Comments
 (0)