UI improvements
This commit is contained in:
parent
afb12b46df
commit
8a4f8ef3a4
35
src/App.css
35
src/App.css
@ -4,6 +4,7 @@ body {
|
|||||||
z-index: 0;
|
z-index: 0;
|
||||||
color: black;
|
color: black;
|
||||||
overflow-wrap: anywhere;
|
overflow-wrap: anywhere;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#root {
|
#root {
|
||||||
@ -19,6 +20,7 @@ body {
|
|||||||
|
|
||||||
.hint {
|
.hint {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
font-size: 80%;
|
||||||
top: auto;
|
top: auto;
|
||||||
left: 4px;
|
left: 4px;
|
||||||
bottom: auto;
|
bottom: auto;
|
||||||
@ -42,15 +44,18 @@ h2 {
|
|||||||
.dragbox {
|
.dragbox {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
flex-basis: 0;
|
|
||||||
flex-grow: 1;
|
|
||||||
min-height: 32px;
|
min-height: 32px;
|
||||||
height: 100%;
|
height: 92%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
&.two {
|
||||||
|
min-width: 48%;
|
||||||
|
}
|
||||||
|
&.three {
|
||||||
min-width: 30%;
|
min-width: 30%;
|
||||||
|
}
|
||||||
max-width: 10vw;
|
max-width: 10vw;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
margin: 4px min(2px, 4%);
|
margin: 4px min(2px, 4%);
|
||||||
@ -69,6 +74,7 @@ h2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
|
cursor: pointer;
|
||||||
font-size: small;
|
font-size: small;
|
||||||
border: 3px dashed black;
|
border: 3px dashed black;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
@ -81,6 +87,8 @@ button {
|
|||||||
color: ghostwhite;
|
color: ghostwhite;
|
||||||
background-color: black;
|
background-color: black;
|
||||||
border: 4px solid black;
|
border: 4px solid black;
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
::backdrop {
|
::backdrop {
|
||||||
@ -93,3 +101,24 @@ button {
|
|||||||
);
|
);
|
||||||
opacity: 0.75;
|
opacity: 0.75;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tablink {
|
||||||
|
background-color: unset;
|
||||||
|
font-weight: unset;
|
||||||
|
color: black;
|
||||||
|
border: 2px solid black;
|
||||||
|
border-radius: unset;
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 8px 16px;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tablink:hover {
|
||||||
|
background-color: #777;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Style the tab content (and add height:100% for full page content) */
|
||||||
|
.tabcontent {
|
||||||
|
display: none;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
49
src/App.tsx
49
src/App.tsx
@ -2,13 +2,62 @@ import "./App.css";
|
|||||||
import { Chemistry, MVP } from "./Rankings";
|
import { Chemistry, MVP } from "./Rankings";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
|
function openPage(pageName: string, color: string) {
|
||||||
|
// Hide all elements with class="tabcontent" by default */
|
||||||
|
var i, tabcontent, tablinks;
|
||||||
|
tabcontent = document.getElementsByClassName("tabcontent");
|
||||||
|
for (i = 0; i < tabcontent.length; i++) {
|
||||||
|
(tabcontent[i] as HTMLElement).style.display = "none";
|
||||||
|
}
|
||||||
|
// Remove the background color of all tablinks/buttons
|
||||||
|
tablinks = document.getElementsByClassName("tablink");
|
||||||
|
for (i = 0; i < tablinks.length; i++) {
|
||||||
|
let button = tablinks[i] as HTMLElement;
|
||||||
|
button.style.backgroundColor = "unset";
|
||||||
|
button.style.textDecoration = "unset";
|
||||||
|
button.style.fontWeight = "unset";
|
||||||
|
button.style.color = "unset";
|
||||||
|
}
|
||||||
|
// Show the specific tab content
|
||||||
|
(document.getElementById(pageName) as HTMLElement).style.display = "block";
|
||||||
|
// Add the specific color to the button used to open the tab content
|
||||||
|
let activeButton = document.getElementById(
|
||||||
|
pageName + "Button"
|
||||||
|
) as HTMLElement;
|
||||||
|
activeButton.style.textDecoration = "underline";
|
||||||
|
activeButton.style.fontWeight = "bold";
|
||||||
|
activeButton.style.backgroundColor = "#3366cc";
|
||||||
|
activeButton.style.color = "white";
|
||||||
|
document.body.style.backgroundColor = color;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<img alt="logo" height="128px" src="logo.svg" />
|
<img alt="logo" height="128px" src="logo.svg" />
|
||||||
<h1>cutt</h1>
|
<h1>cutt</h1>
|
||||||
<span className="grey">cool ultimate team tool</span>
|
<span className="grey">cool ultimate team tool</span>
|
||||||
|
<div className="container">
|
||||||
|
<button
|
||||||
|
className="tablink"
|
||||||
|
id="ChemistryButton"
|
||||||
|
onClick={() => openPage("Chemistry", "aliceblue")}
|
||||||
|
>
|
||||||
|
Chemistry
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className="tablink"
|
||||||
|
id="MVPButton"
|
||||||
|
onClick={() => openPage("MVP", "aliceblue")}
|
||||||
|
>
|
||||||
|
MVP
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="Chemistry" className="tabcontent">
|
||||||
<Chemistry />
|
<Chemistry />
|
||||||
|
</div>
|
||||||
|
<div id="MVP" className="tabcontent">
|
||||||
<MVP />
|
<MVP />
|
||||||
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<p className="grey">
|
<p className="grey">
|
||||||
something not working? message <a href="https://t.me/x0124816">me</a>.
|
something not working? message <a href="https://t.me/x0124816">me</a>.
|
||||||
|
@ -104,7 +104,7 @@ export function Chemistry() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<div className="box">
|
<div className="box three">
|
||||||
<h2>😬</h2>
|
<h2>😬</h2>
|
||||||
{playersLeft.length < 1 && (
|
{playersLeft.length < 1 && (
|
||||||
<span className="grey hint">
|
<span className="grey hint">
|
||||||
@ -120,7 +120,7 @@ export function Chemistry() {
|
|||||||
orderedList
|
orderedList
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="box">
|
<div className="box three">
|
||||||
<h2>🤷</h2>
|
<h2>🤷</h2>
|
||||||
<PlayerList
|
<PlayerList
|
||||||
list={playersMiddle}
|
list={playersMiddle}
|
||||||
@ -129,7 +129,7 @@ export function Chemistry() {
|
|||||||
className="middle dragbox"
|
className="middle dragbox"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="box">
|
<div className="box three">
|
||||||
<h2>😍</h2>
|
<h2>😍</h2>
|
||||||
{playersRight.length < 1 && (
|
{playersRight.length < 1 && (
|
||||||
<span className="grey hint">
|
<span className="grey hint">
|
||||||
@ -216,8 +216,8 @@ export function MVP() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<div className="box">
|
<div className="box two">
|
||||||
<h1>🥏🏃</h1>
|
<h2>🥏🏃</h2>
|
||||||
{availablePlayers.length < 1 && (
|
{availablePlayers.length < 1 && (
|
||||||
<span className="grey hint">all sorted 👍</span>
|
<span className="grey hint">all sorted 👍</span>
|
||||||
)}
|
)}
|
||||||
@ -230,18 +230,15 @@ export function MVP() {
|
|||||||
return to.el.classList.contains("putclone") ? "clone" : true;
|
return to.el.classList.contains("putclone") ? "clone" : true;
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
className="dragbox reservoir"
|
className="dragbox"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="box">
|
<div className="box two">
|
||||||
<h1>🏆</h1>
|
<h1>🏆</h1>
|
||||||
{rankedPlayers.length < 1 && (
|
{rankedPlayers.length < 1 && (
|
||||||
<span className="grey hint">
|
<span className="grey hint">
|
||||||
carefully place the{" "}
|
carefully place the <i>Most Valuable Player</i> (according to your
|
||||||
<b>
|
humble opinion) in this box
|
||||||
<i>Most Valued Player</i>
|
|
||||||
</b>{" "}
|
|
||||||
(according to your humble opinion) in this box
|
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
<PlayerList
|
<PlayerList
|
||||||
|
Loading…
x
Reference in New Issue
Block a user