Skip to content

Commit cbecdd8

Browse files
committed
[ui] Introduce flexbox styling
1 parent cc0ac1a commit cbecdd8

File tree

4 files changed

+50
-34
lines changed

4 files changed

+50
-34
lines changed

ui/src/App.vue

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
<template>
22
<div id="app">
3-
<GameState/>
4-
<TeamOverview class="team-views" team-color="Yellow"/>
5-
<TeamOverview class="team-views" team-color="Blue"/>
6-
<ControlTeam class="team-views" team-color="Yellow"/>
7-
<ControlTeam class="team-views" team-color="Blue"/>
8-
<ControlGeneral/>
9-
<ControlMatch class="match-controls"/>
10-
<Debug class="debug"/>
3+
<div id="header">
4+
<ControlGeneral class="header-item"/>
5+
<GameState id="game-state" class="header-item"/>
6+
</div>
7+
<div id="main-elements">
8+
<TeamOverview class="team-views" team-color="Yellow"/>
9+
<TeamOverview class="team-views" team-color="Blue"/>
10+
<ControlTeam class="team-views" team-color="Yellow"/>
11+
<ControlTeam class="team-views" team-color="Blue"/>
12+
</div>
1113
<Field/>
14+
<ControlMatch id="match-controls"/>
15+
<Debug id="debug"/>
1216
</div>
1317
</template>
1418

@@ -42,21 +46,47 @@
4246
-moz-osx-font-smoothing: grayscale;
4347
text-align: center;
4448
color: #2c3e50;
45-
margin-top: 1em;
4649
}
4750
48-
.debug {
49-
position: fixed;
50-
bottom: 0;
51+
#header {
52+
display: flex;
53+
flex-direction: row;
54+
flex-wrap: wrap-reverse;
55+
justify-content: space-between;
56+
align-items: baseline;
57+
align-content: flex-start;
58+
}
59+
60+
.header-item {
61+
margin: 0.3em;
62+
}
63+
64+
#game-state {
65+
font-size: 1.2em;
66+
font-weight: bold;
5167
}
5268
53-
.match-controls {
69+
#main-elements {
70+
display: flex;
71+
flex-direction: row;
72+
flex-wrap: wrap;
73+
justify-content: flex-start;
74+
align-items: flex-start;
75+
align-content: flex-start;
76+
}
77+
78+
#match-controls {
5479
width: 100%;
5580
position: fixed;
5681
bottom: 0;
5782
text-align: center;
5883
}
5984
85+
#debug {
86+
position: fixed;
87+
bottom: 0;
88+
}
89+
6090
.team-views {
6191
float: left;
6292
margin: 0.5em;

ui/src/components/GameState.vue

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="game-state">
2+
<div>
33
<span v-b-tooltip.hover title="The current stage of the game">
44
{{state.stage}}
55
</span>
@@ -36,23 +36,5 @@
3636
}
3737
</script>
3838

39-
<!-- Add "scoped" attribute to limit CSS to this component only -->
4039
<style scoped>
41-
h3 {
42-
margin: 40px 0 0;
43-
}
44-
45-
ul {
46-
list-style-type: none;
47-
padding: 0;
48-
}
49-
50-
li {
51-
display: inline-block;
52-
margin: 0 10px;
53-
}
54-
55-
a {
56-
color: #42b983;
57-
}
5840
</style>

ui/src/components/control/ControlGeneral.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979

8080
<style scoped>
8181
button {
82-
margin: 0.5em;
82+
margin-right: 0.5em;
83+
margin-bottom: 0.5em;
8384
}
8485
</style>

ui/src/components/team/TeamOverview.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div>
2+
<div class="team-overview">
33
<h2 v-b-tooltip.hover title="Edit team data by double-clicking a value"> Team {{teamColor}}</h2>
44
<div>
55
<TeamName
@@ -68,4 +68,7 @@
6868
</script>
6969

7070
<style scoped>
71+
.team-overview {
72+
text-align: left;
73+
}
7174
</style>

0 commit comments

Comments
 (0)