Skip to content

Commit 0ab9de3

Browse files
authored
Merge pull request #6 from mame98/ui-cleanup
Ui cleanup
2 parents f14c523 + fcb7c8e commit 0ab9de3

File tree

7 files changed

+138
-27
lines changed

7 files changed

+138
-27
lines changed

public/bot.png

30.7 KB
Loading

src/App.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323
text-align: center;
2424
color: aliceblue;
2525
height: 100%;
26+
background-color: #353535;
2627
}
2728
</style>

src/components/Card.vue

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<template>
22
<div class="card">
33
<div class="card-pic" :class="{'red-card': color === 'red', 'yellow-card': color === 'yellow'}"></div>
4-
<div class="card-count">{{numCards}}</div>
4+
<div class="card-count">
5+
{{numCards}}
6+
</div>
57
</div>
68
</template>
79

@@ -18,10 +20,11 @@
1820
<style scoped>
1921
2022
.card {
21-
border-style: dotted;
22-
border-width: 0.4vh;
2323
display: inline-block;
2424
margin: 0.1em;
25+
height: 7vmin;
26+
min-width: 130px;
27+
text-align: center;
2528
}
2629
2730
.card-pic {
@@ -30,7 +33,7 @@
3033
height: 5vmin;
3134
margin-left: 1vmin;
3235
display: inline-block;
33-
font-size: initial;
36+
font-size: 12pt;
3437
/* IE 7 hack */
3538
*zoom: 1;
3639
*display: inline;
@@ -39,7 +42,8 @@
3942
4043
.card-count {
4144
display: inline-block;
42-
vertical-align: middle;
45+
line-height: 7vmin;
46+
vertical-align: baseline;
4347
margin-right: 1vw;
4448
margin-left: 1vw;
4549
}

src/components/CardTimer.vue

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<template>
2+
<div class="card-timer">
3+
<div class="progressBar" :style="{
4+
'width': `${percentage}%`
5+
}"> </div>
6+
</div>
7+
</template>
8+
9+
<script>
10+
export default {
11+
name: "CardTimer",
12+
props: {
13+
cardTimer: Number,
14+
},
15+
16+
computed: {
17+
percentage() {
18+
return this.cardTimer / 1200000
19+
},
20+
}
21+
}
22+
</script>
23+
24+
<style scoped>
25+
26+
.card-timer {
27+
width: 90%;
28+
height: 16px;
29+
display: block;
30+
border: 1px yellow solid;
31+
margin-left: 5%;
32+
margin-right: 5%;
33+
margin-bottom: 8px;
34+
}
35+
36+
.card-timer .progressBar {
37+
background: yellow;
38+
display: inline-block;
39+
height: 100%;
40+
vertical-align: top;
41+
}
42+
43+
</style>

src/components/GameEvents.vue

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22
<div class="game-events">
33
<table class="table-striped">
44
<tbody>
5-
<tr v-for="(gameEvent, index) in gameEvents"
5+
<tr v-for="(gameEvent, index) in gameEvents.slice(0,8)"
66
:key="index"
77
:style="{'font-size': rowHeight}">
8+
<td class="autoRefIndicator" v-html="autoRefIndicator(gameEvent)"></td>
89
<td v-html="formatGameEvent(gameEvent)"></td>
910
</tr>
1011
</tbody>
1112
</table>
13+
<div class="more-game-events" v-if="gameEvents.length > 8"> + {{gameEvents.length - 8}} more game events </div>
1214
</div>
1315
</template>
1416

1517
<script>
1618
import {mapGameEventToText} from "../texts";
1719
18-
const maxUnscaledItems = 6;
20+
const maxUnscaledItems = 5.5;
1921
2022
export default {
2123
name: "GameEvents",
@@ -27,13 +29,23 @@
2729
return this.refereeMessage.gameEvents;
2830
},
2931
rowHeight() {
30-
let rel = 1 - (Math.max(0, this.gameEvents.length - maxUnscaledItems) / maxUnscaledItems);
32+
let n = Math.min(8, this.gameEvents.length)
33+
let rel = 1 - (Math.max(0, n - maxUnscaledItems) / maxUnscaledItems);
3134
return rel + 'em';
3235
},
3336
},
3437
methods: {
3538
formatGameEvent(gameEvent) {
3639
return mapGameEventToText(gameEvent);
40+
},
41+
42+
autoRefIndicator(gameEvent) {
43+
if(gameEvent.origin == "")
44+
{
45+
return "GameController";
46+
} else {
47+
return gameEvent.origin;
48+
}
3749
}
3850
}
3951
}
@@ -43,21 +55,34 @@
4355
4456
.game-events {
4557
text-align: left;
46-
font-size: 5.0vh;
58+
font-size: 4.5vh;
4759
}
4860
4961
.table-striped {
5062
width: 100%;
51-
padding-left: 0.2em;
52-
padding-right: 0.2em;
63+
padding-left: 0.1em;
64+
padding-right: 0.1em;
5365
}
5466
5567
.table-striped tbody tr:nth-of-type(odd) {
56-
background-color: rgba(111, 158, 208, 0.6);
68+
background-color: #222;
5769
}
5870
5971
.table-striped tbody tr:nth-of-type(even) {
60-
background-color: rgba(194, 195, 208, 0.6);
72+
background-color: #444
6173
}
6274
75+
.table-striped td {
76+
vertical-align: baseline;
77+
padding: 2px;
78+
padding-left: 10px;
79+
}
80+
81+
.more-game-events {
82+
font-size: 2.5vmin;
83+
text-align: center;
84+
margin-top: 10px;
85+
font-weight: bold;
86+
color: #fff;
87+
}
6388
</style>

