Compare commits
11 Commits
de751e1595
...
e8c788832c
Author | SHA1 | Date | |
---|---|---|---|
e8c788832c | |||
2d760cda16 | |||
2256fbfdf9 | |||
d5e684eb98 | |||
da9c3be1cd | |||
970a06cf9c | |||
39258f37fc | |||
2ae9a04aae | |||
91938efe35 | |||
b8e17331cc | |||
a41c6717c8 |
2
main.py
2
main.py
@ -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()
|
||||||
|
|
||||||
|
|
||||||
|
128
src/App.css
128
src/App.css
@ -1,5 +1,5 @@
|
|||||||
* {
|
* {
|
||||||
border-radius: 8px;
|
border-radius: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@ -7,15 +7,19 @@ 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%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
font-size: x-small;
|
||||||
|
}
|
||||||
|
|
||||||
#root {
|
#root {
|
||||||
max-width: 1280px;
|
max-width: 1280px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
text-align: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.grey {
|
.grey {
|
||||||
@ -25,6 +29,7 @@ body {
|
|||||||
.hint {
|
.hint {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
font-size: 80%;
|
font-size: 80%;
|
||||||
|
padding: 8px;
|
||||||
top: auto;
|
top: auto;
|
||||||
left: 4px;
|
left: 4px;
|
||||||
bottom: auto;
|
bottom: auto;
|
||||||
@ -33,16 +38,17 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
h1,
|
h1,
|
||||||
h2 {
|
h2,
|
||||||
|
h3 {
|
||||||
margin-top: 0px;
|
margin-top: 0px;
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
|
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: min(80vw, 800px);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dragbox {
|
.dragbox {
|
||||||
@ -52,6 +58,19 @@ h2 {
|
|||||||
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;
|
||||||
@ -59,28 +78,9 @@ h2 {
|
|||||||
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;
|
||||||
@ -92,27 +92,38 @@ h2 {
|
|||||||
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;
|
||||||
color: ghostwhite;
|
font-size: large;
|
||||||
|
color: aliceblue;
|
||||||
background-color: black;
|
background-color: black;
|
||||||
border: 4px solid black;
|
border-radius: 1.2em;
|
||||||
position: relative;
|
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
&:focus {
|
}
|
||||||
outline: black;
|
|
||||||
|
@media only screen and (max-width: 768px) {
|
||||||
|
.submit_text {
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
&:hover {
|
.submit {
|
||||||
border-color: black;
|
position: fixed;
|
||||||
|
right: 16px;
|
||||||
|
bottom: 16px;
|
||||||
|
padding: 0px;
|
||||||
|
background-color: unset;
|
||||||
|
font-size: xx-large;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,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) */
|
||||||
@ -154,6 +173,29 @@ button {
|
|||||||
font-size: 150%;
|
font-size: 150%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
position: relative;
|
||||||
|
text-align: center;
|
||||||
|
height: 160px;
|
||||||
|
img {
|
||||||
|
display: block;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
h3 {
|
||||||
|
position: absolute;
|
||||||
|
width: 200px;
|
||||||
|
top: 33%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
color: aliceblue;
|
||||||
|
background-color: black;
|
||||||
|
border-radius: unset;
|
||||||
|
letter-spacing: 8px;
|
||||||
|
padding: 0px 40px;
|
||||||
|
font-family: monospace;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.loader {
|
.loader {
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
21
src/App.tsx
21
src/App.tsx
@ -5,15 +5,24 @@ import Rankings from "./Rankings";
|
|||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<a href={baseUrl}>
|
<div className="logo">
|
||||||
<img alt="logo" height="128px" src="logo.svg" />
|
<a href={baseUrl}>
|
||||||
</a>
|
<img alt="logo" height="66%" src="logo.svg" />
|
||||||
<h1>cutt</h1>
|
</a>
|
||||||
<span className="grey">cool ultimate team tool</span>
|
<h3 className="centered">cutt</h3>
|
||||||
|
<span className="grey">cool ultimate team tool</span>
|
||||||
|
</div>
|
||||||
<Rankings />
|
<Rankings />
|
||||||
<footer>
|
<footer>
|
||||||
<p className="grey">
|
<p className="grey">
|
||||||
something not working? message <a href="https://t.me/x0124816">me</a>.
|
something not working?
|
||||||
|
<br />
|
||||||
|
message <a href="https://t.me/x0124816">me</a>.
|
||||||
|
<br />
|
||||||
|
or fix it here:{" "}
|
||||||
|
<a href="https://git.0124816.xyz/julius/cutt" key="gitea">
|
||||||
|
<img src="gitea.svg" alt="gitea" height="16" />
|
||||||
|
</a>
|
||||||
</p>
|
</p>
|
||||||
</footer>
|
</footer>
|
||||||
</>
|
</>
|
||||||
|
@ -40,9 +40,9 @@ export function SelectUser({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="box user">
|
<div className="box user">
|
||||||
<span>your name?</span>
|
|
||||||
{user.length < 1 ? (
|
{user.length < 1 ? (
|
||||||
<>
|
<>
|
||||||
|
<span>your name?</span>
|
||||||
<br /> <span className="grey hint">drag your name here</span>
|
<br /> <span className="grey hint">drag your name here</span>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
@ -55,7 +55,6 @@ export function SelectUser({
|
|||||||
>
|
>
|
||||||
{" ✕"}
|
{" ✕"}
|
||||||
</span>
|
</span>
|
||||||
<br />
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<PlayerList
|
<PlayerList
|
||||||
@ -175,7 +174,9 @@ export function Chemistry({ user, players }: PlayerInfoProps) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button onClick={() => handleSubmit()}>submit</button>
|
<button className="submit" onClick={() => handleSubmit()}>
|
||||||
|
💾 <span className="submit_text">submit</span>
|
||||||
|
</button>
|
||||||
<dialog
|
<dialog
|
||||||
id="ChemistryDialog"
|
id="ChemistryDialog"
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
@ -233,8 +234,8 @@ export function MVP({ user, players }: PlayerInfoProps) {
|
|||||||
<h1>🏆</h1>
|
<h1>🏆</h1>
|
||||||
{rankedPlayers.length < 1 && (
|
{rankedPlayers.length < 1 && (
|
||||||
<span className="grey hint">
|
<span className="grey hint">
|
||||||
carefully place the <i>Most Valuable Player</i> (according to your
|
carefully place as many of the <i>Most Valuable Players</i>{" "}
|
||||||
humble opinion) in this box
|
(according to your humble opinion) in this box
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
<PlayerList
|
<PlayerList
|
||||||
@ -252,7 +253,9 @@ export function MVP({ user, players }: PlayerInfoProps) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button onClick={() => handleSubmit()}>submit</button>
|
<button className="submit" onClick={() => handleSubmit()}>
|
||||||
|
💾 <span className="submit_text">submit</span>
|
||||||
|
</button>
|
||||||
<dialog
|
<dialog
|
||||||
id="MVPDialog"
|
id="MVPDialog"
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
@ -276,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";
|
||||||
@ -287,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -315,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 }} />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user