4 Commits

Author SHA1 Message Date
e8c788832c feat: order players by name 2025-01-29 15:11:43 +01:00
2d760cda16 feat: revamp a little 2025-01-29 15:04:07 +01:00
2256fbfdf9 feat: make chemistry and MVP buttons more button-like 2025-01-29 12:06:31 +01:00
d5e684eb98 make buttons/clickables round 2025-01-28 18:31:38 +01:00
3 changed files with 61 additions and 73 deletions

View File

@@ -46,7 +46,7 @@ def add_players(players: list[Player]):
def list_players(): def list_players():
with Session(engine) as session: with Session(engine) as session:
statement = select(Player) statement = select(Player).order_by(Player.name)
return session.exec(statement).fetchall() return session.exec(statement).fetchall()

View File

@@ -1,5 +1,5 @@
* { * {
border-radius: 8px; border-radius: 16px;
} }
body { body {
@@ -7,6 +7,7 @@ body {
position: relative; position: relative;
z-index: 0; z-index: 0;
color: black; color: black;
text-align: center;
overflow-wrap: anywhere; overflow-wrap: anywhere;
height: 100%; height: 100%;
} }
@@ -19,7 +20,6 @@ footer {
max-width: 1280px; max-width: 1280px;
margin: 0 auto; margin: 0 auto;
padding: 8px; padding: 8px;
text-align: center;
} }
.grey { .grey {
@@ -29,7 +29,7 @@ footer {
.hint { .hint {
position: absolute; position: absolute;
font-size: 80%; font-size: 80%;
padding: 4px; padding: 8px;
top: auto; top: auto;
left: 4px; left: 4px;
bottom: auto; bottom: auto;
@@ -42,14 +42,13 @@ h2,
h3 { h3 {
margin-top: 0px; margin-top: 0px;
margin-bottom: 0px; margin-bottom: 0px;
padding: 4px 16px; padding: 8px 16px;
} }
.container { .container {
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
justify-content: space-evenly; width: min(96vw, 900px);
min-width: 737px;
} }
.dragbox { .dragbox {
@@ -59,6 +58,19 @@ h3 {
height: 92%; height: 92%;
} }
.box {
position: relative;
flex: 1;
&.one {
max-width: min(96%, 768px);
margin: 4px auto;
}
padding: 4px;
margin: 4px 0.5%;
border-style: solid;
border-color: black;
}
.reservoir { .reservoir {
flex-direction: unset; flex-direction: unset;
flex-wrap: wrap; flex-wrap: wrap;
@@ -66,28 +78,9 @@ h3 {
width: 100%; width: 100%;
} }
.box {
position: relative;
&.one {
max-width: min(80vw, 500px);
}
&.two {
min-width: 43%;
max-width: 20vw;
}
&.three {
min-width: 27%;
max-width: 10vw;
}
padding: 4px;
margin: 4px auto;
border-style: solid;
border-color: black;
}
.user { .user {
max-width: 400px; max-width: 240px;
min-width: 200px; min-width: 100px;
margin: 4px auto; margin: 4px auto;
.item { .item {
font-weight: bold; font-weight: bold;
@@ -99,33 +92,26 @@ h3 {
cursor: pointer; cursor: pointer;
font-size: small; font-size: small;
border: 3px dashed black; border: 3px dashed black;
border-radius: 4px; border-radius: 1.2em;
margin: 8px auto; margin: 8px auto;
padding: 4px 8px; padding: 4px 16px;
} }
.extra-margin { .extra-margin {
padding: 0px 8px; padding: 0px 8px;
margin: auto;
} }
button { button {
font-weight: bold; font-weight: bold;
font-size: large; font-size: large;
color: ghostwhite; color: aliceblue;
background-color: black; background-color: black;
border-radius: 1.2em;
z-index: 1; z-index: 1;
&:focus {
outline: black;
}
&:hover {
border-color: black;
}
} }
@media only screen and (max-width: 768px) { @media only screen and (max-width: 768px) {
.container {
min-width: 96vw;
}
.submit_text { .submit_text {
display: none; display: none;
} }
@@ -153,15 +139,23 @@ button {
} }
.tablink { .tablink {
background-color: unset; color: white;
font-weight: unset;
color: black;
border: 2px solid black;
border-radius: unset;
outline: black;
cursor: pointer; cursor: pointer;
padding: 8px 16px; flex: 1;
width: 50%; margin: 4px auto;
}
.navbar {
button {
font-size: medium;
margin: 4px 0.5%;
padding-top: 4px;
padding-bottom: 4px;
opacity: 50%;
&:hover {
opacity: 75%;
}
}
} }
/* Style the tab content (and add height:100% for full page content) */ /* Style the tab content (and add height:100% for full page content) */
@@ -182,8 +176,7 @@ button {
.logo { .logo {
position: relative; position: relative;
text-align: center; text-align: center;
height: 196px; height: 160px;
margin: auto;
img { img {
display: block; display: block;
margin: auto; margin: auto;

View File

@@ -279,10 +279,7 @@ function openPage(pageName: string, color: string) {
tablinks = document.getElementsByClassName("tablink"); tablinks = document.getElementsByClassName("tablink");
for (i = 0; i < tablinks.length; i++) { for (i = 0; i < tablinks.length; i++) {
let button = tablinks[i] as HTMLElement; let button = tablinks[i] as HTMLElement;
button.style.backgroundColor = "unset"; button.style.opacity = "50%";
button.style.textDecoration = "unset";
button.style.fontWeight = "unset";
button.style.color = "unset";
} }
// Show the specific tab content // Show the specific tab content
(document.getElementById(pageName) as HTMLElement).style.display = "block"; (document.getElementById(pageName) as HTMLElement).style.display = "block";
@@ -290,10 +287,8 @@ function openPage(pageName: string, color: string) {
let activeButton = document.getElementById( let activeButton = document.getElementById(
pageName + "Button" pageName + "Button"
) as HTMLElement; ) as HTMLElement;
activeButton.style.textDecoration = "underline";
activeButton.style.fontWeight = "bold"; activeButton.style.fontWeight = "bold";
activeButton.style.backgroundColor = "#3366cc"; activeButton.style.opacity = "100%";
activeButton.style.color = "white";
document.body.style.backgroundColor = color; document.body.style.backgroundColor = color;
} }
@@ -318,22 +313,22 @@ export default function Rankings() {
<SelectUser {...{ user, setUser, players, setPlayers }} /> <SelectUser {...{ user, setUser, players, setPlayers }} />
{user.length === 1 && ( {user.length === 1 && (
<> <>
<div className="container"> <div className="container navbar">
<button <button
className="tablink" className="tablink"
id="ChemistryButton" id="ChemistryButton"
onClick={() => openPage("Chemistry", "aliceblue")} onClick={() => openPage("Chemistry", "aliceblue")}
> >
Chemistry 🧪 Chemistry
</button> </button>
<button <button
className="tablink" className="tablink"
id="MVPButton" id="MVPButton"
onClick={() => openPage("MVP", "aliceblue")} onClick={() => openPage("MVP", "aliceblue")}
> >
MVP 🏆 MVP
</button> </button>
</div> </div>
<div id="Chemistry" className="tabcontent"> <div id="Chemistry" className="tabcontent">
<Chemistry {...{ user, players }} /> <Chemistry {...{ user, players }} />