improved button state visualization

main
Simon Lang 3 months ago
parent 0e00f9d471
commit 7a0c26ce5d
  1. 4
      public/elotracker/chart-integration.js
  2. 4
      public/elotracker/index.php
  3. 21
      public/elotracker/styles.css
  4. 1
      public/img/material-symbols/keyboard_arrow_down_24dp_FILL1_wght300_GRAD0_opsz24.svg

@ -378,11 +378,15 @@ function getColor(num) {
function toggle_combined_chart() { function toggle_combined_chart() {
const comb_charts = this.parentNode.parentNode.querySelectorAll(`.leaderboard>.graph-wrapper`); const comb_charts = this.parentNode.parentNode.querySelectorAll(`.leaderboard>.graph-wrapper`);
const chart = this.parentNode.parentNode.querySelector(`.graph-wrapper.${this.id}`); const chart = this.parentNode.parentNode.querySelector(`.graph-wrapper.${this.id}`);
const buttons = document.querySelectorAll("button.open-general-graph");
if (chart.classList.contains("closed")) { if (chart.classList.contains("closed")) {
comb_charts.forEach(element => element.classList.add("closed")); comb_charts.forEach(element => element.classList.add("closed"));
buttons.forEach(element => element.classList.remove("dropdown-open"));
chart.classList.remove("closed"); chart.classList.remove("closed");
this.classList.add("dropdown-open");
} else { } else {
chart.classList.add("closed"); chart.classList.add("closed");
this.classList.remove("dropdown-open");
} }
} }

@ -14,8 +14,8 @@
<div class='leaderboard'> <div class='leaderboard'>
<button type='button' class='update-leaderboard progress-button'>Ränge aktualisieren <?php echo file_get_contents(__DIR__."/../img/material-symbols/sync_24dp_FILL1_wght300_GRAD0_opsz24.svg")?></button> <button type='button' class='update-leaderboard progress-button'>Ränge aktualisieren <?php echo file_get_contents(__DIR__."/../img/material-symbols/sync_24dp_FILL1_wght300_GRAD0_opsz24.svg")?></button>
<div class='combined-charts-buttons'> <div class='combined-charts-buttons'>
<button type='button' id='rank-graph' class='open-general-graph'>Rang-Vergleich</button> <button type='button' id='rank-graph' class='open-general-graph'>Rang-Vergleich <?php echo file_get_contents(__DIR__."/../img/material-symbols/keyboard_arrow_down_24dp_FILL1_wght300_GRAD0_opsz24.svg")?></button>
<button type='button' id='progress-graph' class='open-general-graph'>Fortschritt-Vergleich</button> <button type='button' id='progress-graph' class='open-general-graph'>Fortschritt-Vergleich <?php echo file_get_contents(__DIR__."/../img/material-symbols/keyboard_arrow_down_24dp_FILL1_wght300_GRAD0_opsz24.svg")?></button>
</div> </div>
<div class='graph-wrapper rank-graph closed'><canvas id="progress-chart-combined" style="width:100%;max-width:700px"></canvas></div> <div class='graph-wrapper rank-graph closed'><canvas id="progress-chart-combined" style="width:100%;max-width:700px"></canvas></div>
<div class='graph-wrapper progress-graph closed'><canvas id="progress-chart-combined-progress" style="width:100%;max-width:700px"></canvas></div> <div class='graph-wrapper progress-graph closed'><canvas id="progress-chart-combined-progress" style="width:100%;max-width:700px"></canvas></div>

@ -38,6 +38,9 @@ button[disabled] {
button[disabled]:hover { button[disabled]:hover {
background-color: initial; background-color: initial;
} }
button svg {
transition: transform 400ms;
}
.uem-logo-header { .uem-logo-header {
display: flex; display: flex;
@ -56,6 +59,18 @@ button.update-leaderboard {
align-items: center; align-items: center;
margin-bottom: 8px; margin-bottom: 8px;
} }
button.open-general-graph {
display: flex;
flex-direction: row;
gap: 4px;
align-items: center;
}
button.dropdown-open {
background-color: #1f2931;
}
button.dropdown-open svg {
transform: rotateX(180deg);
}
button.progress-button { button.progress-button {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
@ -81,6 +96,12 @@ button.button-updating svg {
to { transform: rotate(-360deg)} to { transform: rotate(-360deg)}
} }
.combined-charts-buttons {
display: flex;
flex-direction: row;
gap: 4px;
}
.leaderboard { .leaderboard {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="M480-357.85 253.85-584 296-626.15l184 184 184-184L706.15-584 480-357.85Z"/></svg>

After

Width:  |  Height:  |  Size: 197 B

Loading…
Cancel
Save