src/components/StatusBoard.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,18 @@
4242
4343
.upper-container {
4444
width: 100%;
45-
height: 58%;
4645
align-items: center;
46+
height: 62%
4747
}
4848
4949
.lower-container {
50-
height: 39%;
50+
height: 35%;
5151
}
5252
5353
.upper-lower-separator {
5454
margin-top: 0.2em;
5555
margin-bottom: 0.2em;
56+
display: block;
5657
}
5758
5859
.match-status-container {

src/components/TeamStatus.vue

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
11
<template>
2-
<div :class="{'bot-substitution-intent': botSubstitutionIntent}">
2+
<div class="teamStatus" :class="{'bot-substitution-intent': botSubstitutionIntent}">
33
<div :class="{'team-yellow': color === 'yellow', 'team-blue': color === 'blue'}" class="team-name">
44
<div class="team-name-text">{{team.name}}</div>
55
</div>
66

77
<img :src="logoUrl" alt="team logo" class="team-logo"/>
88

9-
<hr class="logo-card-separator">
10-
119
<div class="cards">
1210
<Card color="red" :num-cards="team.redCards"/>
1311
<span> | </span>
1412
<Card color="yellow"
1513
:class="{'marked-card': markYellowCard}"
1614
:num-cards="team.yellowCards"/>
15+
<span> | </span>
16+
<span class="botinfo">
17+
<img class="boticon" src="bot.png"/>
18+
{{team.maxAllowedBots}}
19+
</span>
20+
<div class="cardTimers">
21+
<span v-for="(cardTime, index) in team.yellowCardTimes.slice(0,3)" :key="index">
22+
<CardTimer
23+
:cardTimer="cardTime" />
24+
</span>
25+
26+
27+
<div class="additional-cards" v-if="team.yellowCardTimes.length > 3"> + {{ team.yellowCardTimes.length - 3}} more </div>
28+
</div>
1729
</div>
1830
</div>
1931
</template>
@@ -22,10 +34,11 @@
2234
import {Referee} from "@/sslProto"
2335
import teamLogoUrl from "@/teamLogoUrl"
2436
import Card from "./Card";
37+
import CardTimer from "./CardTimer";
2538
2639
export default {
2740
name: "TeamStatus",
28-
components: {Card},
41+
components: {Card, CardTimer},
2942
props: {
3043
color: String,
3144
team: Referee.ITeamInfo,
@@ -46,28 +59,29 @@
4659

4760
<style scoped>
4861
62+
.teamStatus {
63+
transition: background-color 500ms ease;
64+
65+
}
66+
4967
.bot-substitution-intent {
5068
background-color: #c2c3d0;
5169
}
5270
5371
.team-name {
54-
height: 15vh;
72+
height: 12vh;
5573
display: flex;
5674
flex-direction: column;
5775
justify-content: flex-end;
5876
}
5977
6078
.team-logo {
61-
max-width: 20vw;
62-
max-height: 30vh;
79+
max-width: 27vw;
80+
max-height: 27vh;
6381
}
6482
6583
.marked-card {
66-
border-color: yellow;
67-
}
68-
69-
.cards {
70-
vertical-align: middle;
84+
background-color: rgba(255, 255, 0, 0.2);
7185
}
7286
7387
.inline {
@@ -78,4 +92,27 @@
7892
margin: 0.2em;
7993
}
8094
95+
.cardTimers {
96+
margin-top: 6px;
97+
display: block;
98+
}
99+
100+
101+
.boticon {
102+
height: 4.5vmin;
103+
vertical-align: baseline;
104+
}
105+
106+
.botinfo {
107+
display: inline-block;
108+
min-width: 130px;
109+
height: 7vmin;
110+
line-height: 7vmin;
111+
vertical-align: baseline
112+
}
113+
114+
.additional-cards {
115+
font-size: 24pt;
116+
color: yellow;
117+
}
81118
</style>

0 commit comments

Comments
 (0)