Files
mans 7efc16cf06
Build docker container / Build image (push) Successful in 5m27s
refactor: extract DRY template layout and add localized page titles
2026-08-05 17:43:40 +02:00

136 lines
4.0 KiB
HTML

{{ define "layout" }}<!DOCTYPE html>
<html lang="en">
<head>
<title>{{ block "page_title" . }}MYIP{{ end }}</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
:root {
--bg-color: #ffffff;
--text-color: #333333;
--bold-color: #000000;
--label-color: #555555;
--border-color: #dddddd;
--link-color: #444444;
--link-hover: #000000;
--divider-color: #888888;
}
@media (prefers-color-scheme: dark) {
:root {
--bg-color: #121212;
--text-color: #e0e0e0;
--bold-color: #ffffff;
--label-color: #aaaaaa;
--border-color: #333333;
--link-color: #bbbbbb;
--link-hover: #ffffff;
--divider-color: #666666;
}
}
body {
font-family: Arial, sans-serif;
background-color: var(--bg-color);
color: var(--text-color);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
margin: 0;
padding: 20px 20px 80px 20px;
box-sizing: border-box;
position: relative;
}
ul {
list-style: none;
padding: 0;
margin: 0;
width: 100%;
}
li {
padding: 10px 0px;
border-bottom: 1px solid var(--border-color);
word-wrap: break-word;
word-break: break-all;
}
li:last-child {
border-bottom: none;
}
.label {
color: var(--label-color);
}
b {
color: var(--bold-color);
}
h2 {
font-size: 1.4rem;
margin-top: 0;
margin-bottom: 10px;
color: var(--bold-color);
border-bottom: 2px solid var(--bold-color);
padding-bottom: 5px;
display: inline-block;
}
.bottom-links {
position: absolute;
bottom: 40px;
left: 50%;
transform: translateX(-50%);
display: flex;
align-items: center;
}
.nav-link {
font-size: 1.2rem;
color: var(--link-color);
text-decoration: underline;
text-underline-offset: 4px;
text-decoration-thickness: 2px;
transition: color 0.2s ease;
cursor: pointer;
white-space: nowrap;
}
.nav-link:hover {
color: var(--link-hover);
}
{{ block "extra_css" . }}{{ end }}
</style>
</head>
<body>
{{ block "content" . }}{{ end }}
<div class="bottom-links">
{{ block "nav_links" . }}{{ end }}
</div>
<script>
document.addEventListener('keydown', (e) => {
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return;
const key = e.key.toLowerCase();
if (key === 'c') {
const btn = document.getElementById('copy-btn');
if (btn) btn.click();
} else if (key === 'a') {
window.location.href = '/advanced';
} else if (key === 's') {
window.location.href = '/';
} else if (key === 'h') {
window.location.href = '/headers';
}
});
document.addEventListener('dblclick', (e) => {
const bTag = e.target.closest('b');
if (bTag) {
const selection = window.getSelection();
const range = document.createRange();
range.selectNodeContents(bTag);
selection.removeAllRanges();
selection.addRange(range);
}
});
{{ block "extra_js" . }}{{ end }}
</script>
</body>
</html>
{{ end }}