@@ -0,0 +1,382 @@
|
||||
(() => {
|
||||
'use strict';
|
||||
|
||||
const $ = (selector, root = document) => root.querySelector(selector);
|
||||
const state = {
|
||||
query: '',
|
||||
page: 1,
|
||||
pageSize: 20,
|
||||
total: 0,
|
||||
totalPages: 0,
|
||||
facets: null,
|
||||
config: null,
|
||||
currentKey: null,
|
||||
currentDoc: null,
|
||||
};
|
||||
|
||||
const els = {
|
||||
brandTitle: $('#brandTitle'), brandSubtitle: $('#brandSubtitle'), countBadge: $('#countBadge'),
|
||||
hero: $('#hero'), heroSearchForm: $('#heroSearchForm'), heroSearch: $('#heroSearch'), quickLinks: $('#quickLinks'),
|
||||
resultsView: $('#resultsView'), topSearchForm: $('#topSearchForm'), topSearch: $('#topSearch'),
|
||||
resultCount: $('#resultCount'), resultHint: $('#resultHint'), clearSearch: $('#clearSearch'), sideFacets: $('#sideFacets'),
|
||||
loading: $('#loading'), noResults: $('#noResults'), resultList: $('#resultList'), pagination: $('#pagination'),
|
||||
articleDialog: $('#articleDialog'), closeArticle: $('#closeArticle'), articleEyebrow: $('#articleEyebrow'),
|
||||
articleTitle: $('#articleTitle'), articleMeta: $('#articleMeta'), problemSection: $('#problemSection'),
|
||||
articleProblem: $('#articleProblem'), answerSection: $('#answerSection'), articleAnswer: $('#articleAnswer'),
|
||||
tagsSection: $('#tagsSection'), articleTags: $('#articleTags'), sourceSection: $('#sourceSection'),
|
||||
articleSource: $('#articleSource'), articleSourceUri: $('#articleSourceUri'), sourceLink: $('#sourceLink'),
|
||||
articlePath: $('#articlePath'), copyAnswer: $('#copyAnswer'), copyLink: $('#copyLink'), toastHost: $('#toastHost'),
|
||||
};
|
||||
|
||||
async function api(url) {
|
||||
const response = await fetch(url, {headers: {'Accept': 'application/json'}});
|
||||
const body = await response.json().catch(() => ({}));
|
||||
if (!response.ok) throw new Error(body.error || `${response.status} ${response.statusText}`);
|
||||
return body;
|
||||
}
|
||||
|
||||
function escapeHTML(value) {
|
||||
return String(value ?? '').replace(/[&<>'"]/g, c => ({'&':'&','<':'<','>':'>',"'":''','"':'"'}[c]));
|
||||
}
|
||||
|
||||
function escapeRegex(value) {
|
||||
return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
}
|
||||
|
||||
function highlighted(value, query = state.query) {
|
||||
let safe = escapeHTML(value);
|
||||
const terms = [...new Set(String(query).trim().split(/\s+/).filter(Boolean))]
|
||||
.sort((a, b) => b.length - a.length);
|
||||
if (!terms.length) return safe;
|
||||
const regex = new RegExp(`(${terms.map(escapeRegex).join('|')})`, 'gi');
|
||||
return safe.replace(regex, '<mark>$1</mark>');
|
||||
}
|
||||
|
||||
function qs(params) {
|
||||
const out = new URLSearchParams();
|
||||
Object.entries(params).forEach(([key, value]) => {
|
||||
if (value !== '' && value !== null && value !== undefined) out.set(key, String(value));
|
||||
});
|
||||
return out.toString();
|
||||
}
|
||||
|
||||
function updateURL({replace = false} = {}) {
|
||||
const params = new URLSearchParams();
|
||||
if (state.query) params.set('q', state.query);
|
||||
if (state.page > 1) params.set('page', String(state.page));
|
||||
if (state.currentKey) params.set('doc', state.currentKey);
|
||||
const url = `${location.pathname}${params.toString() ? `?${params}` : ''}`;
|
||||
history[replace ? 'replaceState' : 'pushState']({}, '', url);
|
||||
}
|
||||
|
||||
async function loadBootstrap() {
|
||||
try {
|
||||
const [config, health, facets] = await Promise.all([
|
||||
api('/api/config'), api('/api/health'), api('/api/facets?limit=10')
|
||||
]);
|
||||
state.config = config;
|
||||
state.facets = facets;
|
||||
document.title = config.title || 'Helpdesk Search';
|
||||
els.brandTitle.textContent = config.title || 'Helpdesk Search';
|
||||
els.brandSubtitle.textContent = config.subtitle || 'Interne Wissenssuche für den Helpdesk';
|
||||
els.countBadge.textContent = `${Number(health.count || 0).toLocaleString('de-DE')} Wissenseinträge`;
|
||||
renderFacets();
|
||||
} catch (error) {
|
||||
els.countBadge.textContent = 'Wissensbasis nicht erreichbar';
|
||||
toast(error.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
function renderFacets() {
|
||||
const categories = (state.facets?.categories?.length ? state.facets.categories : state.facets?.keywords) || [];
|
||||
els.quickLinks.innerHTML = '';
|
||||
els.sideFacets.innerHTML = '';
|
||||
categories.slice(0, 7).forEach((facet) => {
|
||||
const heroButton = document.createElement('button');
|
||||
heroButton.type = 'button';
|
||||
heroButton.className = 'quick-chip';
|
||||
heroButton.innerHTML = `<span>${escapeHTML(facet.name)}</span><small>${facet.count.toLocaleString('de-DE')}</small>`;
|
||||
heroButton.addEventListener('click', () => submitSearch(facet.name));
|
||||
els.quickLinks.appendChild(heroButton);
|
||||
|
||||
const sideButton = document.createElement('button');
|
||||
sideButton.type = 'button';
|
||||
sideButton.className = 'facet-button';
|
||||
sideButton.innerHTML = `<span>${escapeHTML(facet.name)}</span><small>${facet.count.toLocaleString('de-DE')}</small>`;
|
||||
sideButton.addEventListener('click', () => submitSearch(facet.name));
|
||||
els.sideFacets.appendChild(sideButton);
|
||||
});
|
||||
}
|
||||
|
||||
async function runSearch() {
|
||||
const query = state.query.trim();
|
||||
if (!query) {
|
||||
showHome();
|
||||
return;
|
||||
}
|
||||
|
||||
showResults();
|
||||
els.loading.classList.remove('hidden');
|
||||
els.noResults.classList.add('hidden');
|
||||
els.resultList.innerHTML = '';
|
||||
els.pagination.classList.add('hidden');
|
||||
|
||||
try {
|
||||
const data = await api(`/api/search?${qs({q: query, page: state.page, page_size: state.pageSize})}`);
|
||||
state.page = data.page || 1;
|
||||
state.total = data.total || 0;
|
||||
state.totalPages = data.total_pages || 0;
|
||||
renderResults(data.items || []);
|
||||
renderPagination();
|
||||
els.resultCount.textContent = `${state.total.toLocaleString('de-DE')} ${state.total === 1 ? 'Treffer' : 'Treffer'}`;
|
||||
els.resultHint.textContent = `für „${query}“`;
|
||||
if (!state.total) els.noResults.classList.remove('hidden');
|
||||
} catch (error) {
|
||||
els.resultCount.textContent = 'Suche fehlgeschlagen';
|
||||
els.resultHint.textContent = '';
|
||||
toast(error.message, 'error');
|
||||
} finally {
|
||||
els.loading.classList.add('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
function renderResults(items) {
|
||||
els.resultList.innerHTML = '';
|
||||
for (const item of items) {
|
||||
const card = document.createElement('article');
|
||||
card.className = 'result-card';
|
||||
const tags = [...(item.categories || []), ...(item.keywords || [])].slice(0, 4);
|
||||
card.innerHTML = `
|
||||
<button class="result-main" type="button">
|
||||
<div class="result-overline">
|
||||
<span class="result-id">${highlighted(item.id || item.rel_path)}</span>
|
||||
${item.source ? `<span class="result-source">${escapeHTML(item.source)}</span>` : ''}
|
||||
</div>
|
||||
<h2>${highlighted(item.title || '(ohne Titel)')}</h2>
|
||||
${item.excerpt ? `<p>${highlighted(item.excerpt)}</p>` : '<p class="muted">Kein Beschreibungstext hinterlegt.</p>'}
|
||||
<div class="result-tags">${tags.map(tag => `<span>${highlighted(tag)}</span>`).join('')}</div>
|
||||
</button>
|
||||
<div class="result-arrow" aria-hidden="true">→</div>`;
|
||||
$('.result-main', card).addEventListener('click', () => openArticle(item.key));
|
||||
card.addEventListener('dblclick', () => openArticle(item.key));
|
||||
els.resultList.appendChild(card);
|
||||
}
|
||||
}
|
||||
|
||||
function renderPagination() {
|
||||
els.pagination.innerHTML = '';
|
||||
if (state.totalPages <= 1) {
|
||||
els.pagination.classList.add('hidden');
|
||||
return;
|
||||
}
|
||||
els.pagination.classList.remove('hidden');
|
||||
|
||||
const add = (label, page, {active = false, disabled = false, aria = ''} = {}) => {
|
||||
const button = document.createElement('button');
|
||||
button.type = 'button';
|
||||
button.textContent = label;
|
||||
button.className = `page-btn${active ? ' active' : ''}`;
|
||||
button.disabled = disabled;
|
||||
if (aria) button.setAttribute('aria-label', aria);
|
||||
button.addEventListener('click', () => goPage(page));
|
||||
els.pagination.appendChild(button);
|
||||
};
|
||||
|
||||
add('‹', state.page - 1, {disabled: state.page <= 1, aria: 'Vorherige Seite'});
|
||||
const pages = pageWindow(state.page, state.totalPages);
|
||||
let previous = 0;
|
||||
pages.forEach(page => {
|
||||
if (previous && page - previous > 1) {
|
||||
const gap = document.createElement('span');
|
||||
gap.className = 'page-gap';
|
||||
gap.textContent = '…';
|
||||
els.pagination.appendChild(gap);
|
||||
}
|
||||
add(String(page), page, {active: page === state.page, aria: `Seite ${page}`});
|
||||
previous = page;
|
||||
});
|
||||
add('›', state.page + 1, {disabled: state.page >= state.totalPages, aria: 'Nächste Seite'});
|
||||
}
|
||||
|
||||
function pageWindow(current, total) {
|
||||
const candidates = new Set([1, total]);
|
||||
for (let page = current - 2; page <= current + 2; page++) {
|
||||
if (page >= 1 && page <= total) candidates.add(page);
|
||||
}
|
||||
return [...candidates].sort((a, b) => a - b);
|
||||
}
|
||||
|
||||
function goPage(page) {
|
||||
if (page < 1 || page > state.totalPages || page === state.page) return;
|
||||
state.page = page;
|
||||
state.currentKey = null;
|
||||
updateURL();
|
||||
runSearch();
|
||||
window.scrollTo({top: 0, behavior: 'smooth'});
|
||||
}
|
||||
|
||||
function submitSearch(value) {
|
||||
const query = String(value ?? '').trim();
|
||||
if (!query) return;
|
||||
state.query = query;
|
||||
state.page = 1;
|
||||
state.currentKey = null;
|
||||
els.heroSearch.value = query;
|
||||
els.topSearch.value = query;
|
||||
updateURL();
|
||||
runSearch();
|
||||
}
|
||||
|
||||
function showHome() {
|
||||
state.query = '';
|
||||
state.page = 1;
|
||||
state.currentKey = null;
|
||||
els.hero.classList.remove('hidden');
|
||||
els.resultsView.classList.add('hidden');
|
||||
els.heroSearch.value = '';
|
||||
updateURL({replace: true});
|
||||
setTimeout(() => els.heroSearch.focus(), 0);
|
||||
}
|
||||
|
||||
function showResults() {
|
||||
els.hero.classList.add('hidden');
|
||||
els.resultsView.classList.remove('hidden');
|
||||
els.topSearch.value = state.query;
|
||||
}
|
||||
|
||||
async function openArticle(key, {updateHistory = true} = {}) {
|
||||
try {
|
||||
const data = await api(`/api/items/${encodeURIComponent(key)}`);
|
||||
state.currentKey = key;
|
||||
state.currentDoc = data.document || {};
|
||||
renderArticle(state.currentDoc, data.meta || {});
|
||||
if (updateHistory) updateURL();
|
||||
if (!els.articleDialog.open) els.articleDialog.showModal();
|
||||
} catch (error) {
|
||||
toast(error.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
function renderArticle(doc, meta) {
|
||||
els.articleEyebrow.textContent = doc.id || meta.rel_path || 'Wissensartikel';
|
||||
els.articleTitle.textContent = doc.title || '(ohne Titel)';
|
||||
els.articleProblem.textContent = doc.text || '';
|
||||
els.articleAnswer.textContent = doc.answer || '';
|
||||
els.problemSection.classList.toggle('hidden', !doc.text);
|
||||
els.answerSection.classList.toggle('hidden', !doc.answer);
|
||||
|
||||
const metaParts = [];
|
||||
if (doc.language) metaParts.push(doc.language);
|
||||
if (doc.communication_style) metaParts.push(doc.communication_style);
|
||||
if (typeof doc.auto_reply === 'boolean') metaParts.push(`auto_reply: ${doc.auto_reply}`);
|
||||
if (doc.min_score !== undefined && doc.min_score !== null) metaParts.push(`min_score: ${doc.min_score}`);
|
||||
els.articleMeta.innerHTML = metaParts.map(value => `<span>${escapeHTML(value)}</span>`).join('');
|
||||
|
||||
const tags = [...new Set([...(Array.isArray(doc.categories) ? doc.categories : []), ...(Array.isArray(doc.keywords) ? doc.keywords : [])])];
|
||||
els.articleTags.innerHTML = tags.map(tag => `<span>${escapeHTML(tag)}</span>`).join('');
|
||||
els.tagsSection.classList.toggle('hidden', tags.length === 0);
|
||||
|
||||
const source = String(doc.source || '').trim();
|
||||
const sourceURI = safeURL(doc.source_uri);
|
||||
els.articleSource.textContent = source || 'Quelle';
|
||||
els.articleSourceUri.textContent = sourceURI || '';
|
||||
els.sourceSection.classList.toggle('hidden', !source && !sourceURI);
|
||||
els.sourceLink.classList.toggle('hidden', !sourceURI);
|
||||
if (sourceURI) els.sourceLink.href = sourceURI;
|
||||
else els.sourceLink.removeAttribute('href');
|
||||
|
||||
els.articlePath.textContent = meta.rel_path || '';
|
||||
}
|
||||
|
||||
function safeURL(value) {
|
||||
const raw = String(value || '').trim();
|
||||
if (!raw) return '';
|
||||
try {
|
||||
const parsed = new URL(raw);
|
||||
return ['http:', 'https:'].includes(parsed.protocol) ? parsed.href : '';
|
||||
} catch (_) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
function closeArticle({updateHistory = true} = {}) {
|
||||
if (els.articleDialog.open) els.articleDialog.close();
|
||||
state.currentKey = null;
|
||||
state.currentDoc = null;
|
||||
if (updateHistory) updateURL({replace: true});
|
||||
}
|
||||
|
||||
async function copyText(text, message) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
toast(message, 'success');
|
||||
} catch (_) {
|
||||
toast('Kopieren wurde vom Browser blockiert.', 'error');
|
||||
}
|
||||
}
|
||||
|
||||
function toast(message, type = '') {
|
||||
const el = document.createElement('div');
|
||||
el.className = `toast ${type}`;
|
||||
el.textContent = message;
|
||||
els.toastHost.appendChild(el);
|
||||
setTimeout(() => el.remove(), 3200);
|
||||
}
|
||||
|
||||
function bindEvents() {
|
||||
els.heroSearchForm.addEventListener('submit', event => {
|
||||
event.preventDefault();
|
||||
submitSearch(els.heroSearch.value);
|
||||
});
|
||||
els.topSearchForm.addEventListener('submit', event => {
|
||||
event.preventDefault();
|
||||
submitSearch(els.topSearch.value);
|
||||
});
|
||||
els.clearSearch.addEventListener('click', showHome);
|
||||
els.closeArticle.addEventListener('click', () => closeArticle());
|
||||
els.articleDialog.addEventListener('click', event => {
|
||||
if (event.target === els.articleDialog) closeArticle();
|
||||
});
|
||||
els.articleDialog.addEventListener('cancel', event => {
|
||||
event.preventDefault();
|
||||
closeArticle();
|
||||
});
|
||||
els.copyAnswer.addEventListener('click', () => copyText(String(state.currentDoc?.answer || ''), 'Antwort kopiert.'));
|
||||
els.copyLink.addEventListener('click', () => copyText(location.href, 'Artikellink kopiert.'));
|
||||
|
||||
document.addEventListener('keydown', event => {
|
||||
if (event.key === '/' && !['INPUT', 'TEXTAREA'].includes(document.activeElement?.tagName)) {
|
||||
event.preventDefault();
|
||||
(state.query ? els.topSearch : els.heroSearch).focus();
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener('popstate', () => hydrateFromURL({historyNavigation: true}));
|
||||
}
|
||||
|
||||
async function hydrateFromURL({historyNavigation = false} = {}) {
|
||||
const params = new URLSearchParams(location.search);
|
||||
state.query = (params.get('q') || '').trim();
|
||||
state.page = Math.max(1, Number.parseInt(params.get('page') || '1', 10) || 1);
|
||||
const docKey = params.get('doc') || '';
|
||||
|
||||
if (state.query) {
|
||||
els.heroSearch.value = state.query;
|
||||
els.topSearch.value = state.query;
|
||||
await runSearch();
|
||||
} else {
|
||||
showHome();
|
||||
}
|
||||
|
||||
if (docKey) await openArticle(docKey, {updateHistory: false});
|
||||
else if (historyNavigation && els.articleDialog.open) closeArticle({updateHistory: false});
|
||||
}
|
||||
|
||||
async function init() {
|
||||
bindEvents();
|
||||
await loadBootstrap();
|
||||
await hydrateFromURL();
|
||||
}
|
||||
|
||||
init();
|
||||
})();
|
||||
@@ -0,0 +1,142 @@
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="color-scheme" content="light dark">
|
||||
<title>Helpdesk Search</title>
|
||||
<link rel="stylesheet" href="/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<header class="topbar">
|
||||
<a class="brand" href="/" aria-label="Zur Startseite">
|
||||
<span class="brand-mark">H</span>
|
||||
<span class="brand-copy">
|
||||
<strong id="brandTitle">Helpdesk Search</strong>
|
||||
<small id="brandSubtitle">Interne Wissenssuche für den Helpdesk</small>
|
||||
</span>
|
||||
</a>
|
||||
<div class="top-meta">
|
||||
<span class="mode-badge">Nur lesen</span>
|
||||
<span id="countBadge" class="count-badge">Wissensbasis lädt …</span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<section id="hero" class="hero">
|
||||
<div class="hero-orb orb-one"></div>
|
||||
<div class="hero-orb orb-two"></div>
|
||||
<div class="hero-content">
|
||||
<div class="eyebrow">INTERNES HELPDESK-WISSEN</div>
|
||||
<h1>Was möchtest du lösen?</h1>
|
||||
<p>Durchsuche Fehlercodes, Symptome, Produkte, Keywords und dokumentierte Lösungen in einer zentralen Wissensbasis.</p>
|
||||
<form id="heroSearchForm" class="search-box hero-search" role="search">
|
||||
<span class="search-icon" aria-hidden="true">⌕</span>
|
||||
<input id="heroSearch" type="search" placeholder="z. B. 0x80070005, Outlook startet nicht, BitLocker …" autocomplete="off" autofocus>
|
||||
<kbd>/</kbd>
|
||||
<button type="submit">Suchen</button>
|
||||
</form>
|
||||
<div id="quickLinks" class="quick-links" aria-label="Häufige Kategorien"></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="resultsView" class="results-view hidden">
|
||||
<div class="results-header">
|
||||
<form id="topSearchForm" class="search-box top-search" role="search">
|
||||
<span class="search-icon" aria-hidden="true">⌕</span>
|
||||
<input id="topSearch" type="search" autocomplete="off" aria-label="Wissensbasis durchsuchen">
|
||||
<button type="submit">Suchen</button>
|
||||
</form>
|
||||
<div class="results-summary">
|
||||
<div>
|
||||
<strong id="resultCount">0 Treffer</strong>
|
||||
<span id="resultHint"></span>
|
||||
</div>
|
||||
<button id="clearSearch" class="text-btn" type="button">Neue Suche</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="results-layout">
|
||||
<aside class="side-panel">
|
||||
<div class="side-card">
|
||||
<span class="side-label">Schnellzugriff</span>
|
||||
<div id="sideFacets" class="facet-list"></div>
|
||||
</div>
|
||||
<div class="side-card help-card">
|
||||
<span class="help-icon">?</span>
|
||||
<strong>Such-Tipp</strong>
|
||||
<p>Fehlercodes wie <code>0x80070005</code> oder konkrete Meldungsteile liefern meist die präzisesten Treffer.</p>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<div class="results-column">
|
||||
<div id="loading" class="loading hidden"><span></span><span></span><span></span></div>
|
||||
<div id="noResults" class="no-results hidden">
|
||||
<div class="no-results-icon">⌕</div>
|
||||
<h2>Keine passenden Einträge gefunden</h2>
|
||||
<p>Versuche einen kürzeren Fehlercode, einen Produktnamen oder einzelne Wörter aus der Fehlermeldung.</p>
|
||||
</div>
|
||||
<div id="resultList" class="result-list" aria-live="polite"></div>
|
||||
<nav id="pagination" class="pagination hidden" aria-label="Suchergebnisse"></nav>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<dialog id="articleDialog" class="article-dialog">
|
||||
<article class="article-shell">
|
||||
<header class="article-head">
|
||||
<div>
|
||||
<div id="articleEyebrow" class="article-eyebrow"></div>
|
||||
<h2 id="articleTitle"></h2>
|
||||
</div>
|
||||
<button id="closeArticle" class="close-btn" type="button" aria-label="Artikel schließen">×</button>
|
||||
</header>
|
||||
|
||||
<div class="article-body">
|
||||
<div id="articleMeta" class="meta-row"></div>
|
||||
|
||||
<section id="problemSection" class="article-section">
|
||||
<div class="section-kicker">PROBLEM / ERKENNUNG</div>
|
||||
<div id="articleProblem" class="article-text"></div>
|
||||
</section>
|
||||
|
||||
<section id="answerSection" class="article-section answer-section">
|
||||
<div class="answer-head">
|
||||
<div>
|
||||
<div class="section-kicker">LÖSUNG / ANTWORT</div>
|
||||
<strong>Empfohlene Vorgehensweise</strong>
|
||||
</div>
|
||||
<button id="copyAnswer" class="copy-btn" type="button">Antwort kopieren</button>
|
||||
</div>
|
||||
<div id="articleAnswer" class="article-text answer-text"></div>
|
||||
</section>
|
||||
|
||||
<section id="tagsSection" class="article-section compact-section">
|
||||
<div class="section-kicker">EINORDNUNG</div>
|
||||
<div id="articleTags" class="tag-list"></div>
|
||||
</section>
|
||||
|
||||
<section id="sourceSection" class="article-section source-section hidden">
|
||||
<div class="section-kicker">QUELLE</div>
|
||||
<div class="source-line">
|
||||
<div>
|
||||
<strong id="articleSource"></strong>
|
||||
<span id="articleSourceUri"></span>
|
||||
</div>
|
||||
<a id="sourceLink" class="source-link" href="#" target="_blank" rel="noopener noreferrer">Quelle öffnen ↗</a>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<footer class="article-foot">
|
||||
<span id="articlePath"></span>
|
||||
<button id="copyLink" class="text-btn" type="button">Link zu diesem Artikel kopieren</button>
|
||||
</footer>
|
||||
</article>
|
||||
</dialog>
|
||||
|
||||
<div id="toastHost" class="toast-host" aria-live="polite"></div>
|
||||
<script src="/app.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,231 @@
|
||||
:root {
|
||||
color-scheme: dark;
|
||||
--bg: #08101f;
|
||||
--bg-soft: #0d1729;
|
||||
--panel: rgba(14, 25, 44, .86);
|
||||
--panel-solid: #101c30;
|
||||
--line: rgba(139, 164, 205, .16);
|
||||
--line-strong: rgba(139, 164, 205, .28);
|
||||
--text: #ecf3ff;
|
||||
--muted: #95a8c6;
|
||||
--faint: #6d819f;
|
||||
--accent: #79a7ff;
|
||||
--accent-2: #8f7cff;
|
||||
--accent-soft: rgba(121, 167, 255, .12);
|
||||
--green: #64d9ad;
|
||||
--danger: #ff8490;
|
||||
--shadow: 0 22px 70px rgba(0, 0, 0, .36);
|
||||
--radius: 18px;
|
||||
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
html { min-height: 100%; background: var(--bg); }
|
||||
body {
|
||||
min-height: 100vh;
|
||||
margin: 0;
|
||||
color: var(--text);
|
||||
background:
|
||||
radial-gradient(circle at 14% -10%, rgba(84, 122, 255, .11), transparent 30rem),
|
||||
radial-gradient(circle at 95% 24%, rgba(127, 91, 255, .08), transparent 27rem),
|
||||
var(--bg);
|
||||
}
|
||||
button, input { font: inherit; }
|
||||
button { color: inherit; }
|
||||
button, a { -webkit-tap-highlight-color: transparent; }
|
||||
.hidden { display: none !important; }
|
||||
|
||||
.topbar {
|
||||
height: 72px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 20px;
|
||||
padding: 0 clamp(20px, 4vw, 64px);
|
||||
border-bottom: 1px solid var(--line);
|
||||
background: rgba(8, 16, 31, .76);
|
||||
backdrop-filter: blur(18px);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 20;
|
||||
}
|
||||
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; min-width: 0; }
|
||||
.brand-mark {
|
||||
width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto;
|
||||
border: 1px solid rgba(121, 167, 255, .35); border-radius: 12px;
|
||||
background: linear-gradient(135deg, rgba(121,167,255,.22), rgba(143,124,255,.16));
|
||||
color: #cfe0ff; font-weight: 800; box-shadow: inset 0 1px rgba(255,255,255,.08);
|
||||
}
|
||||
.brand-copy { min-width: 0; display: grid; gap: 2px; }
|
||||
.brand-copy strong { font-size: 14px; letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.brand-copy small { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.top-meta { display: flex; align-items: center; gap: 9px; }
|
||||
.mode-badge, .count-badge {
|
||||
border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 999px;
|
||||
color: var(--muted); padding: 6px 10px; font-size: 10px; white-space: nowrap;
|
||||
}
|
||||
.mode-badge { color: #9ee5ca; border-color: rgba(100,217,173,.2); background: rgba(100,217,173,.06); }
|
||||
|
||||
.hero { min-height: calc(100vh - 72px); display: grid; place-items: center; position: relative; overflow: hidden; padding: 56px 24px 100px; }
|
||||
.hero-content { width: min(900px, 100%); text-align: center; position: relative; z-index: 2; }
|
||||
.eyebrow, .section-kicker, .side-label, .article-eyebrow {
|
||||
color: #93b6fa; font-weight: 760; font-size: 10px; letter-spacing: .13em;
|
||||
}
|
||||
.hero h1 { margin: 17px 0 13px; font-size: clamp(36px, 6vw, 64px); line-height: 1.02; letter-spacing: -.045em; }
|
||||
.hero p { color: var(--muted); margin: 0 auto 34px; max-width: 680px; font-size: clamp(14px, 2vw, 17px); line-height: 1.65; }
|
||||
.hero-orb { position: absolute; border-radius: 50%; filter: blur(1px); pointer-events: none; }
|
||||
.orb-one { width: 420px; height: 420px; top: 12%; left: -250px; background: radial-gradient(circle, rgba(69,128,255,.11), transparent 68%); }
|
||||
.orb-two { width: 520px; height: 520px; bottom: -270px; right: -180px; background: radial-gradient(circle, rgba(127,91,255,.11), transparent 68%); }
|
||||
|
||||
.search-box {
|
||||
display: flex; align-items: center; gap: 10px;
|
||||
border: 1px solid var(--line-strong); background: rgba(14, 25, 44, .92);
|
||||
box-shadow: 0 16px 60px rgba(0,0,0,.25), inset 0 1px rgba(255,255,255,.035);
|
||||
transition: border-color .18s, box-shadow .18s, transform .18s;
|
||||
}
|
||||
.search-box:focus-within { border-color: rgba(121,167,255,.7); box-shadow: 0 18px 70px rgba(0,0,0,.3), 0 0 0 4px rgba(121,167,255,.08); }
|
||||
.hero-search { min-height: 64px; padding: 7px 8px 7px 20px; border-radius: 21px; }
|
||||
.top-search { min-height: 54px; padding: 5px 6px 5px 17px; border-radius: 16px; width: min(840px, 100%); }
|
||||
.search-icon { color: #a8bfeb; font-size: 24px; line-height: 1; transform: rotate(-15deg); }
|
||||
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
|
||||
.hero-search input { font-size: clamp(15px, 2vw, 18px); }
|
||||
.search-box input::placeholder { color: #6f83a2; }
|
||||
.search-box button {
|
||||
border: 0; border-radius: 14px; background: linear-gradient(135deg, #6f9df5, #8072ec);
|
||||
min-height: 46px; padding: 0 20px; font-weight: 720; font-size: 12px; cursor: pointer;
|
||||
box-shadow: inset 0 1px rgba(255,255,255,.2), 0 8px 24px rgba(87,107,224,.2);
|
||||
}
|
||||
kbd { border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; color: var(--faint); background: rgba(255,255,255,.025); font-size: 10px; }
|
||||
.quick-links { margin-top: 22px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
|
||||
.quick-chip, .facet-button {
|
||||
border: 1px solid var(--line); background: rgba(255,255,255,.025); color: #bbcae2; cursor: pointer;
|
||||
transition: border-color .15s, background .15s, transform .15s;
|
||||
}
|
||||
.quick-chip:hover, .facet-button:hover { border-color: rgba(121,167,255,.4); background: rgba(121,167,255,.08); transform: translateY(-1px); }
|
||||
.quick-chip { border-radius: 999px; padding: 7px 11px; display: inline-flex; gap: 8px; align-items: center; font-size: 10px; }
|
||||
.quick-chip small, .facet-button small { color: var(--faint); }
|
||||
|
||||
.results-view { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 80px; }
|
||||
.results-header { padding: 0 min(280px, 22vw) 24px 0; }
|
||||
.results-summary { min-height: 48px; display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-top: 20px; border-bottom: 1px solid var(--line); padding-bottom: 15px; }
|
||||
.results-summary > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; }
|
||||
.results-summary strong { font-size: 13px; }
|
||||
.results-summary span { color: var(--muted); font-size: 12px; }
|
||||
.text-btn { border: 0; background: transparent; color: #93b6fa; cursor: pointer; padding: 5px; font-size: 11px; }
|
||||
.text-btn:hover { color: #c5d8ff; }
|
||||
.results-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 34px; align-items: start; }
|
||||
.side-panel { display: grid; gap: 13px; position: sticky; top: 102px; }
|
||||
.side-card { border: 1px solid var(--line); background: rgba(13,23,41,.6); border-radius: 15px; padding: 14px; }
|
||||
.facet-list { display: grid; gap: 4px; margin-top: 9px; }
|
||||
.facet-button { width: 100%; border-radius: 9px; border-color: transparent; background: transparent; padding: 8px; display: flex; justify-content: space-between; text-align: left; font-size: 11px; }
|
||||
.help-card { padding: 15px; }
|
||||
.help-card .help-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; color: #a9c4fa; background: var(--accent-soft); margin-bottom: 11px; font-size: 11px; font-weight: 800; }
|
||||
.help-card strong { display: block; font-size: 11px; }
|
||||
.help-card p { color: var(--muted); font-size: 10px; line-height: 1.55; margin: 6px 0 0; }
|
||||
.help-card code { color: #b9cefa; }
|
||||
.results-column { min-width: 0; }
|
||||
.result-list { display: grid; gap: 12px; }
|
||||
.result-card {
|
||||
position: relative; display: grid; grid-template-columns: minmax(0,1fr) 38px; align-items: center;
|
||||
border: 1px solid var(--line); background: linear-gradient(140deg, rgba(16,28,48,.82), rgba(11,21,38,.72));
|
||||
border-radius: var(--radius); overflow: hidden; transition: border-color .16s, transform .16s, box-shadow .16s;
|
||||
}
|
||||
.result-card:hover { border-color: rgba(121,167,255,.34); transform: translateY(-1px); box-shadow: 0 13px 42px rgba(0,0,0,.17); }
|
||||
.result-main { appearance: none; border: 0; background: transparent; color: inherit; text-align: left; padding: 20px 10px 20px 22px; cursor: pointer; min-width: 0; }
|
||||
.result-overline { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 8px; }
|
||||
.result-id { font: 650 10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #91b6ff; }
|
||||
.result-source { color: var(--faint); font-size: 9px; border-left: 1px solid var(--line-strong); padding-left: 9px; }
|
||||
.result-main h2 { margin: 0; font-size: 17px; line-height: 1.35; letter-spacing: -.012em; }
|
||||
.result-main p { color: #a9bad2; font-size: 12px; line-height: 1.65; margin: 9px 0 0; max-width: 850px; }
|
||||
.result-main p.muted { color: var(--faint); }
|
||||
.result-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 13px; }
|
||||
.result-tags span { color: #91a7c7; background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; font-size: 9px; }
|
||||
.result-arrow { color: #7892bd; font-size: 17px; }
|
||||
mark { color: #ddecff; background: rgba(121,167,255,.16); border-radius: 3px; padding: 0 1px; }
|
||||
.loading { display: flex; justify-content: center; gap: 7px; padding: 70px; }
|
||||
.loading span { width: 7px; height: 7px; border-radius: 50%; background: #8baef1; animation: pulse 1s infinite ease-in-out; }
|
||||
.loading span:nth-child(2) { animation-delay: .13s; }.loading span:nth-child(3) { animation-delay: .26s; }
|
||||
@keyframes pulse { 0%,100% { opacity:.25; transform:translateY(0) } 50% { opacity:1; transform:translateY(-4px) } }
|
||||
.no-results { text-align: center; padding: 70px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
|
||||
.no-results-icon { font-size: 32px; color: #7795c8; transform: rotate(-15deg); }
|
||||
.no-results h2 { font-size: 18px; margin: 15px 0 5px; }
|
||||
.no-results p { color: var(--muted); font-size: 12px; max-width: 520px; margin: 0 auto; line-height: 1.6; }
|
||||
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 28px; }
|
||||
.page-btn { width: 35px; height: 35px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: #b6c5dd; cursor: pointer; font-size: 11px; }
|
||||
.page-btn:hover:not(:disabled) { border-color: rgba(121,167,255,.45); background: rgba(121,167,255,.08); }
|
||||
.page-btn.active { color: #edf4ff; background: rgba(121,167,255,.15); border-color: rgba(121,167,255,.45); }
|
||||
.page-btn:disabled { opacity: .3; cursor: default; }
|
||||
.page-gap { color: var(--faint); }
|
||||
|
||||
.article-dialog { width: min(940px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; color: var(--text); background: #0c1729; border: 1px solid var(--line-strong); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
|
||||
.article-dialog::backdrop { background: rgba(2, 6, 13, .76); backdrop-filter: blur(7px); }
|
||||
.article-shell { display: grid; grid-template-rows: auto minmax(0,1fr) auto; max-height: calc(100vh - 34px); }
|
||||
.article-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; padding: 26px 28px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(145deg, rgba(121,167,255,.06), transparent 60%); }
|
||||
.article-head h2 { margin: 8px 0 0; font-size: clamp(20px, 3vw, 29px); line-height: 1.25; letter-spacing: -.025em; }
|
||||
.close-btn { width: 36px; height: 36px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.025); cursor: pointer; color: #aabbd4; font-size: 22px; line-height: 1; }
|
||||
.close-btn:hover { border-color: var(--line-strong); color: var(--text); }
|
||||
.article-body { overflow: auto; padding: 24px 28px 34px; }
|
||||
.meta-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; }
|
||||
.meta-row span { border: 1px solid var(--line); background: rgba(255,255,255,.02); border-radius: 999px; color: var(--faint); padding: 5px 8px; font-size: 9px; }
|
||||
.article-section { border-top: 1px solid var(--line); padding: 22px 0; }
|
||||
.article-section:first-of-type { border-top: 0; }
|
||||
.article-text { margin-top: 10px; color: #c6d3e6; font-size: 13px; line-height: 1.72; white-space: pre-wrap; overflow-wrap: anywhere; }
|
||||
.answer-section { margin: 7px -10px 0; padding: 19px 18px 22px; border: 1px solid rgba(100,217,173,.17); border-radius: 15px; background: linear-gradient(135deg, rgba(100,217,173,.055), rgba(121,167,255,.035)); }
|
||||
.answer-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
|
||||
.answer-head strong { display: block; font-size: 13px; margin-top: 5px; }
|
||||
.answer-text { color: #d9e7e2; }
|
||||
.copy-btn, .source-link { border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(255,255,255,.035); padding: 8px 10px; color: #bdd0ef; font-size: 10px; cursor: pointer; text-decoration: none; white-space: nowrap; }
|
||||
.copy-btn:hover, .source-link:hover { border-color: rgba(121,167,255,.45); color: #edf4ff; }
|
||||
.compact-section { padding-bottom: 8px; }
|
||||
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
|
||||
.tag-list span { border-radius: 999px; background: var(--accent-soft); color: #a9c5f8; padding: 5px 9px; font-size: 9px; }
|
||||
.source-line { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-top: 10px; }
|
||||
.source-line > div { min-width: 0; display: grid; gap: 4px; }
|
||||
.source-line strong { font-size: 12px; }
|
||||
.source-line span { color: var(--faint); font-size: 9px; overflow-wrap: anywhere; }
|
||||
.article-foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 52px; padding: 10px 24px; border-top: 1px solid var(--line); background: rgba(7,14,26,.7); }
|
||||
.article-foot > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
|
||||
.toast-host { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 100; pointer-events: none; }
|
||||
.toast { max-width: 420px; padding: 11px 13px; border-radius: 11px; color: #dbe7fb; background: #14233b; border: 1px solid #2c4264; box-shadow: var(--shadow); font-size: 11px; animation: toast-in .18s ease-out; }
|
||||
.toast.success { color: #b6eed8; border-color: rgba(100,217,173,.35); }
|
||||
.toast.error { color: #ffc2c8; border-color: rgba(255,132,144,.35); }
|
||||
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }
|
||||
|
||||
@media (max-width: 840px) {
|
||||
.topbar { padding: 0 18px; }
|
||||
.brand-copy small, .mode-badge { display: none; }
|
||||
.count-badge { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; }
|
||||
.hero { padding-left: 18px; padding-right: 18px; }
|
||||
.hero-search { min-height: 58px; padding-left: 15px; }
|
||||
.hero-search kbd { display: none; }
|
||||
.search-box button { padding: 0 14px; }
|
||||
.results-view { width: min(100% - 28px, 1240px); padding-top: 24px; }
|
||||
.results-header { padding-right: 0; }
|
||||
.results-layout { grid-template-columns: 1fr; }
|
||||
.side-panel { display: none; }
|
||||
.result-main { padding: 17px 6px 17px 17px; }
|
||||
.article-head, .article-body { padding-left: 20px; padding-right: 20px; }
|
||||
}
|
||||
|
||||
@media (max-width: 520px) {
|
||||
.topbar { height: 64px; }
|
||||
.brand-mark { width: 34px; height: 34px; }
|
||||
.count-badge { display: none; }
|
||||
.hero { min-height: calc(100vh - 64px); }
|
||||
.hero h1 { font-size: 38px; }
|
||||
.hero p { font-size: 14px; }
|
||||
.hero-search { display: grid; grid-template-columns: 24px minmax(0,1fr); padding: 12px 14px; border-radius: 18px; }
|
||||
.hero-search button { grid-column: 1 / -1; width: 100%; }
|
||||
.top-search button { display: none; }
|
||||
.results-summary { align-items: center; }
|
||||
.result-card { grid-template-columns: 1fr; }
|
||||
.result-arrow { display: none; }
|
||||
.result-main h2 { font-size: 15px; }
|
||||
.result-main p { font-size: 11px; }
|
||||
.article-dialog { width: calc(100vw - 14px); max-height: calc(100vh - 14px); border-radius: 17px; }
|
||||
.article-shell { max-height: calc(100vh - 16px); }
|
||||
.article-head { padding: 20px 17px 16px; }
|
||||
.article-body { padding: 18px 17px 25px; }
|
||||
.answer-head, .source-line, .article-foot { align-items: flex-start; flex-direction: column; }
|
||||
.article-foot { gap: 4px; }
|
||||
}
|
||||
Reference in New Issue
Block a user