Skip to content

Commit 328fb30

Browse files
committed
Added match labels
1 parent f24eee5 commit 328fb30

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

src/main.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ class BracketsViewer {
162162
};
163163
}
164164

165-
roundDOM.append(this.renderMatch(match, connection));
165+
roundDOM.append(this.renderMatch(match, connection, `M ${roundNumber}.${match.number}`));
166166
}
167167

168168
bracket.append(roundDOM);
@@ -189,13 +189,14 @@ class BracketsViewer {
189189
}
190190
}
191191

192-
private renderMatch(results: MatchResults, connection?: Connection) {
192+
private renderMatch(results: MatchResults, connection?: Connection, label?: string) {
193193
const team1 = this.renderTeam(results.opponent1);
194194
const team2 = this.renderTeam(results.opponent2);
195195

196196
const teams = $('<div class="teams">').append(team1).append(team2);
197-
const match = $('<div class="match">').append(teams);
197+
if (label) teams.append($('<span>').text(label));
198198

199+
const match = $('<div class="match">').append(teams);
199200
if (!connection) return match;
200201

201202
if (connection.connectPrevious)

src/style.scss

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ h3 {
109109
.bracket {
110110
flex: 1;
111111
display: flex;
112-
margin-bottom: 50px;
112+
margin-bottom: 30px;
113113

114114
.round {
115115
flex: 1;
@@ -163,6 +163,16 @@ h3 {
163163
width: 100%;
164164
position: relative;
165165

166+
& > span {
167+
position: absolute;
168+
top: -10px;
169+
left: 3px;
170+
font-size: 0.8rem;
171+
background: white;
172+
padding: 0 5px;
173+
color: #a7a7a7;
174+
}
175+
166176
&.connect-previous {
167177
&::before {
168178
content: "";
@@ -223,13 +233,15 @@ h3 {
223233
border-bottom: none;
224234
border-top-left-radius: $match-borders-radius;
225235
border-top-right-radius: $match-borders-radius;
236+
padding-top: 8px;
226237
}
227238

228239
&:nth-of-type(2) {
229240
border: $match-borders;
230241
border-top: none;
231242
border-bottom-left-radius: $match-borders-radius;
232243
border-bottom-right-radius: $match-borders-radius;
244+
padding-bottom: 8px;
233245
}
234246
}
235247

@@ -243,7 +255,7 @@ h3 {
243255
}
244256

245257
& > span {
246-
color: rgb(170, 170, 170);
258+
color: #a7a7a7;
247259
}
248260
}
249261

0 commit comments

Comments
 (0)