Skip to content

Commit ecc8d92

Browse files
committed
Reformat code
1 parent 1aef9f8 commit ecc8d92

File tree

17 files changed

+163
-112
lines changed

17 files changed

+163
-112
lines changed

frontend/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*_pb.ts

frontend/src/App.vue

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
2-
import {computed} from 'vue'
3-
import {useRefereeStore} from '@/stores/referee'
2+
import { computed } from 'vue'
3+
import { useRefereeStore } from '@/stores/referee'
44
import StatusBoard from '@/components/StatusBoard.vue'
55
66
const refereeStore = useRefereeStore()
@@ -15,7 +15,6 @@ const url = computed(() => {
1515
return urlParams.get('url')
1616
})
1717
18-
1918
const showVideo = computed(() => {
2019
if (showVideoAfter.value && url.value) {
2120
const packetTimestamp = Number(refereeStore.refereeMsg.packetTimestamp)
@@ -30,14 +29,14 @@ const showVideo = computed(() => {
3029
<template>
3130
<div id="app">
3231
<iframe
33-
:class="{hidden: !showVideo}"
32+
:class="{ hidden: !showVideo }"
3433
:src="url || ''"
3534
title="Video"
3635
:width="showVideo ? '100%' : '0'"
3736
:height="showVideo ? '100%' : '0'"
3837
allow="autoplay"
3938
/>
40-
<StatusBoard :class="{hidden: showVideo}"/>
39+
<StatusBoard :class="{ hidden: showVideo }" />
4140
</div>
4241
</template>
4342

@@ -54,8 +53,8 @@ const showVideo = computed(() => {
5453
5554
iframe {
5655
border: 0;
57-
overflow:hidden;
58-
display:block;
56+
overflow: hidden;
57+
display: block;
5958
position: absolute;
6059
}
6160

frontend/src/assets/global.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ body {
2222

2323
.team-blue {
2424
color: #779fff;
25-
}
25+
}

frontend/src/components/BotCount.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="bot-count">
33
<div class="element">
4-
<img class="bot-pic" alt="bot" src="/bot.png"/>
4+
<img class="bot-pic" alt="bot" src="/bot.png" />
55
</div>
66
<div class="element bot-number">
77
{{ numBots }}
@@ -36,4 +36,4 @@ defineProps<{
3636
width: 1.5em;
3737
height: 2em;
3838
}
39-
</style>
39+
</style>

frontend/src/components/CardTimer.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="card-timer">
3-
<div class="progressBar" :style="{ 'width': `${percentage}%` }"></div>
3+
<div class="progressBar" :style="{ width: `${percentage}%` }"></div>
44
</div>
55
</template>
66

@@ -33,4 +33,4 @@ const percentage = computed(() => {
3333
height: 100%;
3434
vertical-align: top;
3535
}
36-
</style>
36+
</style>

frontend/src/components/GameEvents.vue

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,53 @@
22
<div class="game-events">
33
<table class="table-striped">
44
<tbody>
5-
<tr v-for="(gameEvent, index) in gameEvents" :key="index">
6-
<td>{{ gameEvents.length - index }}</td>
7-
<td v-html="formatGameEvent(gameEvent)"></td>
8-
<td class="autoRefIndicator">
9-
<img
10-
class="autoref-icon"
11-
:src="tigers_autoref"
12-
alt="TIGERs"
13-
v-if="isOrigin(gameEvent, 'TIGERs AutoRef')"
14-
/>
15-
<img
16-
class="autoref-icon"
17-
:src="erforce_autoref"
18-
alt="ER-Force"
19-
v-if="isOrigin(gameEvent, 'ER-Force')"
20-
/>
21-
<font-awesome-icon :icon="faUser" v-if="isOrigin(gameEvent, 'UI')"/>
22-
<font-awesome-icon :icon="faVoteYea" v-if="isOrigin(gameEvent, 'Majority')"/>
23-
</td>
24-
</tr>
5+
<tr v-for="(gameEvent, index) in gameEvents" :key="index">
6+
<td>{{ gameEvents.length - index }}</td>
7+
<td v-html="formatGameEvent(gameEvent)"></td>
8+
<td class="autoRefIndicator">
9+
<img
10+
class="autoref-icon"
11+
:src="tigers_autoref"
12+
alt="TIGERs"
13+
v-if="isOrigin(gameEvent, 'TIGERs AutoRef')"
14+
/>
15+
<img
16+
class="autoref-icon"
17+
:src="erforce_autoref"
18+
alt="ER-Force"
19+
v-if="isOrigin(gameEvent, 'ER-Force')"
20+
/>
21+
<font-awesome-icon :icon="faUser" v-if="isOrigin(gameEvent, 'UI')" />
22+
<font-awesome-icon :icon="faVoteYea" v-if="isOrigin(gameEvent, 'Majority')" />
23+
</td>
24+
</tr>
2525
</tbody>
2626
</table>
2727
</div>
2828
</template>
2929

3030
<script setup lang="ts">
31-
import {computed} from 'vue'
32-
import {useRefereeStore} from '@/stores/referee'
33-
import {mapGameEventToText} from '@/helpers/texts'
31+
import { computed } from 'vue'
32+
import { useRefereeStore } from '@/stores/referee'
33+
import { mapGameEventToText } from '@/helpers/texts'
3434
import tigers_autoref from '@/assets/icons/tigers-autoref.png'
3535
import erforce_autoref from '@/assets/icons/erforce-autoref.svg'
36-
import type {GameEvent} from '@/proto/ssl_gc_game_event_pb'
37-
import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'
38-
import {faUser, faVoteYea} from "@fortawesome/free-solid-svg-icons";
36+
import type { GameEvent } from '@/proto/ssl_gc_game_event_pb'
37+
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
38+
import { faUser, faVoteYea } from '@fortawesome/free-solid-svg-icons'
3939
4040
const refereeStore = useRefereeStore()
4141
4242
const gameEvents = computed(() => {
43-
return refereeStore.refereeMsg.gameEvents?.map(x => x).reverse() || []
43+
return refereeStore.refereeMsg.gameEvents?.map((x) => x).reverse() || []
4444
})
4545
4646
const formatGameEvent = (gameEvent: GameEvent): string => {
4747
return mapGameEventToText(gameEvent)
4848
}
4949
5050
const isOrigin = (gameEvent: GameEvent, origin: string): boolean => {
51-
return gameEvent.origin?.some(o => o.includes(origin)) || false
51+
return gameEvent.origin?.some((o) => o.includes(origin)) || false
5252
}
5353
</script>
5454

frontend/src/components/MatchStatus.vue

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,41 @@
11
<template>
22
<div class="match-status">
33
<div>
4-
<div
4+
<div
55
:class="{
6-
'highlight-command': true,
7-
'stop-command': isStop,
8-
'halt-command': isHalt,
9-
'robot-substitution-blue': isRobotSubstitutionBlue,
10-
'robot-substitution-yellow': isRobotSubstitutionYellow,
11-
'robot-substitution-both': isRobotSubstitutionBoth
6+
'highlight-command': true,
7+
'stop-command': isStop,
8+
'halt-command': isHalt,
9+
'robot-substitution-blue': isRobotSubstitutionBlue,
10+
'robot-substitution-yellow': isRobotSubstitutionYellow,
11+
'robot-substitution-both': isRobotSubstitutionBoth,
1212
}"
1313
>
1414
<div class="stage">{{ stage }}</div>
1515

1616
<span class="score">
17-
{{ refereeStore.refereeMsg.yellow?.score || 0 }} : {{ refereeStore.refereeMsg.blue?.score || 0 }}
17+
{{ refereeStore.refereeMsg.yellow?.score || 0 }} :
18+
{{ refereeStore.refereeMsg.blue?.score || 0 }}
1819
</span>
1920

20-
<div
21-
class="command"
21+
<div
22+
class="command"
2223
:class="{ 'team-yellow': commandForYellow, 'team-blue': commandForBlue }"
2324
>
2425
{{ gameState }}
2526
<span v-if="isBallPlacement && remainingTime >= 0">
2627
({{ formatDuration(Number(remainingTime)) }})
2728
</span>
28-
<span v-if="isTimeout">
29-
({{ formatDuration(timeoutTime) }})
30-
</span>
29+
<span v-if="isTimeout"> ({{ formatDuration(timeoutTime) }}) </span>
3130
</div>
3231
</div>
3332

34-
<hr class="separator"/>
33+
<hr class="separator" />
3534

3635
<PowerPlay />
3736
<StatusMessage />
38-
3937
</div>
40-
<div
38+
<div
4139
class="time-container"
4240
:class="{ 'time-positive': stageTimeLeft >= 0, 'time-negative': stageTimeLeft < 0 }"
4341
>
@@ -97,23 +95,27 @@ const stage = computed(() => {
9795
9896
const gameState = computed(() => {
9997
if (isRobotSubstitutionAny.value) {
100-
return "Robot Substitution"
98+
return 'Robot Substitution'
10199
}
102100
return mapCommandToText(refereeStore.refereeMsg.command)
103101
})
104102
105103
const isBallPlacement = computed(() => {
106-
return refereeStore.refereeMsg.command === Referee_Command.BALL_PLACEMENT_BLUE ||
107-
refereeStore.refereeMsg.command === Referee_Command.BALL_PLACEMENT_YELLOW
104+
return (
105+
refereeStore.refereeMsg.command === Referee_Command.BALL_PLACEMENT_BLUE ||
106+
refereeStore.refereeMsg.command === Referee_Command.BALL_PLACEMENT_YELLOW
107+
)
108108
})
109109
110110
const remainingTime = computed(() => {
111111
return refereeStore.refereeMsg.currentActionTimeRemaining || 0n
112112
})
113113
114114
const isTimeout = computed(() => {
115-
return refereeStore.refereeMsg.command === Referee_Command.TIMEOUT_BLUE ||
116-
refereeStore.refereeMsg.command === Referee_Command.TIMEOUT_YELLOW
115+
return (
116+
refereeStore.refereeMsg.command === Referee_Command.TIMEOUT_BLUE ||
117+
refereeStore.refereeMsg.command === Referee_Command.TIMEOUT_YELLOW
118+
)
117119
})
118120
119121
const timeoutTime = computed(() => {
@@ -204,17 +206,17 @@ const stageTimeLeft = computed(() => {
204206
205207
.highlight-command {
206208
transition: background-color 500ms ease;
207-
border-radius: .5em;
209+
border-radius: 0.5em;
208210
padding: 0.2em 0.1em 0.1em;
209211
margin-top: 0.1em;
210212
}
211213
212214
.highlight-command.stop-command {
213-
background-color: #FF7000
215+
background-color: #ff7000;
214216
}
215217
216218
.highlight-command.halt-command {
217-
background-color: #EE0022;
219+
background-color: #ee0022;
218220
}
219221
220222
.highlight-command.robot-substitution-blue {
@@ -231,4 +233,4 @@ const stageTimeLeft = computed(() => {
231233
background-image: linear-gradient(to right, #fff145 0%, #779fff 100%);
232234
color: #353535;
233235
}
234-
</style>
236+
</style>

frontend/src/components/PowerPlay.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div>
3-
<span
3+
<span
44
v-if="showPowerplay"
55
:class="{ 'team-yellow': powerPlayTeam === 'Yellow', 'team-blue': powerPlayTeam === 'Blue' }"
66
>
@@ -37,7 +37,7 @@ const showPowerplay = computed(() => {
3737
if (powerPlayTeam.value === null) {
3838
return false
3939
}
40-
40+
4141
switch (refereeStore.refereeMsg.command) {
4242
case Referee_Command.NORMAL_START:
4343
case Referee_Command.FORCE_START:
@@ -53,4 +53,4 @@ const showPowerplay = computed(() => {
5353

5454
<style scoped>
5555
/* Styles will be inherited from global CSS */
56-
</style>
56+
</style>

frontend/src/components/StatusBoard.vue

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
<template>
22
<div class="status-board">
33
<div class="upper-container">
4-
<TeamStatus
5-
class="team-status"
6-
color="yellow"
7-
:team="refereeStore.refereeMsg.yellow"
8-
/>
4+
<TeamStatus class="team-status" color="yellow" :team="refereeStore.refereeMsg.yellow" />
95

106
<div class="match-status-container">
117
<MatchStatus />
128
</div>
139

14-
<TeamStatus
15-
class="team-status"
16-
color="blue"
17-
:team="refereeStore.refereeMsg.blue"
18-
/>
10+
<TeamStatus class="team-status" color="blue" :team="refereeStore.refereeMsg.blue" />
1911
</div>
2012

21-
<hr class="upper-lower-separator">
13+
<hr class="upper-lower-separator" />
2214

2315
<GameEvents class="lower-container" />
2416
</div>
@@ -62,4 +54,4 @@ const refereeStore = useRefereeStore()
6254
flex-grow: 0.3;
6355
flex-basis: 30%;
6456
}
65-
</style>
57+
</style>

frontend/src/components/StatusCard.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
<template>
22
<div class="card">
3-
<div class="card-pic" :class="{'red-card': color === 'red', 'yellow-card': color === 'yellow', 'foul': color === 'foul'}">
3+
<div
4+
class="card-pic"
5+
:class="{
6+
'red-card': color === 'red',
7+
'yellow-card': color === 'yellow',
8+
foul: color === 'foul',
9+
}"
10+
>
411
{{ numCards }}
512
</div>
613
</div>
@@ -40,4 +47,4 @@ defineProps<{
4047
background: #c7c7c7;
4148
color: #2c3e50;
4249
}
43-
</style>
50+
</style>

0 commit comments

Comments
 (0)