Skip to content

Commit c6bc0b4

Browse files
authored
Merge pull request #26 from sergical/sergical/bracket-styling
Add bracket styling: React Flow controls and champion stacking
2 parents f7796c0 + 1f63843 commit c6bc0b4

3 files changed

Lines changed: 64 additions & 13 deletions

File tree

src/components/bracket/Bracket.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,12 @@ function generateNodes(): Node[] {
280280
// CHAMPIONSHIP (center)
281281
// ===========================================================================
282282
const finalGame = bracket.finals[0];
283+
// Center between left finalist (x=3) and right finalist (x=4.5)
283284
nodes.push({
284285
id: "championship",
285286
type: finalGame?.winner ? "playerNode" : "emptySlot",
286287
position: {
287-
x: ROUND_GAP * 3.5,
288+
x: ROUND_GAP * 3.75,
288289
y: 0,
289290
},
290291
data: finalGame?.winner
@@ -645,15 +646,9 @@ function BracketContent() {
645646
onInit={handleInit}
646647
>
647648
<Controls
649+
className="bracket-controls"
648650
orientation="horizontal"
649651
showInteractive={false}
650-
style={{
651-
position: "absolute",
652-
top: 0,
653-
bottom: "auto",
654-
right: 0,
655-
left: "auto",
656-
}}
657652
/>
658653
</ReactFlow>
659654
</div>

src/components/bracket/bracket.css

Lines changed: 58 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,34 @@
55
align-items: center;
66
gap: 0;
77
position: relative;
8-
[data-id*="finalist"] & {
9-
/* border: 3px solid var(--yellow); */
8+
9+
/* Finalist and championship nodes - vertically stacked layout */
10+
[data-id*="finalist"] &,
11+
[data-id="championship"] & {
1012
flex-direction: column;
1113
justify-content: center;
1214
align-items: center;
1315
width: auto;
14-
/* margin-left: -20px; */
1516
.player-name {
1617
padding-top: 20px;
1718
}
19+
.player-info {
20+
text-align: center;
21+
margin-left: 0;
22+
}
1823
.player-photo-ring {
1924
margin-bottom: -30px;
2025
}
2126
}
22-
[data-id*="right-finalist"] & {
23-
/* margin-left: 20px; */
27+
28+
/* Finalist sizing */
29+
[data-id*="finalist"] & .player-photo-ring {
30+
--photo-size: 65px;
31+
}
32+
33+
/* Championship sizing */
34+
[data-id="championship"] & .player-photo-ring {
35+
--photo-size: 80px;
2436
}
2537
}
2638

@@ -181,3 +193,44 @@
181193
border: 2px solid black;
182194
border-radius: 50%;
183195
}
196+
197+
/* Custom bracket controls styling */
198+
.bracket-controls.react-flow__controls {
199+
top: 0;
200+
right: 0;
201+
bottom: auto;
202+
left: auto;
203+
box-shadow: none;
204+
}
205+
206+
.bracket-controls .react-flow__controls-button {
207+
background: var(--black);
208+
border: 2px solid var(--yellow) !important;
209+
border-radius: 0;
210+
color: var(--yellow);
211+
width: 32px;
212+
height: 32px;
213+
}
214+
215+
.bracket-controls .react-flow__controls-button:hover {
216+
background: var(--yellow);
217+
}
218+
219+
.bracket-controls .react-flow__controls-button svg {
220+
fill: var(--yellow);
221+
max-width: 14px;
222+
max-height: 14px;
223+
}
224+
225+
.bracket-controls .react-flow__controls-button:hover svg {
226+
fill: var(--black);
227+
}
228+
229+
.bracket-container .react-flow__attribution {
230+
background: var(--black);
231+
padding: 4px 8px;
232+
}
233+
234+
.bracket-container .react-flow__attribution a {
235+
color: var(--yellow);
236+
}

src/components/roster/roster.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
display: grid;
33
--card-size: 300px;
44
grid-template-columns: repeat(auto-fill, minmax(var(--card-size), 1fr));
5+
@media (max-width: 700px) {
6+
--card-size: 200px;
7+
}
58
@media (max-width: 500px) {
69
--card-size: 150px;
710
}

0 commit comments

Comments
 (0)