Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak SM5 score card to fit on smaller screens. #91

Merged
merged 1 commit into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 43 additions & 12 deletions assets/html/game/scorecard_sm5.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,40 @@
float: left;
}

.chart_container {
width: 100%;
}

.chart {
max-width: 90%;
display: flex;
padding: 1rem;
}

/*
* Balance the left and right sections based on screen width.
* The score card is complex and needs more space, so we may need to redistribute screen space
* based on that.
*/
@media screen and (max-width: 2599px) {
.scorecard_main_stats {
width: 30%;
float: left;
}

.scorecard_player_stats {
width: 65%;
float: left;
}
}

/* Once the screen is really wide, the charts can go side by side. */
@media screen and (min-width: 2600px) {
.chart_container {
display: flex;
}
}

.player {
}

Expand Down Expand Up @@ -223,13 +257,8 @@
align-items: center;
}

.chart {
max-width: 50%;
display: flex;
}

.mini-chart {
max-width: 64px;
max-width: 48px;
display: flex;
}
</style>
Expand Down Expand Up @@ -265,11 +294,13 @@ <h2 style="font-size: 20px;">&nbsp;{{entity_start.name}}</h2>
{% endfor %}
</table>
</div>
<div class="scorecard_graphs">
<canvas class="chart" id="score_composition"></canvas>
</div>
<div class="scorecard_graphs">
<canvas class="chart" id="state_distribution"></canvas>
<div class="chart_container">
<div class="scorecard_graphs">
<canvas class="chart" id="score_composition"></canvas>
</div>
<div class="scorecard_graphs">
<canvas class="chart" id="state_distribution"></canvas>
</div>
</div>
</div>

Expand All @@ -285,7 +316,7 @@ <h2 class="{{ team.team.css_class }} team-header">{{ team.name }} ({{ team.score
<th class="second-fixed-column" {{ tooltip("sm5_codename") }}><p>Codename</p></th>
<th {{ tooltip("sm5_score") }}><p>Score</p></th>
<th {{ tooltip("sm5_positive_score") }}><p>Positive Score</p></th>
<th {{ tooltip("sm5_points_minute") }}><p>Points/Minute</p></th>
<th {{ tooltip("sm5_points_minute") }}><p>Points / Minute</p></th>
<th {{ tooltip("sm5_lives_left") }}><p>Lives Left</p></th>
<th {{ tooltip("sm5_alive") }}><p>Alive</p></th>
<th {{ tooltip("sm5_shots_left") }}><p>Shots Left</p></th>
Expand Down
Loading