Rearranged statistics page

This commit is contained in:
W13R 2022-05-24 20:49:18 +02:00
parent 95d37dbc3d
commit 9f965b8119
3 changed files with 8 additions and 86 deletions

View file

@ -1,24 +1,21 @@
.mainContainer {
min-width: 70vw;
display: flex;
flex-direction: column;
align-items: center;
justify-content: start;
width: 100%;
flex-grow: 1;
}
.statsHeading {
min-width: max-content;
margin-left: 2rem;
margin-top: 0;
}
.tablesContainer {
position: absolute;
display: flex;
flex-direction: column;
align-items: center;
justify-content: start;
width: 95%;
margin-top: 5rem;
margin-top: 2rem;
}
.statisticsTable {
margin-bottom: 2rem;
@ -46,9 +43,6 @@
.statisticsTable td:last-child {
text-align: right;
}
#statisticsDropDownMenu .dropDownList {
z-index: 195;
}
@media only screen and (max-width: 700px) {
.statisticsTable h1 {
min-width: 90vw;

View file

@ -1,42 +0,0 @@
{
let statistics_dropdown_choices;
let statistics_tables;
let dropDownMenuActive = false;
document.addEventListener("DOMContentLoaded", () => {
// elements
let statistics_dropdown_menu = document.getElementById("statisticsDropDownMenu");
let statistics_dropdown_menu_button = document.getElementById("statisticsDropDownMenuButton");
statistics_dropdown_choices = [...statistics_dropdown_menu.getElementsByClassName("sChoice")];
statistics_tables = [...document.getElementsByClassName("statisticsTable")];
statistics_dropdown_menu_button.addEventListener("click", () => {
if (statistics_dropdown_menu.classList.contains("dropDownVisible")) {
statistics_dropdown_menu.classList.remove("dropDownVisible");
}
else {
statistics_dropdown_menu.classList.add("dropDownVisible");
}
})
statistics_dropdown_choices.forEach(element => {
element.addEventListener("click", () => {
changeStatisticsChoice(element.innerText, element.dataset.statistics_div);
})
})
})
function changeStatisticsChoice(choice_name, div_id) {
statistics_tables.forEach(element => {
element.classList.add("nodisplay");
})
document.getElementById(div_id).classList.remove("nodisplay");
}
}