Russian-ALPR / app /templates /base.html
Naumeex's picture
Initial deploy: Russian ALPR
186b436
Raw
History Blame Contribute Delete
2.3 kB
<!DOCTYPE html>
<html lang="ru">
<head>
<script>
(function() {
const saved = localStorage.getItem('theme') || 'light';
document.documentElement.setAttribute('data-theme', saved);
})();
</script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}Распознавание номеров{% endblock %}</title>
<link rel="stylesheet" href="/static/style.css">
<link rel="icon" type="image/svg+xml" href="/static/logo.svg">
</head>
<body>
<header class="topbar">
<div class="container">
<a href="/" class="logo">
<img src="/static/logo.svg" alt="ALPR" height="42">
</a>
<nav>
<a href="/" class="{% if active == 'home' %}active{% endif %}">Загрузить</a>
<a href="/search" class="{% if active == 'search' %}active{% endif %}">История</a>
<a href="/registry" class="{% if active == 'registry' %}active{% endif %}">Реестр</a>
<a href="/docs" target="_blank">API</a>
<label class="theme-switch" title="Сменить тему">
<input type="checkbox" id="themeToggle">
<span class="theme-slider">
<span class="theme-icon sun"></span>
<span class="theme-icon moon"></span>
</span>
</label>
</nav>
</div>
</header>
<main class="container">
{% block content %}{% endblock %}
</main>
<footer class="container">
<p>Распознавание российских автомобильных номеров - 2026</p>
</footer>
{% block scripts %}{% endblock %}
<script>
(function() {
const toggle = document.getElementById('themeToggle');
const root = document.documentElement;
// Синхронизируем состояние чекбокса с текущей темой
function syncToggle() {
const theme = root.getAttribute('data-theme');
if (toggle) toggle.checked = (theme === 'dark');
}
syncToggle();
if (toggle) {
toggle.addEventListener('change', () => {
const next = toggle.checked ? 'dark' : 'light';
root.setAttribute('data-theme', next);
localStorage.setItem('theme', next);
});
}
})();
</script>
</body>
</html>