This commit is contained in:
1 parent
a6db306847
commit
7e4fa74cd6
13 files changed
+363
-63
No files matched your search
+161
-20
@@ -11,6 +11,8 @@ const PER_PAGE = 60;
|
||||
const THEME_KEY = "sb.theme";
|
||||
const VIEWS_KEY = "sb.views";
|
||||
const LAYOUT_KEY = "sb.layout";
|
||||
const SORT_KEY = "sb.sort";
|
||||
const COLS_KEY = "sb.cols";
|
||||
|
||||
function defaultFilters() {
|
||||
return {
|
||||
@@ -24,6 +26,7 @@ const state = {
|
||||
view: "library",
|
||||
page: 1,
|
||||
sort: "review",
|
||||
dir: "desc",
|
||||
q: "",
|
||||
filters: defaultFilters(),
|
||||
preset: null,
|
||||
@@ -85,10 +88,12 @@ function applyFiltersState() {
|
||||
pin.classList.toggle("active", pinned);
|
||||
pin.setAttribute("aria-pressed", String(pinned));
|
||||
pin.title = pinned ? "Открепить фильтры" : "Закрепить фильтры";
|
||||
pin.setAttribute("aria-label", pin.title);
|
||||
|
||||
toggle.classList.toggle("active", open);
|
||||
toggle.setAttribute("aria-expanded", String(open));
|
||||
toggle.title = open ? "Скрыть фильтры" : "Показать фильтры";
|
||||
toggle.setAttribute("aria-label", toggle.title);
|
||||
}
|
||||
|
||||
function toggleFilters() {
|
||||
@@ -158,6 +163,8 @@ function syncThemeButton() {
|
||||
themeToggle.title = light ? "Тёмная тема" : "Светлая тема";
|
||||
themeToggle.setAttribute("aria-label", themeToggle.title);
|
||||
themeToggle.setAttribute("aria-pressed", String(light));
|
||||
const themeColor = $("#themeColor");
|
||||
if (themeColor) themeColor.content = light ? "#f4f1e9" : "#090c12";
|
||||
}
|
||||
themeToggle.addEventListener("click", () => {
|
||||
const light = document.documentElement.dataset.theme === "light";
|
||||
@@ -226,6 +233,42 @@ function fmtDuration(h) {
|
||||
return `≈${h >= 10 ? Math.round(h) : h.toFixed(1).replace(".0", "")} ч`;
|
||||
}
|
||||
|
||||
function defaultDir(field) {
|
||||
return ["hours", "review", "year", "added"].includes(field) ? "desc" : "asc";
|
||||
}
|
||||
|
||||
function loadSort() {
|
||||
try {
|
||||
const saved = JSON.parse(localStorage.getItem(SORT_KEY) || "null");
|
||||
if (saved && saved.sort) {
|
||||
state.sort = saved.sort;
|
||||
state.dir = saved.dir === "asc" ? "asc" : "desc";
|
||||
}
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
function saveSort() {
|
||||
try {
|
||||
localStorage.setItem(SORT_KEY, JSON.stringify({ sort: state.sort, dir: state.dir }));
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
function loadTableWidths() {
|
||||
try {
|
||||
const saved = JSON.parse(localStorage.getItem(COLS_KEY) || "{}");
|
||||
return saved && typeof saved === "object" ? saved : {};
|
||||
} catch (_) {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
function saveTableWidth(key, width) {
|
||||
if (!Number.isFinite(width)) return;
|
||||
const widths = loadTableWidths();
|
||||
widths[key] = Math.round(width);
|
||||
try { localStorage.setItem(COLS_KEY, JSON.stringify(widths)); } catch (_) {}
|
||||
}
|
||||
|
||||
function initials(name) {
|
||||
return name.split(/\s+/).slice(0, 2).map((w) => w[0] || "").join("").toUpperCase();
|
||||
}
|
||||
@@ -268,7 +311,8 @@ function cardHtml(g, mode = "library") {
|
||||
return `
|
||||
<article class="card" data-appid="${g.appid}" tabindex="0" role="button" aria-label="Открыть ${esc(g.name)}">
|
||||
<div class="cover">
|
||||
<img data-appid="${g.appid}" loading="lazy" src="${coverUrl(g.appid)}" alt="">
|
||||
<img data-appid="${g.appid}" loading="lazy" width="300" height="450"
|
||||
src="${coverUrl(g.appid)}" alt="">
|
||||
<div class="fallback">${esc(initials(g.name))}</div>
|
||||
${review}${installed}${selectBox}
|
||||
</div>
|
||||
@@ -285,6 +329,37 @@ function cardHtml(g, mode = "library") {
|
||||
</article>`;
|
||||
}
|
||||
|
||||
const TABLE_COLS = [
|
||||
{ key: "select", label: "", width: 32, cls: "t-select" },
|
||||
{ key: "name", label: "Игра", width: 300, cls: "", sort: "name" },
|
||||
{ key: "year", label: "Год", width: 64, cls: "t-year", sort: "year" },
|
||||
{ key: "review", label: "Отзывы", width: 76, cls: "", sort: "review" },
|
||||
{ key: "hours", label: "Часы", width: 80, cls: "", sort: "hours" },
|
||||
{ key: "duration", label: "Длительность", width: 104, cls: "t-duration", sort: "duration" },
|
||||
{ key: "genres", label: "Жанры", width: 180, cls: "t-genres" },
|
||||
{ key: "fav", label: "★", width: 30, cls: "t-fav" },
|
||||
];
|
||||
|
||||
function tableHead() {
|
||||
const widths = loadTableWidths();
|
||||
const cols = TABLE_COLS.map((col) => {
|
||||
return `<col data-col="${col.key}" style="width:${widths[col.key] || col.width}px">`;
|
||||
}).join("");
|
||||
const heads = TABLE_COLS.map((col) => {
|
||||
const active = col.sort && state.sort === col.sort;
|
||||
const arrow = active ? (state.dir === "asc" ? " ▲" : " ▼") : "";
|
||||
const aria = col.sort
|
||||
? ` aria-sort="${active ? (state.dir === "asc" ? "ascending" : "descending") : "none"}"`
|
||||
: "";
|
||||
const sort = col.sort ? ` data-sort="${col.sort}"` : "";
|
||||
const resizer = col.key === "select" || col.key === "fav"
|
||||
? "" : '<span class="col-resizer" data-col="' + col.key + '" aria-hidden="true"></span>';
|
||||
const label = col.sort ? `<span class="th-label">${col.label}${arrow}</span>` : col.label;
|
||||
return `<th class="${col.cls}" data-col="${col.key}"${sort}${aria}>${label}${resizer}</th>`;
|
||||
}).join("");
|
||||
return { cols, heads };
|
||||
}
|
||||
|
||||
function rowHtml(g) {
|
||||
const select = state.selectionMode
|
||||
? `<input type="checkbox" data-select="${g.appid}"${state.selected.has(g.appid) ? " checked" : ""} aria-label="Выбрать игру">`
|
||||
@@ -296,7 +371,8 @@ function rowHtml(g) {
|
||||
<td class="t-select">${select}</td>
|
||||
<td class="t-name">
|
||||
<div class="cover-inline">
|
||||
<img data-appid="${g.appid}" loading="lazy" src="${coverUrl(g.appid)}" alt="">
|
||||
<img data-appid="${g.appid}" loading="lazy" width="34" height="51"
|
||||
src="${coverUrl(g.appid)}" alt="">
|
||||
<div class="fallback">${esc(initials(g.name))}</div>
|
||||
</div>
|
||||
<span class="t-title">${esc(g.name)}</span>
|
||||
@@ -316,22 +392,43 @@ function modeHours(g) {
|
||||
}
|
||||
|
||||
function tableHtml(items) {
|
||||
const { cols, heads } = tableHead();
|
||||
return `
|
||||
<table class="game-table">
|
||||
<thead><tr>
|
||||
<th class="t-select"></th>
|
||||
<th>Игра</th>
|
||||
<th class="t-year">Год</th>
|
||||
<th>Отзывы</th>
|
||||
<th>Часы</th>
|
||||
<th class="t-duration">Длительность</th>
|
||||
<th class="t-genres">Жанры</th>
|
||||
<th class="t-fav">★</th>
|
||||
</tr></thead>
|
||||
<table class="game-table" aria-label="Библиотека игр">
|
||||
<colgroup>${cols}</colgroup>
|
||||
<thead><tr>${heads}</tr></thead>
|
||||
<tbody>${items.map(rowHtml).join("")}</tbody>
|
||||
</table>`;
|
||||
}
|
||||
|
||||
function bindColumnResizers(root) {
|
||||
root.querySelectorAll(".col-resizer").forEach((handle) => {
|
||||
if (handle.dataset.bound) return;
|
||||
handle.dataset.bound = "1";
|
||||
handle.addEventListener("pointerdown", (event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
const col = handle.dataset.col;
|
||||
const th = handle.closest("th");
|
||||
const colEl = root.querySelector(`col[data-col="${col}"]`);
|
||||
if (!th || !colEl) return;
|
||||
const startX = event.clientX;
|
||||
const startWidth = th.getBoundingClientRect().width;
|
||||
const move = (moveEvent) => {
|
||||
const width = Math.max(40, Math.round(startWidth + moveEvent.clientX - startX));
|
||||
colEl.style.width = `${width}px`;
|
||||
};
|
||||
const up = () => {
|
||||
document.removeEventListener("pointermove", move);
|
||||
document.removeEventListener("pointerup", up);
|
||||
saveTableWidth(col, parseFloat(colEl.style.width));
|
||||
};
|
||||
document.addEventListener("pointermove", move);
|
||||
document.addEventListener("pointerup", up, { once: true });
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function bindRows(root) {
|
||||
root.querySelectorAll("tr[data-appid]").forEach((row) => {
|
||||
if (row.dataset.bound) return;
|
||||
@@ -349,6 +446,7 @@ function bindRows(root) {
|
||||
}
|
||||
});
|
||||
});
|
||||
bindColumnResizers(root);
|
||||
bindImages(root);
|
||||
}
|
||||
|
||||
@@ -440,6 +538,8 @@ function toast(message, action = null) {
|
||||
el = document.createElement("div");
|
||||
el.id = "toast";
|
||||
el.className = "toast";
|
||||
el.setAttribute("role", "status");
|
||||
el.setAttribute("aria-live", "polite");
|
||||
document.body.appendChild(el);
|
||||
}
|
||||
el.innerHTML = "";
|
||||
@@ -589,12 +689,15 @@ function applySavedView(view) {
|
||||
const saved = view.filters || {};
|
||||
state.q = view.q || "";
|
||||
state.sort = view.sort || "review";
|
||||
state.dir = view.dir || defaultDir(state.sort);
|
||||
state.filters = {
|
||||
...defaultFilters(),
|
||||
...saved,
|
||||
genres: [...(saved.genres || [])],
|
||||
tags: [...(saved.tags || [])],
|
||||
};
|
||||
$("#sort").value = state.sort;
|
||||
saveSort();
|
||||
syncFilterControls();
|
||||
loadGames(true);
|
||||
}
|
||||
@@ -681,6 +784,7 @@ function filterParams() {
|
||||
if (state.filters.unplayed) p.set("unplayed", "1");
|
||||
if (state.filters.favorite) p.set("favorite", "1");
|
||||
if (state.filters.duration) p.set("duration", state.filters.duration);
|
||||
p.set("dir", state.dir);
|
||||
[
|
||||
["minHours", "min_hours"], ["maxHours", "max_hours"],
|
||||
["minYear", "min_year"], ["maxYear", "max_year"],
|
||||
@@ -781,6 +885,7 @@ async function runRecommend(scroll = true) {
|
||||
include_tribute: $("#optTribute").checked,
|
||||
include_nostalgia: $("#optNostalgia").checked,
|
||||
min_review: Number($("#optReview").value),
|
||||
session: $("#optSession").value || null,
|
||||
limit: 36,
|
||||
};
|
||||
state.recommendContext = { preset: state.preset, mood: state.preset ? null : text };
|
||||
@@ -909,14 +1014,14 @@ function renderModal(g) {
|
||||
<div class="modal-grid">
|
||||
<div class="modal-cover" id="modalCover">
|
||||
<div class="cover-blur" id="modalCoverBlur"></div>
|
||||
<img data-appid="${g.appid}" src="${coverUrl(g.appid)}" alt="">
|
||||
<img data-appid="${g.appid}" width="600" height="900" src="${coverUrl(g.appid)}" alt="">
|
||||
<div class="fallback">${esc(g.name)}</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="modal-top">
|
||||
${modalStack.length > 1 ? `<button class="modal-back" id="modalBack" title="Назад">←</button>` : ""}
|
||||
<h2 class="modal-title">${esc(g.name)}</h2>
|
||||
<button class="modal-close" id="modalClose" title="Закрыть">×</button>
|
||||
${modalStack.length > 1 ? `<button class="modal-back" id="modalBack" title="Назад" aria-label="Назад">←</button>` : ""}
|
||||
<h2 class="modal-title" id="modalTitle">${esc(g.name)}</h2>
|
||||
<button class="modal-close" id="modalClose" title="Закрыть" aria-label="Закрыть">×</button>
|
||||
</div>
|
||||
<div class="modal-meta">${meta}</div>
|
||||
<div class="chip-row">${genres}</div>
|
||||
@@ -984,7 +1089,12 @@ function debounce(fn, ms) {
|
||||
function switchView(view) {
|
||||
state.view = view;
|
||||
if (view !== "library") closeFilters();
|
||||
document.querySelectorAll(".tab").forEach((t) => t.classList.toggle("active", t.dataset.view === view));
|
||||
document.querySelectorAll(".tab").forEach((tab) => {
|
||||
const active = tab.dataset.view === view;
|
||||
tab.classList.toggle("active", active);
|
||||
tab.setAttribute("aria-selected", String(active));
|
||||
tab.tabIndex = active ? 0 : -1;
|
||||
});
|
||||
$("#libraryView").classList.toggle("hidden", view !== "library");
|
||||
$("#recommendView").classList.toggle("hidden", view !== "recommend");
|
||||
try {
|
||||
@@ -995,9 +1105,19 @@ function switchView(view) {
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
document.querySelectorAll(".tab").forEach((tab) => {
|
||||
const tabButtons = [...document.querySelectorAll(".tab")];
|
||||
tabButtons.forEach((tab) => {
|
||||
tab.addEventListener("click", () => switchView(tab.dataset.view));
|
||||
});
|
||||
document.querySelector(".tabs").addEventListener("keydown", (event) => {
|
||||
if (!["ArrowLeft", "ArrowRight"].includes(event.key)) return;
|
||||
event.preventDefault();
|
||||
const current = tabButtons.findIndex((tab) => tab.dataset.view === state.view);
|
||||
const delta = event.key === "ArrowRight" ? 1 : -1;
|
||||
const next = tabButtons[(current + delta + tabButtons.length) % tabButtons.length];
|
||||
next.focus();
|
||||
switchView(next.dataset.view);
|
||||
});
|
||||
|
||||
$("#search").addEventListener("input", debounce((e) => {
|
||||
state.q = e.target.value.trim();
|
||||
@@ -1006,6 +1126,8 @@ $("#search").addEventListener("input", debounce((e) => {
|
||||
|
||||
$("#sort").addEventListener("change", (e) => {
|
||||
state.sort = e.target.value;
|
||||
state.dir = defaultDir(state.sort);
|
||||
saveSort();
|
||||
loadGames(true);
|
||||
});
|
||||
|
||||
@@ -1048,7 +1170,8 @@ $("#saveView").addEventListener("click", () => {
|
||||
const name = (prompt("Название вида:", "") || "").trim();
|
||||
if (!name) return;
|
||||
const views = loadViews();
|
||||
const view = { name, q: state.q, sort: state.sort, filters: cloneFilters(state.filters) };
|
||||
const view = { name, q: state.q, sort: state.sort, dir: state.dir,
|
||||
filters: cloneFilters(state.filters) };
|
||||
const existing = views.findIndex((item) => item.name === name);
|
||||
let selected;
|
||||
if (existing >= 0) {
|
||||
@@ -1095,6 +1218,22 @@ grid.addEventListener("change", (event) => {
|
||||
if (input) setSelected(Number(input.value), input.checked);
|
||||
});
|
||||
|
||||
grid.addEventListener("click", (event) => {
|
||||
if (!grid.classList.contains("table-view")) return;
|
||||
const header = event.target instanceof Element && event.target.closest("th[data-sort]");
|
||||
if (!header || event.target.closest(".col-resizer")) return;
|
||||
const field = header.dataset.sort;
|
||||
if (state.sort === field) {
|
||||
state.dir = state.dir === "asc" ? "desc" : "asc";
|
||||
} else {
|
||||
state.sort = field;
|
||||
state.dir = defaultDir(field);
|
||||
}
|
||||
$("#sort").value = state.sort;
|
||||
saveSort();
|
||||
loadGames(true);
|
||||
});
|
||||
|
||||
function applyLayout(mode) {
|
||||
if (!["grid", "list", "table"].includes(mode)) mode = "grid";
|
||||
grid.dataset.layout = mode;
|
||||
@@ -1343,6 +1482,8 @@ if ("serviceWorker" in navigator) {
|
||||
}
|
||||
|
||||
(async function boot() {
|
||||
loadSort();
|
||||
$("#sort").value = state.sort;
|
||||
await Promise.all([loadMeta(), loadMoods()]);
|
||||
await loadGames(true);
|
||||
|
||||
|
||||
+29
-14
@@ -9,7 +9,7 @@
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16.png">
|
||||
<link rel="apple-touch-icon" href="/static/apple-touch-icon.png">
|
||||
<link rel="manifest" href="/static/site.webmanifest">
|
||||
<meta name="theme-color" content="#062555">
|
||||
<meta id="themeColor" name="theme-color" content="#090c12">
|
||||
<meta name="apple-mobile-web-app-title" content="SteamBase">
|
||||
<script>
|
||||
try {
|
||||
@@ -19,14 +19,17 @@ try {
|
||||
<link rel="stylesheet" href="/static/styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<a class="skip-link" href="#main">Перейти к содержимому</a>
|
||||
<header class="topbar">
|
||||
<div class="brand">
|
||||
<img class="logo" src="/static/icon-64.png" alt="" width="34" height="34">
|
||||
<span>SteamBase</span>
|
||||
</div>
|
||||
<nav class="tabs">
|
||||
<button class="tab active" data-view="library">Библиотека</button>
|
||||
<button class="tab" data-view="recommend">Рекомендации</button>
|
||||
<nav class="tabs" role="tablist" aria-label="Разделы">
|
||||
<button class="tab active" id="tabLibrary" role="tab" data-view="library"
|
||||
aria-selected="true" aria-controls="libraryView" tabindex="0">Библиотека</button>
|
||||
<button class="tab" id="tabRecommend" role="tab" data-view="recommend"
|
||||
aria-selected="false" aria-controls="recommendView" tabindex="-1">Рекомендации</button>
|
||||
</nav>
|
||||
<div class="stats" id="stats"></div>
|
||||
<button id="themeToggle" class="icon-btn theme-toggle" type="button"
|
||||
@@ -45,29 +48,33 @@ try {
|
||||
</header>
|
||||
|
||||
<div id="filtersBackdrop" class="filters-backdrop" hidden></div>
|
||||
<main>
|
||||
<section id="libraryView" class="layout">
|
||||
<main id="main">
|
||||
<h1 class="visually-hidden">SteamBase — библиотека игр и рекомендации</h1>
|
||||
<section id="libraryView" class="layout" role="tabpanel" aria-labelledby="tabLibrary">
|
||||
<aside class="filters" id="filtersPanel" aria-label="Фильтры">
|
||||
<div class="saved-views">
|
||||
<select id="savedView" aria-label="Сохранённые виды">
|
||||
<option value="">сохранённые виды</option>
|
||||
</select>
|
||||
<button id="saveView" class="icon-btn" type="button" title="Сохранить текущий вид">+</button>
|
||||
<button id="deleteView" class="icon-btn" type="button" title="Удалить выбранный вид">×</button>
|
||||
<button id="saveView" class="icon-btn" type="button" title="Сохранить текущий вид"
|
||||
aria-label="Сохранить текущий вид">+</button>
|
||||
<button id="deleteView" class="icon-btn" type="button" title="Удалить выбранный вид"
|
||||
aria-label="Удалить выбранный вид">×</button>
|
||||
</div>
|
||||
|
||||
<div class="filter-head">
|
||||
<h2>Фильтры</h2>
|
||||
<div class="filter-actions">
|
||||
<button id="filtersPin" class="icon-btn pin active" type="button"
|
||||
title="Открепить фильтры" aria-pressed="true">
|
||||
title="Открепить фильтры" aria-label="Открепить фильтры" aria-pressed="true">
|
||||
<svg viewBox="0 0 24 24" width="15" height="15" fill="none"
|
||||
stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M8 3h8l-1 6 3 3v2H6v-2l3-3-1-6Z"/>
|
||||
<path d="M12 14v7"/>
|
||||
</svg>
|
||||
</button>
|
||||
<button id="filtersClose" class="icon-btn drawer-close" type="button" title="Закрыть фильтры">×</button>
|
||||
<button id="filtersClose" class="icon-btn drawer-close" type="button"
|
||||
title="Закрыть фильтры" aria-label="Закрыть фильтры">×</button>
|
||||
<button id="resetFilters" class="link">сбросить</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -197,8 +204,8 @@ try {
|
||||
</svg>
|
||||
</button>
|
||||
<input id="search" type="search" placeholder="Поиск: название, описание, тег…" autocomplete="off"
|
||||
aria-keyshortcuts="/">
|
||||
<select id="sort">
|
||||
aria-label="Поиск по библиотеке" aria-keyshortcuts="/">
|
||||
<select id="sort" aria-label="Сортировка">
|
||||
<option value="name">по названию</option>
|
||||
<option value="hours">по времени</option>
|
||||
<option value="review" selected>по отзывам</option>
|
||||
@@ -232,7 +239,7 @@ try {
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="recommendView" class="hidden">
|
||||
<section id="recommendView" class="hidden" role="tabpanel" aria-labelledby="tabRecommend">
|
||||
<div class="mood-panel">
|
||||
<div>
|
||||
<h1>Что хочется сейчас?</h1>
|
||||
@@ -245,6 +252,14 @@ try {
|
||||
<label class="check"><input type="checkbox" id="optTribute"> учитывать tribute</label>
|
||||
<label class="check"><input type="checkbox" id="optNostalgia"> учитывать nostalgia</label>
|
||||
<label class="range">мин. отзывы <input type="range" id="optReview" min="0" max="95" step="5" value="65"><b id="optReviewVal">65%</b></label>
|
||||
<label class="range">время
|
||||
<select id="optSession" aria-label="Доступное время">
|
||||
<option value="">любое</option>
|
||||
<option value="short">30 минут</option>
|
||||
<option value="evening">вечер</option>
|
||||
<option value="weekend">выходные</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
<button id="recommendBtn" class="primary">Подобрать</button>
|
||||
</div>
|
||||
@@ -253,7 +268,7 @@ try {
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<dialog id="modal" class="modal">
|
||||
<dialog id="modal" class="modal" aria-labelledby="modalTitle">
|
||||
<div id="modalBody"></div>
|
||||
</dialog>
|
||||
|
||||
|
||||
+60
-2
@@ -17,6 +17,33 @@
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
html { color-scheme: dark; }
|
||||
button, a, summary, input, select { touch-action: manipulation; }
|
||||
|
||||
.visually-hidden {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0 0 0 0);
|
||||
white-space: nowrap;
|
||||
border: 0;
|
||||
}
|
||||
.skip-link {
|
||||
position: fixed;
|
||||
top: -60px;
|
||||
left: 12px;
|
||||
z-index: 200;
|
||||
padding: 8px 12px;
|
||||
border-radius: 8px;
|
||||
background: var(--accent);
|
||||
color: #0a0d13;
|
||||
font-weight: 650;
|
||||
text-decoration: none;
|
||||
transition: top .15s;
|
||||
}
|
||||
.skip-link:focus { top: 12px; }
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
@@ -159,6 +186,7 @@ main { padding: 24px 28px 70px; }
|
||||
transform: translateX(calc(-100% - 30px));
|
||||
transition: transform .22s ease, opacity .22s ease;
|
||||
will-change: transform;
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
.layout.filters-unpinned .filters.open {
|
||||
opacity: 1;
|
||||
@@ -478,8 +506,9 @@ html[data-theme="light"] .select-box {
|
||||
.grid.list-view .select-box { right: 6px; bottom: 6px; width: 24px; height: 24px; }
|
||||
|
||||
.grid.table-view { display: block; }
|
||||
.game-table { width: 100%; border-collapse: collapse; font-size: 13px; }
|
||||
.game-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
|
||||
.game-table th {
|
||||
position: relative;
|
||||
text-align: left;
|
||||
padding: 8px 10px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
@@ -508,6 +537,23 @@ html[data-theme="light"] .select-box {
|
||||
.game-table .t-fav { color: var(--accent); width: 26px; text-align: center; }
|
||||
.game-table .t-year, .game-table .t-duration { white-space: nowrap; }
|
||||
.game-table td:nth-child(5) { white-space: nowrap; }
|
||||
.game-table td:nth-child(3),
|
||||
.game-table td:nth-child(4),
|
||||
.game-table td:nth-child(5),
|
||||
.game-table td:nth-child(6) { font-variant-numeric: tabular-nums; }
|
||||
.game-table th[data-sort] { cursor: pointer; user-select: none; }
|
||||
.game-table th[data-sort]:hover { color: var(--text); }
|
||||
.th-label { white-space: nowrap; }
|
||||
.col-resizer {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -3px;
|
||||
z-index: 2;
|
||||
width: 6px;
|
||||
height: 100%;
|
||||
cursor: col-resize;
|
||||
}
|
||||
.col-resizer:hover { background: var(--accent); opacity: .35; }
|
||||
.cover-inline {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
@@ -700,6 +746,7 @@ html[data-theme="light"] .game-table tbody tr:hover { background: rgba(23, 32, 5
|
||||
.options { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
|
||||
.range { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
|
||||
.range input { accent-color: var(--accent); }
|
||||
.range select { width: auto; min-width: 120px; padding: 6px 8px; }
|
||||
.range b { color: var(--text); font-weight: 600; min-width: 34px; }
|
||||
|
||||
.primary {
|
||||
@@ -749,6 +796,7 @@ html[data-theme="light"] .game-table tbody tr:hover { background: rgba(23, 32, 5
|
||||
color: var(--text);
|
||||
box-shadow: var(--shadow);
|
||||
overflow: hidden;
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
.modal::backdrop { background: rgba(4, 6, 10, .72); backdrop-filter: blur(6px); }
|
||||
|
||||
@@ -1004,6 +1052,15 @@ html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c9c0ad; }
|
||||
::-webkit-scrollbar-thumb { background: #26304a; border-radius: 99px; border: 2px solid var(--bg); }
|
||||
::-webkit-scrollbar-track { background: transparent; }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*, *::before, *::after {
|
||||
animation-duration: .01ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: .01ms !important;
|
||||
scroll-behavior: auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 980px) {
|
||||
.layout { grid-template-columns: minmax(0, 1fr); }
|
||||
.filters-backdrop { inset: 0; }
|
||||
@@ -1029,7 +1086,8 @@ html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c9c0ad; }
|
||||
.toolbar input { flex: 1 1 150px; }
|
||||
.toolbar select { flex: 1 1 140px; min-width: 140px; }
|
||||
.stat { padding: 4px 9px; font-size: 12px; }
|
||||
.game-table { font-size: 12px; }
|
||||
.game-table { table-layout: auto; font-size: 12px; }
|
||||
.game-table col { width: auto !important; }
|
||||
.game-table th, .game-table td { padding: 6px 7px; }
|
||||
.game-table .t-year,
|
||||
.game-table .t-genres,
|
||||
|
||||
Reference in new issue
Block a user