modified: app.py

modified:   static/css/style.css
	modified:   templates/base.html
	modified:   templates/index.html
	modified:   templates/weather.html
	new file:   translations.py
This commit is contained in:
simon
2026-04-27 11:06:16 +02:00
parent e793804cea
commit 2b671b10ff
6 changed files with 285 additions and 57 deletions

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="de">
<html lang="{{ lang }}">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
@@ -15,17 +15,21 @@
<form class="nav-search" action="/wetter" method="get" autocomplete="off">
<div class="nav-search-wrap">
<svg class="nav-search-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>
<input type="text" name="ort" id="nav-ort" placeholder="Ort suchen …" value="{{ request.args.get('ort','') }}"/>
<input type="text" name="ort" id="nav-ort" placeholder="{{ T.nav_placeholder }}" value="{{ request.args.get('ort','') }}"/>
<ul class="ac-list" id="nav-ac"></ul>
</div>
</form>
<span class="nav-clock" id="nav-clock"></span>
<span class="nav-clock" id="nav-clock" data-suffix="{{ T.clock_suffix }}"></span>
<nav class="lang-switch" aria-label="Language">
<a href="/set-lang?lang=de&next={{ request.full_path }}" class="lang-btn{% if lang == 'de' %} lang-btn--active{% endif %}" hreflang="de">DE</a>
<a href="/set-lang?lang=en&next={{ request.full_path }}" class="lang-btn{% if lang == 'en' %} lang-btn--active{% endif %}" hreflang="en">EN</a>
</nav>
</nav>
<main>{% block content %}{% endblock %}</main>
<footer class="footer">
Wetterdaten: <a href="https://opendata.dwd.de" target="_blank" rel="noopener noreferrer">Deutscher Wetterdienst Open Data (MOSMIX)</a>
{{ T.data_source }} <a href="https://opendata.dwd.de" target="_blank" rel="noopener noreferrer">Deutscher Wetterdienst Open Data (MOSMIX)</a>
</footer>
<script>
@@ -73,6 +77,7 @@ window.setupAC = setupAC;
const tz = tzMeta ? tzMeta.getAttribute("content") : null;
const navClock = document.getElementById("nav-clock");
const heroTime = document.getElementById("hero-time");
const suffix = navClock ? (navClock.dataset.suffix ? " " + navClock.dataset.suffix : "") : "";
function tick() {
const now = new Date();
@@ -83,8 +88,8 @@ window.setupAC = setupAC;
} catch (e) {
timeStr = new Intl.DateTimeFormat("de-DE", opts).format(now);
}
if (navClock) navClock.textContent = timeStr + " Uhr";
if (heroTime) heroTime.textContent = timeStr + " Uhr";
if (navClock) navClock.textContent = timeStr + suffix;
if (heroTime) heroTime.textContent = timeStr + suffix;
}
tick();