merge index.css into main.css, unify form styles
This commit is contained in:
parent
6d854eb4a7
commit
aa1865d734
@ -1,92 +0,0 @@
|
||||
[
|
||||
{
|
||||
"name": "Switzerland",
|
||||
"hint": "Alpine country in Central Europe",
|
||||
"cities": [
|
||||
{ "name": "Bern", "x": 48, "y": 58 },
|
||||
{ "name": "Zürich", "x": 58, "y": 38 },
|
||||
{ "name": "Geneva", "x": 22, "y": 72 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Norway",
|
||||
"hint": "Scandinavian country with long coastline",
|
||||
"cities": [
|
||||
{ "name": "Oslo", "x": 55, "y": 72 },
|
||||
{ "name": "Bergen", "x": 32, "y": 60 },
|
||||
{ "name": "Tromsø", "x": 62, "y": 18 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Italy",
|
||||
"hint": "Boot-shaped peninsula in Southern Europe",
|
||||
"cities": [
|
||||
{ "name": "Rome", "x": 52, "y": 58 },
|
||||
{ "name": "Milan", "x": 42, "y": 22 },
|
||||
{ "name": "Naples", "x": 58, "y": 72 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Japan",
|
||||
"hint": "Island nation in East Asia",
|
||||
"cities": [
|
||||
{ "name": "Tokyo", "x": 72, "y": 48 },
|
||||
{ "name": "Osaka", "x": 58, "y": 58 },
|
||||
{ "name": "Sapporo", "x": 70, "y": 22 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Brazil",
|
||||
"hint": "Largest country in South America",
|
||||
"cities": [
|
||||
{ "name": "Brasília", "x": 58, "y": 52 },
|
||||
{ "name": "São Paulo", "x": 60, "y": 68 },
|
||||
{ "name": "Manaus", "x": 38, "y": 38 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Australia",
|
||||
"hint": "Continent and country in the Southern Hemisphere",
|
||||
"cities": [
|
||||
{ "name": "Canberra", "x": 72, "y": 72 },
|
||||
{ "name": "Sydney", "x": 78, "y": 68 },
|
||||
{ "name": "Perth", "x": 22, "y": 65 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "France",
|
||||
"hint": "Country in Western Europe, hexagonal shape",
|
||||
"cities": [
|
||||
{ "name": "Paris", "x": 50, "y": 32 },
|
||||
{ "name": "Lyon", "x": 58, "y": 55 },
|
||||
{ "name": "Marseille", "x": 58, "y": 72 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "India",
|
||||
"hint": "Large peninsula in South Asia",
|
||||
"cities": [
|
||||
{ "name": "New Delhi", "x": 46, "y": 28 },
|
||||
{ "name": "Mumbai", "x": 32, "y": 55 },
|
||||
{ "name": "Chennai", "x": 52, "y": 72 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Canada",
|
||||
"hint": "Second largest country in the world",
|
||||
"cities": [
|
||||
{ "name": "Ottawa", "x": 62, "y": 52 },
|
||||
{ "name": "Vancouver", "x": 22, "y": 55 },
|
||||
{ "name": "Toronto", "x": 60, "y": 58 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Germany",
|
||||
"hint": "Central European country",
|
||||
"cities": [
|
||||
{ "name": "Berlin", "x": 58, "y": 28 },
|
||||
{ "name": "Munich", "x": 48, "y": 68 },
|
||||
{ "name": "Hamburg", "x": 42, "y": 18 }
|
||||
]
|
||||
}
|
||||
]
|
||||
@ -4,9 +4,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>GeoDraw</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Syne:wght@400;500;700;800&family=DM+Sans:wght@300;400;500&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="styles/main.css" />
|
||||
<link rel="stylesheet" href="styles/index.css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<title>GeoDraw — Leaderboard</title>
|
||||
<link rel="stylesheet" href="./styles/main.css" />
|
||||
<link rel="stylesheet" href="./styles/leader.css" />
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
@ -87,68 +87,6 @@
|
||||
</div>
|
||||
|
||||
<script src="scripts/storage.js"></script>
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const currentPlayer = Storage.getPlayerName();
|
||||
const body = document.getElementById("lb-body");
|
||||
|
||||
function render() {
|
||||
const board = Storage.getLeaderboard();
|
||||
body.innerHTML = "";
|
||||
|
||||
if (!board.length) {
|
||||
body.innerHTML = `
|
||||
<div class="lb-empty">
|
||||
<div class="lb-empty__icon">🏁</div>
|
||||
<p class="lb-empty__text">No games played yet. Be the first on the board!</p>
|
||||
<a href="lobby.html" class="btn btn--primary btn--sm">Play now →</a>
|
||||
</div>`;
|
||||
return;
|
||||
}
|
||||
|
||||
const medals = ["🥇","🥈","🥉"];
|
||||
const scoreClasses = ["gold","silver","bronze"];
|
||||
|
||||
board.forEach((entry, i) => {
|
||||
const rank = i + 1;
|
||||
const isYou = entry.name === currentPlayer;
|
||||
const date = entry.date
|
||||
? new Date(entry.date).toLocaleDateString("en-CH", { day:"2-digit", month:"short" })
|
||||
: "—";
|
||||
const rounds = (entry.scores || []).join(" · ") || "—";
|
||||
|
||||
const row = document.createElement("div");
|
||||
row.className = `lb-row${rank <= 3 ? ` rank-${rank}` : ""}`;
|
||||
row.style.animationDelay = `${i * 0.05}s`;
|
||||
|
||||
row.innerHTML = `
|
||||
<span class="lb-rank">${rank <= 3 ? `<span class="lb-medal">${medals[rank-1]}</span>` : rank}</span>
|
||||
<span class="lb-name${isYou ? " is-you" : ""}">${escHtml(entry.name)}</span>
|
||||
<span class="lb-rounds hide-sm">${escHtml(rounds)}</span>
|
||||
<span class="lb-date hide-sm">${date}</span>
|
||||
<span class="lb-score${rank <= 3 ? " " + scoreClasses[rank-1] : ""}">${entry.totalScore}</span>
|
||||
`;
|
||||
body.appendChild(row);
|
||||
});
|
||||
|
||||
// Your latest score bar
|
||||
const latest = board.find(e => e.name === currentPlayer);
|
||||
if (latest) {
|
||||
document.getElementById("your-bar").style.display = "flex";
|
||||
document.getElementById("your-bar-name").textContent = latest.name;
|
||||
document.getElementById("your-bar-score").textContent = latest.totalScore;
|
||||
}
|
||||
}
|
||||
|
||||
function escHtml(str) {
|
||||
return String(str)
|
||||
.replace(/&/g,"&")
|
||||
.replace(/</g,"<")
|
||||
.replace(/>/g,">");
|
||||
}
|
||||
|
||||
render();
|
||||
});
|
||||
</script>
|
||||
<script src="scripts/leaderboard.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -5,200 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>GeoDraw — Results</title>
|
||||
<link rel="stylesheet" href="styles/main.css" />
|
||||
<style>
|
||||
.results-page {
|
||||
min-height: calc(100vh - var(--hh));
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 60px 0;
|
||||
}
|
||||
|
||||
.results-inner {
|
||||
width: 100%;
|
||||
max-width: 680px;
|
||||
display: grid;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.results-header {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.results-emoji {
|
||||
font-size: 3.5rem;
|
||||
margin-bottom: 16px;
|
||||
display: block;
|
||||
animation: popIn .5s cubic-bezier(.34,1.56,.64,1) both;
|
||||
}
|
||||
|
||||
@keyframes popIn {
|
||||
from { transform: scale(0); opacity: 0; }
|
||||
to { transform: scale(1); opacity: 1; }
|
||||
}
|
||||
|
||||
.results-title {
|
||||
font-family: 'Syne', sans-serif;
|
||||
font-weight: 800;
|
||||
font-size: clamp(2rem, 5vw, 3.4rem);
|
||||
letter-spacing: -.03em;
|
||||
line-height: 1.05;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.results-player {
|
||||
font-size: 1rem;
|
||||
color: var(--ink-soft);
|
||||
}
|
||||
|
||||
.results-player strong { color: var(--ink); }
|
||||
|
||||
/* Total score */
|
||||
.score-total-card {
|
||||
background: linear-gradient(135deg, var(--sea) 0%, #159fd4 50%, var(--leaf) 100%);
|
||||
border-radius: var(--r-xl);
|
||||
padding: 36px 40px;
|
||||
text-align: center;
|
||||
color: var(--white);
|
||||
box-shadow: 0 16px 40px rgba(26,127,196,.3);
|
||||
animation: slideUp .5s .1s cubic-bezier(.34,1.56,.64,1) both;
|
||||
}
|
||||
|
||||
@keyframes slideUp {
|
||||
from { transform: translateY(30px); opacity: 0; }
|
||||
to { transform: translateY(0); opacity: 1; }
|
||||
}
|
||||
|
||||
.score-total-label {
|
||||
font-size: .78rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: .1em;
|
||||
text-transform: uppercase;
|
||||
opacity: .78;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.score-total-num {
|
||||
font-family: 'Syne', sans-serif;
|
||||
font-weight: 800;
|
||||
font-size: clamp(4rem, 10vw, 6rem);
|
||||
line-height: 1;
|
||||
letter-spacing: -.04em;
|
||||
}
|
||||
|
||||
.score-total-max {
|
||||
font-size: 1.4rem;
|
||||
opacity: .6;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.score-grade {
|
||||
display: inline-block;
|
||||
margin-top: 12px;
|
||||
padding: 4px 18px;
|
||||
border-radius: 999px;
|
||||
background: rgba(255,255,255,.22);
|
||||
font-family: 'Syne', sans-serif;
|
||||
font-weight: 800;
|
||||
font-size: 1.1rem;
|
||||
letter-spacing: .04em;
|
||||
}
|
||||
|
||||
/* Round breakdown */
|
||||
.rounds-card {
|
||||
background: var(--white);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--r-xl);
|
||||
padding: 28px 32px;
|
||||
box-shadow: var(--shadow-sm);
|
||||
animation: slideUp .5s .2s cubic-bezier(.34,1.56,.64,1) both;
|
||||
}
|
||||
|
||||
.rounds-card-title {
|
||||
font-family: 'Syne', sans-serif;
|
||||
font-weight: 700;
|
||||
font-size: 1rem;
|
||||
letter-spacing: -.01em;
|
||||
margin-bottom: 20px;
|
||||
color: var(--ink-soft);
|
||||
}
|
||||
|
||||
.round-rows { display: grid; gap: 14px; }
|
||||
|
||||
.round-row {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr auto;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.round-row__label {
|
||||
font-size: .82rem;
|
||||
font-weight: 600;
|
||||
color: var(--ink-soft);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.round-row__bar-wrap {
|
||||
height: 8px;
|
||||
background: var(--cream);
|
||||
border-radius: 999px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.round-row__bar {
|
||||
height: 100%;
|
||||
border-radius: 999px;
|
||||
background: linear-gradient(90deg, var(--sea), var(--leaf));
|
||||
transition: width .8s cubic-bezier(.34,1.56,.64,1);
|
||||
}
|
||||
|
||||
.round-row__score {
|
||||
font-family: 'Syne', sans-serif;
|
||||
font-weight: 800;
|
||||
font-size: .9rem;
|
||||
color: var(--sea);
|
||||
min-width: 36px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* Country list */
|
||||
.countries-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.country-tag {
|
||||
padding: 5px 12px;
|
||||
border-radius: 999px;
|
||||
background: var(--sea-dim);
|
||||
color: var(--sea);
|
||||
font-size: .8rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Actions */
|
||||
.results-actions {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
animation: slideUp .5s .3s cubic-bezier(.34,1.56,.64,1) both;
|
||||
}
|
||||
|
||||
.results-actions .btn { flex: 1 1 180px; }
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.results-page { padding: 40px 0; }
|
||||
.score-total-card { padding: 28px 24px; }
|
||||
.rounds-card { padding: 22px 20px; }
|
||||
.results-actions .btn { flex-basis: 100%; }
|
||||
}
|
||||
|
||||
@media (max-width: 360px) {
|
||||
.score-total-num { font-size: 3.4rem; }
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="styles/results.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
@ -288,69 +95,6 @@
|
||||
|
||||
<script src="scripts/storage.js"></script>
|
||||
<script src="scripts/scoring.js"></script>
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const state = Storage.getGameState();
|
||||
const name = Storage.getPlayerName();
|
||||
|
||||
document.getElementById("results-player").textContent = name;
|
||||
|
||||
if (!state) {
|
||||
document.getElementById("results-title").textContent = "No game found.";
|
||||
document.getElementById("total-score").textContent = "—";
|
||||
return;
|
||||
}
|
||||
|
||||
const { scores, totalScore, countries } = state;
|
||||
|
||||
// Emoji + title based on score
|
||||
const avg = totalScore / 3;
|
||||
let emoji = "🌍", title = "Not bad!";
|
||||
if (avg >= 85) { emoji = "🔥"; title = "Incredible!"; }
|
||||
else if (avg >= 70) { emoji = "🎉"; title = "Well done!"; }
|
||||
else if (avg >= 50) { emoji = "👏"; title = "Good effort!"; }
|
||||
else { emoji = "😅"; title = "Keep practising!"; }
|
||||
|
||||
document.getElementById("results-emoji").textContent = emoji;
|
||||
document.getElementById("results-title").textContent = title;
|
||||
document.getElementById("total-score").textContent = totalScore;
|
||||
|
||||
// Grade
|
||||
const grade = Scoring.getGrade(avg);
|
||||
const gradeEl = document.getElementById("total-grade");
|
||||
gradeEl.textContent = `Grade ${grade.label}`;
|
||||
|
||||
// Round rows
|
||||
const rowsContainer = document.getElementById("round-rows");
|
||||
(scores || []).forEach((s, i) => {
|
||||
const row = document.createElement("div");
|
||||
row.className = "round-row";
|
||||
row.innerHTML = `
|
||||
<span class="round-row__label">Round ${i + 1}</span>
|
||||
<div class="round-row__bar-wrap">
|
||||
<div class="round-row__bar" style="width:0%" data-target="${s}"></div>
|
||||
</div>
|
||||
<span class="round-row__score">${s}%</span>
|
||||
`;
|
||||
rowsContainer.appendChild(row);
|
||||
});
|
||||
|
||||
// Animate bars
|
||||
requestAnimationFrame(() => {
|
||||
document.querySelectorAll(".round-row__bar").forEach(bar => {
|
||||
bar.style.width = bar.dataset.target + "%";
|
||||
});
|
||||
});
|
||||
|
||||
// Country tags
|
||||
const tagsContainer = document.getElementById("countries-row");
|
||||
(countries || []).forEach(c => {
|
||||
const tag = document.createElement("span");
|
||||
tag.className = "country-tag";
|
||||
tag.textContent = c;
|
||||
tagsContainer.appendChild(tag);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script src="scripts/results.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
69
frontend/scripts/leaderboard.js
Normal file
69
frontend/scripts/leaderboard.js
Normal file
@ -0,0 +1,69 @@
|
||||
// leaderboard.js — leaderboard page logic
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const currentPlayer = Storage.getPlayerName();
|
||||
const body = document.getElementById("lb-body");
|
||||
|
||||
/**
|
||||
* Escape HTML special characters to prevent XSS.
|
||||
* @param {string} str - Raw user-provided string.
|
||||
* @returns {string} HTML-safe string.
|
||||
*/
|
||||
function escHtml(str) {
|
||||
return String(str)
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">");
|
||||
}
|
||||
|
||||
/** Render the leaderboard from localStorage data. */
|
||||
function render() {
|
||||
const board = Storage.getLeaderboard();
|
||||
body.innerHTML = "";
|
||||
|
||||
if (!board.length) {
|
||||
body.innerHTML = `
|
||||
<div class="lb-empty">
|
||||
<div class="lb-empty__icon">🏁</div>
|
||||
<p class="lb-empty__text">No games played yet. Be the first on the board!</p>
|
||||
<a href="lobby.html" class="btn btn--primary btn--sm">Play now →</a>
|
||||
</div>`;
|
||||
return;
|
||||
}
|
||||
|
||||
const medals = ["🥇", "🥈", "🥉"];
|
||||
const scoreClasses = ["gold", "silver", "bronze"];
|
||||
|
||||
board.forEach((entry, index) => {
|
||||
const rank = index + 1;
|
||||
const isYou = entry.name === currentPlayer;
|
||||
const date = entry.date
|
||||
? new Date(entry.date).toLocaleDateString("en-CH", { day: "2-digit", month: "short" })
|
||||
: "—";
|
||||
const rounds = (entry.scores || []).join(" · ") || "—";
|
||||
|
||||
const row = document.createElement("div");
|
||||
row.className = `lb-row${rank <= 3 ? ` rank-${rank}` : ""}`;
|
||||
row.style.animationDelay = `${index * 0.05}s`;
|
||||
|
||||
row.innerHTML = `
|
||||
<span class="lb-rank">${rank <= 3 ? `<span class="lb-medal">${medals[rank - 1]}</span>` : rank}</span>
|
||||
<span class="lb-name${isYou ? " is-you" : ""}">${escHtml(entry.name)}</span>
|
||||
<span class="lb-rounds hide-sm">${escHtml(rounds)}</span>
|
||||
<span class="lb-date hide-sm">${date}</span>
|
||||
<span class="lb-score${rank <= 3 ? ` ${scoreClasses[rank - 1]}` : ""}">${entry.totalScore}</span>
|
||||
`;
|
||||
body.appendChild(row);
|
||||
});
|
||||
|
||||
// Show the current player's latest score bar
|
||||
const latest = board.find((entry) => entry.name === currentPlayer);
|
||||
if (latest) {
|
||||
document.getElementById("your-bar").style.display = "flex";
|
||||
document.getElementById("your-bar-name").textContent = latest.name;
|
||||
document.getElementById("your-bar-score").textContent = latest.totalScore;
|
||||
}
|
||||
}
|
||||
|
||||
render();
|
||||
});
|
||||
65
frontend/scripts/results.js
Normal file
65
frontend/scripts/results.js
Normal file
@ -0,0 +1,65 @@
|
||||
// results.js — results page logic
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const state = Storage.getGameState();
|
||||
const name = Storage.getPlayerName();
|
||||
|
||||
document.getElementById("results-player").textContent = name;
|
||||
|
||||
if (!state) {
|
||||
document.getElementById("results-title").textContent = "No game found.";
|
||||
document.getElementById("total-score").textContent = "—";
|
||||
return;
|
||||
}
|
||||
|
||||
const { scores, totalScore, countries } = state;
|
||||
|
||||
// Determine emoji and title based on average score
|
||||
const avg = totalScore / 3;
|
||||
let emoji = "🌍";
|
||||
let title = "Not bad!";
|
||||
if (avg >= 85) { emoji = "🔥"; title = "Incredible!"; }
|
||||
else if (avg >= 70) { emoji = "🎉"; title = "Well done!"; }
|
||||
else if (avg >= 50) { emoji = "👏"; title = "Good effort!"; }
|
||||
else { emoji = "😅"; title = "Keep practising!"; }
|
||||
|
||||
document.getElementById("results-emoji").textContent = emoji;
|
||||
document.getElementById("results-title").textContent = title;
|
||||
document.getElementById("total-score").textContent = totalScore;
|
||||
|
||||
// Grade badge
|
||||
const grade = Scoring.getGrade(avg);
|
||||
const gradeEl = document.getElementById("total-grade");
|
||||
gradeEl.textContent = `Grade ${grade.label}`;
|
||||
|
||||
// Round breakdown rows
|
||||
const rowsContainer = document.getElementById("round-rows");
|
||||
(scores || []).forEach((score, index) => {
|
||||
const row = document.createElement("div");
|
||||
row.className = "round-row";
|
||||
row.innerHTML = `
|
||||
<span class="round-row__label">Round ${index + 1}</span>
|
||||
<div class="round-row__bar-wrap">
|
||||
<div class="round-row__bar" style="width:0%" data-target="${score}"></div>
|
||||
</div>
|
||||
<span class="round-row__score">${score}%</span>
|
||||
`;
|
||||
rowsContainer.appendChild(row);
|
||||
});
|
||||
|
||||
// Animate score bars on next frame so CSS transition fires
|
||||
requestAnimationFrame(() => {
|
||||
document.querySelectorAll(".round-row__bar").forEach((bar) => {
|
||||
bar.style.width = `${bar.dataset.target}%`;
|
||||
});
|
||||
});
|
||||
|
||||
// Country tags
|
||||
const tagsContainer = document.getElementById("countries-row");
|
||||
(countries || []).forEach((country) => {
|
||||
const tag = document.createElement("span");
|
||||
tag.className = "country-tag";
|
||||
tag.textContent = country;
|
||||
tagsContainer.appendChild(tag);
|
||||
});
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,196 +1,193 @@
|
||||
/* leader.css — leaderboard page styles */
|
||||
|
||||
.lb-page {
|
||||
min-height: calc(100vh - var(--hh));
|
||||
padding: 60px 0;
|
||||
}
|
||||
min-height: calc(100vh - var(--hh));
|
||||
padding: 60px 0;
|
||||
}
|
||||
|
||||
.lb-inner {
|
||||
max-width: 760px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.lb-inner {
|
||||
max-width: 760px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.lb-head {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
gap: 20px;
|
||||
margin-bottom: 32px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.lb-head {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
gap: 20px;
|
||||
margin-bottom: 32px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.lb-title {
|
||||
font-family: 'Syne', sans-serif;
|
||||
font-weight: 800;
|
||||
font-size: clamp(2rem, 5vw, 3.2rem);
|
||||
letter-spacing: -.03em;
|
||||
line-height: 1;
|
||||
}
|
||||
.lb-title {
|
||||
font-family: "Syne", sans-serif;
|
||||
font-weight: 800;
|
||||
font-size: clamp(2rem, 5vw, 3.2rem);
|
||||
letter-spacing: -0.03em;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.lb-title em {
|
||||
font-style: normal;
|
||||
background: linear-gradient(135deg, var(--sea), var(--leaf));
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
.lb-title em {
|
||||
font-style: normal;
|
||||
background: linear-gradient(135deg, var(--sea), var(--leaf));
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
.lb-actions { display: flex; gap: 10px; flex-wrap: wrap; }
|
||||
.lb-actions { display: flex; gap: 10px; flex-wrap: wrap; }
|
||||
|
||||
/* Table */
|
||||
.lb-table {
|
||||
background: var(--white);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--r-xl);
|
||||
overflow: hidden;
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
/* ─── TABLE ─── */
|
||||
.lb-table {
|
||||
background: var(--white);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--r-xl);
|
||||
overflow: hidden;
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
|
||||
.lb-table-head {
|
||||
display: grid;
|
||||
grid-template-columns: 56px 1fr 90px 90px 90px;
|
||||
gap: 0;
|
||||
padding: 14px 24px;
|
||||
background: var(--cream);
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
.lb-table-head {
|
||||
display: grid;
|
||||
grid-template-columns: 56px 1fr 90px 90px 90px;
|
||||
padding: 14px 24px;
|
||||
background: var(--cream);
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
|
||||
.lb-th {
|
||||
font-size: .72rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: .08em;
|
||||
text-transform: uppercase;
|
||||
color: var(--ink-muted);
|
||||
}
|
||||
.lb-th {
|
||||
font-size: 0.72rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: var(--ink-muted);
|
||||
}
|
||||
|
||||
.lb-th.right { text-align: right; }
|
||||
.lb-th.right { text-align: right; }
|
||||
|
||||
.lb-body { display: grid; }
|
||||
.lb-body { display: grid; }
|
||||
|
||||
.lb-row {
|
||||
display: grid;
|
||||
grid-template-columns: 56px 1fr 90px 90px 90px;
|
||||
align-items: center;
|
||||
padding: 16px 24px;
|
||||
border-bottom: 1px solid var(--line);
|
||||
transition: background .15s;
|
||||
animation: fadeRow .4s ease both;
|
||||
}
|
||||
.lb-row {
|
||||
display: grid;
|
||||
grid-template-columns: 56px 1fr 90px 90px 90px;
|
||||
align-items: center;
|
||||
padding: 16px 24px;
|
||||
border-bottom: 1px solid var(--line);
|
||||
transition: background 0.15s;
|
||||
animation: fadeRow 0.4s ease both;
|
||||
}
|
||||
|
||||
.lb-row:last-child { border-bottom: none; }
|
||||
.lb-row:last-child { border-bottom: none; }
|
||||
.lb-row:hover { background: var(--cream); }
|
||||
|
||||
.lb-row:hover { background: var(--cream); }
|
||||
@keyframes fadeRow {
|
||||
from { opacity: 0; transform: translateY(8px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
@keyframes fadeRow {
|
||||
from { opacity: 0; transform: translateY(8px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
/* ─── TOP 3 HIGHLIGHT ─── */
|
||||
.lb-row.rank-1 { background: rgba(240, 180, 40, 0.07); }
|
||||
.lb-row.rank-2 { background: rgba(180, 180, 195, 0.06); }
|
||||
.lb-row.rank-3 { background: rgba(205, 130, 70, 0.05); }
|
||||
|
||||
/* Top 3 highlight */
|
||||
.lb-row.rank-1 { background: rgba(240,180,40,.07); }
|
||||
.lb-row.rank-2 { background: rgba(180,180,195,.06); }
|
||||
.lb-row.rank-3 { background: rgba(205,130,70,.05); }
|
||||
.lb-rank {
|
||||
font-family: "Syne", sans-serif;
|
||||
font-weight: 800;
|
||||
font-size: 1rem;
|
||||
color: var(--ink-muted);
|
||||
}
|
||||
|
||||
.lb-rank {
|
||||
font-family: 'Syne', sans-serif;
|
||||
font-weight: 800;
|
||||
font-size: 1rem;
|
||||
color: var(--ink-muted);
|
||||
}
|
||||
.lb-row.rank-1 .lb-rank { color: var(--gold); }
|
||||
.lb-row.rank-2 .lb-rank { color: #a0a0b0; }
|
||||
.lb-row.rank-3 .lb-rank { color: #c07840; }
|
||||
|
||||
.lb-row.rank-1 .lb-rank { color: var(--gold); }
|
||||
.lb-row.rank-2 .lb-rank { color: #a0a0b0; }
|
||||
.lb-row.rank-3 .lb-rank { color: #c07840; }
|
||||
.lb-medal { font-size: 1.1rem; }
|
||||
|
||||
.lb-medal { font-size: 1.1rem; }
|
||||
.lb-name {
|
||||
font-family: "Syne", sans-serif;
|
||||
font-weight: 700;
|
||||
font-size: 0.96rem;
|
||||
color: var(--ink);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.lb-name {
|
||||
font-family: 'Syne', sans-serif;
|
||||
font-weight: 700;
|
||||
font-size: .96rem;
|
||||
color: var(--ink);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.lb-name.is-you::after {
|
||||
content: " (you)";
|
||||
font-weight: 400;
|
||||
font-family: "DM Sans", sans-serif;
|
||||
color: var(--ink-muted);
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.lb-name.is-you::after {
|
||||
content: ' (you)';
|
||||
font-weight: 400;
|
||||
font-family: 'DM Sans', sans-serif;
|
||||
color: var(--ink-muted);
|
||||
font-size: .8rem;
|
||||
}
|
||||
.lb-rounds {
|
||||
font-size: 0.82rem;
|
||||
color: var(--ink-muted);
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.lb-rounds {
|
||||
font-size: .82rem;
|
||||
color: var(--ink-muted);
|
||||
text-align: right;
|
||||
}
|
||||
.lb-date {
|
||||
font-size: 0.78rem;
|
||||
color: var(--ink-muted);
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.lb-date {
|
||||
font-size: .78rem;
|
||||
color: var(--ink-muted);
|
||||
text-align: right;
|
||||
}
|
||||
.lb-score {
|
||||
font-family: "Syne", sans-serif;
|
||||
font-weight: 800;
|
||||
font-size: 1.05rem;
|
||||
color: var(--sea);
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.lb-score {
|
||||
font-family: 'Syne', sans-serif;
|
||||
font-weight: 800;
|
||||
font-size: 1.05rem;
|
||||
color: var(--sea);
|
||||
text-align: right;
|
||||
}
|
||||
.lb-score.gold { color: var(--gold); }
|
||||
.lb-score.silver { color: #888898; }
|
||||
.lb-score.bronze { color: #c07840; }
|
||||
|
||||
.lb-score.gold { color: var(--gold); }
|
||||
.lb-score.silver { color: #888898; }
|
||||
.lb-score.bronze { color: #c07840; }
|
||||
/* ─── EMPTY STATE ─── */
|
||||
.lb-empty {
|
||||
padding: 64px 24px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Empty state */
|
||||
.lb-empty {
|
||||
padding: 64px 24px;
|
||||
text-align: center;
|
||||
}
|
||||
.lb-empty__icon { font-size: 3rem; margin-bottom: 12px; }
|
||||
|
||||
.lb-empty__icon { font-size: 3rem; margin-bottom: 12px; }
|
||||
.lb-empty__text {
|
||||
font-size: 1rem;
|
||||
color: var(--ink-soft);
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.lb-empty__text {
|
||||
font-size: 1rem;
|
||||
color: var(--ink-soft);
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
/* ─── CURRENT PLAYER BAR ─── */
|
||||
.your-score-bar {
|
||||
margin-top: 20px;
|
||||
padding: 16px 24px;
|
||||
background: linear-gradient(135deg, var(--sea-dim), var(--leaf-dim));
|
||||
border: 1px solid rgba(26, 127, 196, 0.18);
|
||||
border-radius: var(--r-lg);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
/* Current player highlight bar */
|
||||
.your-score-bar {
|
||||
margin-top: 20px;
|
||||
padding: 16px 24px;
|
||||
background: linear-gradient(135deg, var(--sea-dim), var(--leaf-dim));
|
||||
border: 1px solid rgba(26,127,196,.18);
|
||||
border-radius: var(--r-lg);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.your-score-bar__text { font-size: 0.9rem; color: var(--ink-soft); }
|
||||
.your-score-bar__text strong { color: var(--ink); }
|
||||
|
||||
.your-score-bar__text {
|
||||
font-size: .9rem;
|
||||
color: var(--ink-soft);
|
||||
}
|
||||
/* ─── RESPONSIVE ─── */
|
||||
@media (max-width: 640px) {
|
||||
.lb-page { padding: 40px 0; }
|
||||
|
||||
.your-score-bar__text strong { color: var(--ink); }
|
||||
.lb-table-head,
|
||||
.lb-row { grid-template-columns: 44px 1fr 72px; }
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.lb-page { padding: 40px 0; }
|
||||
.lb-table-head,
|
||||
.lb-row {
|
||||
grid-template-columns: 44px 1fr 72px;
|
||||
}
|
||||
.lb-th.hide-sm,
|
||||
.lb-rounds,
|
||||
.lb-date { display: none; }
|
||||
}
|
||||
.lb-th.hide-sm,
|
||||
.lb-rounds,
|
||||
.lb-date { display: none; }
|
||||
}
|
||||
|
||||
@media (max-width: 360px) {
|
||||
.lb-table-head,
|
||||
.lb-row { padding: 12px 16px; }
|
||||
}
|
||||
@media (max-width: 360px) {
|
||||
.lb-table-head,
|
||||
.lb-row { padding: 12px 16px; }
|
||||
}
|
||||
|
||||
@ -142,49 +142,7 @@
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.form { display: grid; gap: 20px; }
|
||||
|
||||
.field { display: grid; gap: 8px; }
|
||||
|
||||
.field label {
|
||||
font-size: .84rem;
|
||||
font-weight: 600;
|
||||
color: var(--ink-soft);
|
||||
letter-spacing: .02em;
|
||||
}
|
||||
|
||||
.field input {
|
||||
width: 100%;
|
||||
height: 54px;
|
||||
padding: 0 18px;
|
||||
border: 1.5px solid var(--line);
|
||||
border-radius: var(--r-md);
|
||||
background: var(--cream);
|
||||
color: var(--ink);
|
||||
font-size: .98rem;
|
||||
transition: border-color .18s, box-shadow .18s;
|
||||
}
|
||||
|
||||
.field input::placeholder { color: var(--ink-muted); }
|
||||
|
||||
.field input:focus {
|
||||
outline: none;
|
||||
border-color: var(--sea-light);
|
||||
box-shadow: 0 0 0 3px rgba(26,127,196,.12);
|
||||
background: var(--white);
|
||||
}
|
||||
|
||||
.field input.input--error {
|
||||
border-color: var(--danger);
|
||||
box-shadow: 0 0 0 3px rgba(224,92,92,.12);
|
||||
}
|
||||
|
||||
.field-error {
|
||||
font-size: .82rem;
|
||||
color: var(--danger);
|
||||
min-height: 1.2em;
|
||||
transition: opacity .18s;
|
||||
}
|
||||
/* Form and field styles are defined in main.css */
|
||||
|
||||
/* ─── Responsive ─── */
|
||||
@media (max-width: 900px) {
|
||||
|
||||
@ -253,6 +253,50 @@ button, input { font: inherit; }
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
/* ─── FORM ─── */
|
||||
.form { display: grid; gap: 20px; }
|
||||
|
||||
.field { display: grid; gap: 8px; }
|
||||
|
||||
.field label {
|
||||
font-size: 0.84rem;
|
||||
font-weight: 600;
|
||||
color: var(--ink-soft);
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.field input {
|
||||
width: 100%;
|
||||
height: 54px;
|
||||
padding: 0 18px;
|
||||
border: 1.5px solid var(--line);
|
||||
border-radius: var(--r-md);
|
||||
background: var(--cream);
|
||||
color: var(--ink);
|
||||
font-size: 0.98rem;
|
||||
transition: border-color 0.18s, box-shadow 0.18s;
|
||||
}
|
||||
|
||||
.field input::placeholder { color: var(--ink-muted); }
|
||||
|
||||
.field input:focus {
|
||||
outline: none;
|
||||
border-color: var(--sea-light);
|
||||
box-shadow: 0 0 0 3px rgba(26, 127, 196, 0.12);
|
||||
background: var(--white);
|
||||
}
|
||||
|
||||
.field input.input--error {
|
||||
border-color: var(--danger);
|
||||
box-shadow: 0 0 0 3px rgba(224, 92, 92, 0.12);
|
||||
}
|
||||
|
||||
.field-error {
|
||||
font-size: 0.82rem;
|
||||
color: var(--danger);
|
||||
min-height: 1.2em;
|
||||
}
|
||||
|
||||
/* ─── FOOTER ─── */
|
||||
.footer {
|
||||
border-top: 1px solid var(--line);
|
||||
|
||||
196
frontend/styles/results.css
Normal file
196
frontend/styles/results.css
Normal file
@ -0,0 +1,196 @@
|
||||
/* results.css — results page styles */
|
||||
|
||||
.results-page {
|
||||
min-height: calc(100vh - var(--hh));
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 60px 0;
|
||||
}
|
||||
|
||||
.results-inner {
|
||||
width: 100%;
|
||||
max-width: 680px;
|
||||
display: grid;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
/* ─── HEADER ─── */
|
||||
.results-header {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.results-emoji {
|
||||
font-size: 3.5rem;
|
||||
margin-bottom: 16px;
|
||||
display: block;
|
||||
animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
|
||||
}
|
||||
|
||||
@keyframes popIn {
|
||||
from { transform: scale(0); opacity: 0; }
|
||||
to { transform: scale(1); opacity: 1; }
|
||||
}
|
||||
|
||||
.results-title {
|
||||
font-family: "Syne", sans-serif;
|
||||
font-weight: 800;
|
||||
font-size: clamp(2rem, 5vw, 3.4rem);
|
||||
letter-spacing: -0.03em;
|
||||
line-height: 1.05;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.results-player {
|
||||
font-size: 1rem;
|
||||
color: var(--ink-soft);
|
||||
}
|
||||
|
||||
.results-player strong { color: var(--ink); }
|
||||
|
||||
/* ─── TOTAL SCORE ─── */
|
||||
.score-total-card {
|
||||
background: linear-gradient(135deg, var(--sea) 0%, #159fd4 50%, var(--leaf) 100%);
|
||||
border-radius: var(--r-xl);
|
||||
padding: 36px 40px;
|
||||
text-align: center;
|
||||
color: var(--white);
|
||||
box-shadow: 0 16px 40px rgba(26, 127, 196, 0.3);
|
||||
animation: slideUp 0.5s 0.1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
|
||||
}
|
||||
|
||||
@keyframes slideUp {
|
||||
from { transform: translateY(30px); opacity: 0; }
|
||||
to { transform: translateY(0); opacity: 1; }
|
||||
}
|
||||
|
||||
.score-total-label {
|
||||
font-size: 0.78rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.1em;
|
||||
text-transform: uppercase;
|
||||
opacity: 0.78;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.score-total-num {
|
||||
font-family: "Syne", sans-serif;
|
||||
font-weight: 800;
|
||||
font-size: clamp(4rem, 10vw, 6rem);
|
||||
line-height: 1;
|
||||
letter-spacing: -0.04em;
|
||||
}
|
||||
|
||||
.score-total-max {
|
||||
font-size: 1.4rem;
|
||||
opacity: 0.6;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.score-grade {
|
||||
display: inline-block;
|
||||
margin-top: 12px;
|
||||
padding: 4px 18px;
|
||||
border-radius: 999px;
|
||||
background: rgba(255, 255, 255, 0.22);
|
||||
font-family: "Syne", sans-serif;
|
||||
font-weight: 800;
|
||||
font-size: 1.1rem;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
/* ─── ROUND BREAKDOWN ─── */
|
||||
.rounds-card {
|
||||
background: var(--white);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--r-xl);
|
||||
padding: 28px 32px;
|
||||
box-shadow: var(--shadow-sm);
|
||||
animation: slideUp 0.5s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
|
||||
}
|
||||
|
||||
.rounds-card-title {
|
||||
font-family: "Syne", sans-serif;
|
||||
font-weight: 700;
|
||||
font-size: 1rem;
|
||||
letter-spacing: -0.01em;
|
||||
margin-bottom: 20px;
|
||||
color: var(--ink-soft);
|
||||
}
|
||||
|
||||
.round-rows { display: grid; gap: 14px; }
|
||||
|
||||
.round-row {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr auto;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.round-row__label {
|
||||
font-size: 0.82rem;
|
||||
font-weight: 600;
|
||||
color: var(--ink-soft);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.round-row__bar-wrap {
|
||||
height: 8px;
|
||||
background: var(--cream);
|
||||
border-radius: 999px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.round-row__bar {
|
||||
height: 100%;
|
||||
border-radius: 999px;
|
||||
background: linear-gradient(90deg, var(--sea), var(--leaf));
|
||||
transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
|
||||
}
|
||||
|
||||
.round-row__score {
|
||||
font-family: "Syne", sans-serif;
|
||||
font-weight: 800;
|
||||
font-size: 0.9rem;
|
||||
color: var(--sea);
|
||||
min-width: 36px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* ─── COUNTRY TAGS ─── */
|
||||
.countries-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.country-tag {
|
||||
padding: 5px 12px;
|
||||
border-radius: 999px;
|
||||
background: var(--sea-dim);
|
||||
color: var(--sea);
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* ─── ACTIONS ─── */
|
||||
.results-actions {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
animation: slideUp 0.5s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
|
||||
}
|
||||
|
||||
.results-actions .btn { flex: 1 1 180px; }
|
||||
|
||||
/* ─── RESPONSIVE ─── */
|
||||
@media (max-width: 600px) {
|
||||
.results-page { padding: 40px 0; }
|
||||
.score-total-card { padding: 28px 24px; }
|
||||
.rounds-card { padding: 22px 20px; }
|
||||
.results-actions .btn { flex-basis: 100%; }
|
||||
}
|
||||
|
||||
@media (max-width: 360px) {
|
||||
.score-total-num { font-size: 3.4rem; }
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user