-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharticle.html
More file actions
79 lines (78 loc) · 5.19 KB
/
Copy patharticle.html
File metadata and controls
79 lines (78 loc) · 5.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html>
<html lang="pt">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' https://static.cloudflareinsights.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self' https://nftw-auth.nightmareftw.workers.dev https://api.github.com https://github.com https://api.warframestat.us https://cloudflareinsights.com; frame-src https://outlast.fex.dev; object-src 'none'; base-uri 'self'; form-action 'self';">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>News · NightmareFTW</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;800&family=Inter:wght@400;500;700&display=swap" rel="stylesheet">
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<link rel="stylesheet" href="/assets/css/style.css?v=ebe4a175">
</head>
<body>
<div class="bg-grid" aria-hidden="true"></div>
<header class="site-header">
<div class="container">
<a class="brand" href="/index.html"><span class="brand-mark">▲</span><span class="brand-name">Nightmare<span class="accent">FTW</span></span></a>
<nav class="top-nav"><a href="/index.html">Hub</a></nav>
</div>
</header>
<main class="container tool-page">
<p class="breadcrumb" id="bc"><a href="/index.html">hub</a> / …</p>
<article class="news-article" id="article"><p style="color:var(--muted)">Loading…</p></article>
</main>
<footer class="site-footer"><div class="container"><span>Built by NightmareFTW · headlines via Google News; preview & image from the source article.</span></div></footer>
<script src="/assets/js/data.js?v=7eab2efa"></script>
<script>
(function () {
const q = new URLSearchParams(location.search);
const gid = q.get("g"), idx = parseInt(q.get("i"), 10);
const allGames = (typeof GAMES !== "undefined") ? GAMES : (window.GAMES || []);
const game = allGames.find((g) => g.id === gid);
const gameName = game ? game.name : gid;
const esc = (s) => String(s == null ? "" : s).replace(/[&<>"]/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """ }[c]));
const bc = document.getElementById("bc");
const root = document.getElementById("article");
bc.innerHTML = `<a href="/index.html">hub</a> / <a href="/games/${esc(gid)}/index.html">${esc(gameName)}</a> / news`;
(async function () {
try {
const data = await (await fetch(`/data/news/${gid}.json?cb=${Date.now()}`)).json();
const it = (data.items || [])[idx];
if (!it) throw new Error("not found");
document.title = `${it.title} · ${gameName} · NightmareFTW`;
const date = it.date ? new Date(it.date).toLocaleDateString(undefined, { weekday: "short", year: "numeric", month: "long", day: "numeric" }) : "";
const host = (() => { try { return new URL(it.url).hostname.replace(/^www\./, ""); } catch { return ""; } })();
const srcName = it.source || host || "the source";
// Full body when we have it, otherwise the short OG summary.
const bodyHtml = it.content
? `<div class="na-content">${it.content}</div>`
: it.summary
? `<p class="na-summary">${esc(it.summary)}</p>`
: `<p class="na-summary na-muted">No preview text was available for this article — open the source for the full story.</p>`;
root.innerHTML = `
${it.image ? `<div class="na-hero"><img src="${esc(it.image)}" alt="" loading="lazy" onerror="this.parentNode.remove()"></div>` : ""}
<span class="na-source">${esc(srcName)}${date ? " · " + esc(date) : ""}</span>
<h1 class="na-title">${esc(it.title)}</h1>
${bodyHtml}
<div class="na-credit">
<span class="na-credit-label">Source</span>
<a href="${esc(it.url)}" target="_blank" rel="noopener">${esc(srcName)} ↗</a>
<p class="na-credit-note">${it.content
? "Full post shown here for convenience. All rights and the original belong to the source above — open it to view in context."
: "Preview built from the article's own summary. Read the full story at the source above."}</p>
</div>
<div class="na-actions">
<a class="btn na-cta" href="${esc(it.url)}" target="_blank" rel="noopener">Open at ${esc(srcName)} ↗</a>
<a class="mini-btn" href="/games/${esc(gid)}/index.html">← Back to ${esc(gameName)}</a>
</div>`;
} catch (e) {
root.innerHTML = `<p class="tool-note">Couldn't load this article. <a href="/games/${esc(gid)}/index.html" style="color:var(--accent)">Back to ${esc(gameName)}</a>.</p>`;
}
})();
})();
</script>
<script src="/assets/js/i18n.js?v=b0ea5508" defer></script>
<!-- Cloudflare Web Analytics --><script type='module' src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "b0fc25d6ec3948f58b0a240fab9e9500"}'></script><!-- End Cloudflare Web Analytics -->
</body>
</html>