2026-04-19 12:13:07 +02:00
|
|
|
<!DOCTYPE html>
|
2026-04-19 12:36:55 +02:00
|
|
|
<html lang="zh-CN">
|
2026-04-19 12:13:07 +02:00
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
2026-04-19 12:36:55 +02:00
|
|
|
<title>{{ page_title or "搬家助手" }}</title>
|
2026-04-21 22:39:47 +02:00
|
|
|
<link rel="stylesheet" href="/static/style.css">
|
2026-04-19 12:13:07 +02:00
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<main class="container">
|
2026-04-19 12:36:55 +02:00
|
|
|
<nav class="top-nav">
|
|
|
|
|
<a href="/boxes">箱子</a>
|
2026-04-19 13:00:11 +02:00
|
|
|
<a href="/search">搜索</a>
|
2026-04-19 12:36:55 +02:00
|
|
|
</nav>
|
2026-04-19 12:13:07 +02:00
|
|
|
{% block content %}{% endblock %}
|
|
|
|
|
</main>
|
2026-04-19 13:26:23 +02:00
|
|
|
<script>
|
2026-04-19 14:06:31 +02:00
|
|
|
document.addEventListener("click", function (event) {
|
|
|
|
|
const card = event.target.closest(".clickable-card[data-href]");
|
|
|
|
|
if (!card) return;
|
|
|
|
|
if (event.target.closest("a, button, form, input, textarea, select, label")) return;
|
|
|
|
|
|
|
|
|
|
window.location.href = card.dataset.href;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
document.addEventListener("keydown", function (event) {
|
|
|
|
|
const card = event.target.closest(".clickable-card[data-href]");
|
|
|
|
|
if (!card) return;
|
|
|
|
|
if (event.key !== "Enter" && event.key !== " ") return;
|
|
|
|
|
if (event.target.closest("a, button, form, input, textarea, select, label")) return;
|
|
|
|
|
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
window.location.href = card.dataset.href;
|
|
|
|
|
});
|
|
|
|
|
|
2026-04-19 13:26:23 +02:00
|
|
|
document.addEventListener("keydown", function (event) {
|
|
|
|
|
if (event.key !== "Enter") return;
|
|
|
|
|
if (event.target.tagName === "TEXTAREA") return;
|
|
|
|
|
if (event.target.type === "submit") return;
|
|
|
|
|
if (!event.target.closest("form")) return;
|
|
|
|
|
|
|
|
|
|
const focusable = Array.from(
|
|
|
|
|
event.target.form.querySelectorAll(
|
|
|
|
|
'input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]), textarea, select'
|
|
|
|
|
)
|
|
|
|
|
).filter((element) => !element.disabled);
|
|
|
|
|
|
|
|
|
|
const index = focusable.indexOf(event.target);
|
|
|
|
|
if (index === -1 || index === focusable.length - 1) return;
|
|
|
|
|
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
focusable[index + 1].focus();
|
|
|
|
|
if (focusable[index + 1].select) {
|
|
|
|
|
focusable[index + 1].select();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
</script>
|
2026-04-19 12:13:07 +02:00
|
|
|
</body>
|
|
|
|
|
</html>
|