Better mobile + desktop styling (untested)
This commit is contained in:
2 files changed
+40
-7
No files matched your search
+32
-4
@@ -44,20 +44,21 @@ button:active {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list {
|
.mobile .list {
|
||||||
background-color: #484848;
|
background-color: #484848;
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
padding: 16px 0px;
|
padding: 16px 0px;
|
||||||
|
margin-top: 4rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list .item {
|
.mobile .list .item {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 0 16px;
|
padding: 0 16px;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list .item + .item::before {
|
.mobile .list .item + .item::before {
|
||||||
content: "";
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -16px;
|
top: -16px;
|
||||||
@@ -67,6 +68,33 @@ button:active {
|
|||||||
background-color: rgb(128, 128, 128);
|
background-color: rgb(128, 128, 128);
|
||||||
}
|
}
|
||||||
|
|
||||||
.list .item + .item {
|
.mobile .list .item + .item {
|
||||||
margin-top: 32px;
|
margin-top: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.desktop .list {
|
||||||
|
font-size: 16px;
|
||||||
|
border-radius: 16px;
|
||||||
|
margin-top: 4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.desktop .list .item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0 16px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.desktop .list .item + .item::before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: -8px;
|
||||||
|
left: 8px;
|
||||||
|
right: 8px;
|
||||||
|
height: 1px;
|
||||||
|
background-color: rgb(128, 128, 128);
|
||||||
|
}
|
||||||
|
|
||||||
|
.desktop .list .item + .item {
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
+8
-3
@@ -1,6 +1,6 @@
|
|||||||
import { useEffect, useRef, useState } from "react"
|
import { useEffect, useRef, useState } from "react"
|
||||||
import "./App.css"
|
import "./App.css"
|
||||||
import '@fontsource/lexend'
|
import "@fontsource/lexend"
|
||||||
import { platform } from "@tauri-apps/plugin-os"
|
import { platform } from "@tauri-apps/plugin-os"
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
@@ -10,7 +10,12 @@ function App() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (initialized.current) return;
|
if (initialized.current) return;
|
||||||
if (platform() == 'macos') document.body.classList.add('macos-body')
|
if (platform() == "macos") document.body.classList.add("macos-body");
|
||||||
|
if (platform() == "ios" || platform() == "android") {
|
||||||
|
document.body.classList.add("mobile");
|
||||||
|
} else {
|
||||||
|
document.body.classList.add("desktop");
|
||||||
|
}
|
||||||
refresh();
|
refresh();
|
||||||
initialized.current = true;
|
initialized.current = true;
|
||||||
}, [])
|
}, [])
|
||||||
@@ -44,7 +49,7 @@ function App() {
|
|||||||
{players.map(([user, score], i) => (
|
{players.map(([user, score], i) => (
|
||||||
<div className="item" key={i}>
|
<div className="item" key={i}>
|
||||||
<span>{user}</span>
|
<span>{user}</span>
|
||||||
<span>{Number(score).toLocaleString()}</span>
|
<span style={{ fontWeight: "bold" }}>{Number(score).toLocaleString()}</span>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in new issue
Block a user