treker-po-trenirovkam-i-pit.../about.html
2026-11-17 06:58:51 +05:00

63 lines
3.0 KiB
HTML

<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<style>
:root { --bg:#f6f7f9; --card:#fff; --text:#1d2330; --muted:#5b6475; --accent:#2f7d5b; --line:#e3e6eb; }
@media (prefers-color-scheme: dark) { :root { --bg:#14171c; --card:#1d2129; --text:#e8ebf0; --muted:#a3abb8; --accent:#5cc092; --line:#2c323c; } }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--text); font:16px/1.55 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; }
main { max-width:720px; margin:0 auto; padding:32px 16px 48px; }
header { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; flex-wrap:wrap; }
h1 { font-size:1.75rem; line-height:1.2; margin:0 0 8px; }
.lead { color:var(--muted); margin:0 0 16px; }
.status { border-left:4px solid var(--accent); background:var(--card); padding:12px 16px; border-radius:8px; margin:0 0 24px; }
section { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:16px 20px; margin:0 0 16px; }
h2 { font-size:1.125rem; margin:0 0 8px; color:var(--accent); }
ul, ol { margin:0; padding-left:1.25rem; }
li + li { margin-top:6px; }
label { color:var(--muted); font-size:.875rem; }
select { font:inherit; padding:4px 8px; border-radius:6px; border:1px solid var(--line); background:var(--card); color:var(--text); }
</style>
</head>
<body>
<main>
<header>
<div>
<h1 data-t="title"></h1>
<p class="lead" data-t="lead"></p>
</div>
<label><span data-t="lang"></span>
<select id="lang"><option value="ru">Русский</option><option value="kk">Қазақша</option><option value="en">English</option></select>
</label>
</header>
<p class="status" data-t="status"></p>
<section><h2 data-t="whatTitle"></h2><ul data-list="what"></ul></section>
<section><h2 data-t="howTitle"></h2><ol data-list="how"></ol></section>
<section><h2 data-t="checkTitle"></h2><ol data-list="check"></ol></section>
</main>
<script>
(async function () {
var dict = await fetch('about.i18n.json').then(function (r) { return r.json(); });
function pick(code) { return dict[code] ? code : 'ru'; }
function render(code) {
var t = dict[code];
document.documentElement.lang = code;
document.title = t.title;
document.querySelectorAll('[data-t]').forEach(function (el) { el.textContent = t[el.dataset.t]; });
document.querySelectorAll('[data-list]').forEach(function (el) {
el.replaceChildren.apply(el, t[el.dataset.list].map(function (s) { var li = document.createElement('li'); li.textContent = s; return li; }));
});
document.getElementById('lang').value = code;
}
var q = new URLSearchParams(location.search).get('lang');
var code = pick(q || (navigator.language || 'ru').slice(0, 2));
render(code);
document.getElementById('lang').addEventListener('change', function (e) { render(pick(e.target.value)); });
})();
</script>
</body>
</html>