Project_Horus/blog-post.html

171 lines
6.8 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Blog — Rawand Lorentzen</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Syne:wght@400;700;800&family=Inter:wght@300;400;500&display=swap" rel="stylesheet">
<style>
:root {
--bg: #f0f2f5;
--bg2: #e8ebef;
--surface: #ffffff;
--border: #d8dde6;
--accent: #2563eb;
--accent-lt: #eff6ff;
--text: #1e2530;
--text-mid: #4a5568;
--text-dim: #8896aa;
--mono: 'JetBrains Mono', monospace;
--sans: 'Syne', sans-serif;
--body: 'Inter', sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--body); }
nav {
position: fixed; top: 0; left: 0; right: 0; z-index: 100;
padding: 0 48px; height: 60px;
display: flex; justify-content: space-between; align-items: center;
background: rgba(240,242,245,0.92); backdrop-filter: blur(16px);
border-bottom: 1px solid var(--border);
}
.nav-logo { font-family: var(--sans); font-size: 16px; font-weight: 800; color: var(--text); text-decoration: none; }
.nav-logo span { color: var(--accent); }
.nav-back {
color: var(--text-mid); text-decoration: none; font-size: 13px; font-weight: 500;
padding: 6px 14px; border-radius: 6px; transition: all 0.15s;
}
.nav-back:hover { background: var(--accent-lt); color: var(--accent); }
.container { max-width: 720px; margin: 0 auto; padding: 96px 48px 80px; }
.post-meta {
font-family: var(--mono); font-size: 11px; color: var(--accent);
letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 16px;
}
.post-title {
font-family: var(--sans); font-size: clamp(28px, 4vw, 48px);
font-weight: 800; letter-spacing: -1.5px; color: var(--text);
line-height: 1.1; margin-bottom: 40px;
}
.post-body { font-size: 16px; line-height: 1.9; color: var(--text-mid); }
.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
font-family: var(--sans); color: var(--text); letter-spacing: -0.5px; margin: 40px 0 16px;
}
.post-body h1 { font-size: 32px; }
.post-body h2 { font-size: 26px; }
.post-body h3 { font-size: 20px; }
.post-body h4 { font-size: 16px; }
.post-body p { margin-bottom: 20px; }
.post-body strong { color: var(--text); font-weight: 500; }
.post-body em { font-style: italic; }
.post-body a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(37,99,235,0.3); transition: border-color 0.15s; }
.post-body a:hover { border-color: var(--accent); }
.post-body code {
font-family: var(--mono); font-size: 13px;
background: var(--bg2); padding: 2px 7px; border-radius: 4px;
color: var(--accent); border: 1px solid var(--border);
}
.post-body pre {
background: #1e2530; border-radius: 10px; padding: 24px;
overflow-x: auto; margin: 28px 0;
}
.post-body pre code {
background: none; color: #e2e8f0; padding: 0; border: none; font-size: 13.5px; line-height: 1.7;
}
.post-body ul, .post-body ol { padding-left: 28px; margin-bottom: 20px; }
.post-body li { margin-bottom: 6px; }
.post-body blockquote {
border-left: 3px solid var(--accent); padding: 12px 20px;
color: var(--text-dim); font-style: italic; margin: 24px 0;
background: var(--accent-lt); border-radius: 0 6px 6px 0;
}
.post-body hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }
.post-body img { max-width: 100%; border-radius: 8px; margin: 24px 0; }
.post-body table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14px; }
.post-body th, .post-body td { padding: 10px 14px; border: 1px solid var(--border); text-align: left; }
.post-body th { background: var(--bg2); font-weight: 500; color: var(--text); font-family: var(--mono); font-size: 12px; }
.not-found { text-align: center; padding: 80px 20px; }
.not-found .code { font-family: var(--mono); font-size: 48px; font-weight: 700; color: var(--accent); margin-bottom: 16px; }
.not-found p { color: var(--text-mid); margin-bottom: 24px; }
.not-found a { color: var(--accent); text-decoration: none; font-weight: 500; }
.empty-content {
background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
padding: 48px; text-align: center; color: var(--text-dim);
}
.empty-content p { margin-top: 8px; font-size: 13px; }
footer {
border-top: 1px solid var(--border); padding: 24px 48px;
display: flex; justify-content: space-between; align-items: center;
font-size: 12px; color: var(--text-dim); font-family: var(--mono);
background: var(--surface);
}
@media (max-width: 640px) {
nav { padding: 0 20px; }
.container { padding: 80px 24px 60px; }
footer { padding: 20px 24px; flex-direction: column; gap: 8px; }
}
</style>
</head>
<body>
<nav>
<a href="/" class="nav-logo">Rawand<span>.</span></a>
<a href="/#blog" class="nav-back">← Blog</a>
</nav>
<div class="container" id="container">
<div class="not-found">
<div class="code">...</div>
<p>Indlæser...</p>
</div>
</div>
<footer>
<span>rawandlorentzen.com</span>
<span>// blog</span>
<span>© 2026</span>
</footer>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script>
const slug = window.location.pathname.replace(/^\/blog\/?/, '').replace(/\/$/, '');
async function loadPost() {
const container = document.getElementById('container');
if (!slug) {
container.innerHTML = `<div class="not-found"><div class="code">404</div><p>Intet indlæg fundet.</p><a href="/#blog">← Tilbage til blog</a></div>`;
return;
}
try {
const res = await fetch('/api/blog/' + slug);
if (!res.ok) throw new Error('not found');
const post = await res.json();
document.title = post.title + ' — Rawand Lorentzen';
const bodyHtml = post.content
? marked.parse(post.content)
: `<div class="empty-content"><strong>Indholdet er på vej</strong><p>Dette indlæg er ikke skrevet endnu.</p></div>`;
container.innerHTML = `
<div class="post-meta">04 — Blog · ${post.date}</div>
<h1 class="post-title">${post.title}</h1>
<div class="post-body">${bodyHtml}</div>
`;
} catch {
container.innerHTML = `<div class="not-found"><div class="code">404</div><p>Indlægget blev ikke fundet.</p><a href="/#blog">← Tilbage til blog</a></div>`;
}
}
loadPost();
</script>
</body>
</html>