Files
zbiorki_app/zbiorka_app/templates/error.html
Mateusz Gruszczyński 5db242685b error handling
2026-03-20 11:03:58 +01:00

152 lines
4.0 KiB
HTML

<!doctype html>
<html lang="pl">
<head>
<meta charset="utf-8">
<title>{{ error_code }} {{ error_name }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
{% if asset_url is defined %}
<link rel="stylesheet" href="{{ asset_url('css/style.css') }}">
{% else %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
{% endif %}
<style>
:root {
color-scheme: dark;
--bg: #121212;
--surface-0: #1a1a1a;
--surface-1: #202020;
--surface-2: #2a2a2a;
--border: #3a3a3a;
--text: #e4e4e4;
--text-muted: #a8a8a8;
--accent: #f5c84c;
--accent-600: #e3b23f;
--accent-700: #cfa033;
--accent-300: #ffe083;
--radius: 10px;
--shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
--shadow-md: 0 4px 12px rgba(0, 0, 0, .45);
--trans: 220ms cubic-bezier(.2, .8, .2, 1);
}
html, body {
min-height: 100%;
}
body {
margin: 0;
padding: 0;
background: var(--bg);
color: var(--text);
font-family: 'Roboto', system-ui, -apple-system, Segoe UI, Arial, sans-serif;
}
a {
color: var(--accent);
text-decoration: none;
transition: color var(--trans);
}
a:hover {
color: var(--accent-300);
}
.error-page {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 2rem 1rem;
box-sizing: border-box;
}
.error-box {
width: 100%;
max-width: 720px;
text-align: center;
padding: 2.5rem 2rem;
border-radius: var(--radius);
background: var(--surface-1);
border: 1px solid var(--border);
box-shadow: var(--shadow-md);
}
.error-code {
font-size: 3rem;
font-weight: 700;
line-height: 1;
margin-bottom: .5rem;
color: var(--accent);
}
.error-name {
font-size: 1.6rem;
margin: 0 0 .75rem;
color: var(--text);
}
.error-message {
margin: 0 0 1.5rem;
color: var(--text-muted);
line-height: 1.5;
}
.error-actions a {
display: inline-block;
padding: .6rem 1.3rem;
border-radius: 8px;
font-weight: 700;
background-color: var(--accent);
border: 1px solid var(--accent-600);
color: #111;
transition: transform 120ms ease, background-color var(--trans), border-color var(--trans), color var(--trans);
}
.error-actions a:hover {
background-color: var(--accent-600);
border-color: var(--accent-700);
color: #111;
transform: translateY(-1px);
}
.error-actions a:active {
background-color: var(--accent-700);
border-color: var(--accent-700);
transform: translateY(0);
}
@media (max-width: 576px) {
.error-box {
padding: 2rem 1.25rem;
}
.error-code {
font-size: 2.4rem;
}
.error-name {
font-size: 1.3rem;
}
}
</style>
</head>
<body>
<main class="error-page">
<section class="error-box">
<div class="error-code">{{ error_code }}</div>
<h1 class="error-name">{{ error_name }}</h1>
<p class="error-message">{{ error_message }}</p>
<div class="error-actions">
<a href="/">Powrot na strone glowna</a>
</div>
</section>
</main>
</body>
</html>