335 lines
21 KiB
PHP
335 lines
21 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
@date_default_timezone_set("UTC");
|
|
$projectName = "Curated Links · Laegna & Spireason LandScaper";
|
|
$projectDescription = "A CSS-aware reference page for Laegna and Spireason links, separating fixed console chrome, main chapter gates, icon-owned blocks, PDFs, and utility controls.";
|
|
$projectImageUrl = $_SERVER["PROJECT_IMAGE_URL"] ?? "";
|
|
$now = date("Y-m-d H:i:s");
|
|
require_once __DIR__ . "/includes/curated_data.php";
|
|
|
|
function ref_filename(array $link): string
|
|
{
|
|
$path = parse_url((string)($link["href"] ?? ""), PHP_URL_PATH);
|
|
return $path ? rawurldecode(basename($path)) : "";
|
|
}
|
|
|
|
function ref_host(array $link): string
|
|
{
|
|
return strtolower((string)(parse_url((string)($link["href"] ?? ""), PHP_URL_HOST) ?: ""));
|
|
}
|
|
|
|
function ref_category(array $link): string
|
|
{
|
|
$kind = strtolower((string)($link["kind"] ?? ""));
|
|
$href = strtolower((string)($link["href"] ?? ""));
|
|
$name = strtolower((string)($link["name"] ?? ""));
|
|
$host = ref_host($link);
|
|
$path = strtolower((string)(parse_url($href, PHP_URL_PATH) ?: ""));
|
|
if ($kind === "pdf" || str_ends_with($path, ".pdf")) return "pdf";
|
|
if ($kind === "dataset" || str_ends_with($path, ".json")) return "dataset";
|
|
if ($kind === "source" || str_ends_with($path, ".py")) return "source";
|
|
if (str_contains($name . " " . $href, "bot") || str_contains($host, "perplexity.ai")) return "bot";
|
|
if (str_contains($name, "calculator") || str_contains($name, "octave") || str_contains($name, "frequency") || str_contains($name, "counter")) return "tool";
|
|
if ($kind === "github" || str_contains($host, "github")) return "github";
|
|
if (str_contains($href, "apples.html") || str_contains($kind, "app")) return "applet";
|
|
if ($kind === "archive" || str_ends_with($path, ".zip")) return "archive";
|
|
if ($kind === "presentation" || str_contains($host, "prezi") || str_contains($host, "docs.google") || str_contains($host, "popai.pro")) return "presentation";
|
|
if ($kind === "media" || str_contains($host, "youtube") || str_contains($host, "notion")) return "media";
|
|
if ($host !== "" && $host !== "spireason.neocities.org") return "external";
|
|
return $kind !== "" ? preg_replace("/[^a-z0-9-]+/", "-", $kind) : "onsite";
|
|
}
|
|
|
|
function ref_label(string $category): string
|
|
{
|
|
return [
|
|
"pdf" => "PDF text",
|
|
"applet" => "Applet",
|
|
"bot" => "External bot/system",
|
|
"tool" => "Tool",
|
|
"github" => "Repository",
|
|
"archive" => "Archive / utility",
|
|
"presentation" => "Presentation",
|
|
"media" => "Media",
|
|
"dataset" => "Dataset",
|
|
"source" => "Source file",
|
|
"external" => "External system",
|
|
"onsite" => "On-site branch",
|
|
"branch" => "Branch",
|
|
"research" => "Research system",
|
|
"manual" => "Manual",
|
|
"table" => "Table",
|
|
"main-branch" => "Main branch",
|
|
][$category] ?? ucfirst(str_replace("-", " ", $category));
|
|
}
|
|
|
|
function section_by_id(array $sections, string $id): ?array
|
|
{
|
|
foreach ($sections as $section) {
|
|
if (($section["id"] ?? "") === $id) return $section;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function links_for_sections(array $links, array $ids): array
|
|
{
|
|
$set = array_fill_keys($ids, true);
|
|
return array_values(array_filter($links, static fn(array $link): bool => isset($set[$link["section"] ?? ""])));
|
|
}
|
|
|
|
$categoryCounts = [];
|
|
foreach ($links as $link) {
|
|
$cat = ref_category($link);
|
|
$categoryCounts[$cat] = ($categoryCounts[$cat] ?? 0) + 1;
|
|
}
|
|
ksort($categoryCounts);
|
|
$pdfLinks = array_values(array_filter($links, fn($link) => ref_category($link) === "pdf"));
|
|
$pdfCount = count($pdfLinks);
|
|
$utilityCount = isset($utilityLinks) ? count($utilityLinks) : 0;
|
|
?>
|
|
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title><?= htmlspecialchars($projectName) ?></title>
|
|
<meta name="description" content="<?= htmlspecialchars($projectDescription) ?>">
|
|
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>">
|
|
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>">
|
|
<?php if ($projectImageUrl): ?>
|
|
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>">
|
|
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>">
|
|
<?php endif; ?>
|
|
<meta name="theme-color" content="#111111">
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?= time() ?>">
|
|
</head>
|
|
<body>
|
|
<a class="skip-link" href="#reference-main">Skip to references</a>
|
|
<header class="topbar" aria-label="Reference navigation">
|
|
<nav class="container-fluid d-flex align-items-center justify-content-between gap-3">
|
|
<a class="brand" href="index.php#console" aria-label="Back to LandScaper"><span class="brand-mark">LS</span><span>LandScaper</span></a>
|
|
<div class="top-links" aria-label="Reference areas">
|
|
<a href="index.php">Home</a>
|
|
<a href="#source-layout">Layout</a>
|
|
<a href="#ownership">Ownership</a>
|
|
<a href="#curated-index">Modes</a>
|
|
<a href="#pdf-only-index" data-reference-mode-jump="pdfs">PDFs</a>
|
|
<a href="#live-source-map">Live Source Map</a>
|
|
</div>
|
|
<button class="theme-toggle" type="button" data-theme-toggle aria-pressed="false">Day</button>
|
|
</nav>
|
|
</header>
|
|
|
|
<main id="reference-main" class="reference-page" data-reference-page>
|
|
<section class="reference-hero" aria-labelledby="reference-title">
|
|
<p class="eyebrow">CSS-aware reference system</p>
|
|
<h1 id="reference-title">Separate console chrome, chapter gates, icon blocks, PDFs, and utility links.</h1>
|
|
<p><?= htmlspecialchars($sourceOwnershipNote) ?></p>
|
|
<div class="reference-stats" aria-label="Curated totals">
|
|
<span><?= count($sections) ?> owner icons</span>
|
|
<span><?= count($links) ?> branch entries</span>
|
|
<span><?= $pdfCount ?> PDF-only entries</span>
|
|
<span><?= $utilityCount ?> separated utility links</span>
|
|
</div>
|
|
<div class="console-actions">
|
|
<a class="btn btn-dark btn-sm" href="#curated-index" data-reference-mode-jump="icons">Browse icon blocks</a>
|
|
<a class="btn btn-joy btn-sm" href="#pdf-only-index" data-reference-mode-jump="pdfs">Open PDF block</a>
|
|
<button class="btn btn-outline-dark btn-sm" id="loadStructure" type="button">Load live source ownership</button>
|
|
</div>
|
|
</section>
|
|
|
|
<section id="source-layout" class="layout-audit" aria-labelledby="layout-title">
|
|
<div class="layout-audit-head">
|
|
<p class="eyebrow">Position model from CSS + computed layout</p>
|
|
<h2 id="layout-title">The source is four layers before it is a link list.</h2>
|
|
<p>The public page uses inline CSS, fixed clusters, absolute panels, nested articles/sections, and small JavaScript hover/scroll helpers. This page separates those layers before grouping links.</p>
|
|
</div>
|
|
<div class="layout-zone-grid">
|
|
<?php foreach (($layoutZones ?? []) as $zone): ?>
|
|
<article class="layout-zone-card" id="layout-<?= htmlspecialchars($zone["id"]) ?>">
|
|
<span class="layout-zone-icon" aria-hidden="true"><?= htmlspecialchars($zone["icon"]) ?></span>
|
|
<div>
|
|
<h3><?= htmlspecialchars($zone["title"]) ?></h3>
|
|
<p><?= htmlspecialchars($zone["summary"]) ?></p>
|
|
<small><b>CSS:</b> <?= htmlspecialchars($zone["css"]) ?> · <b>Computed:</b> <?= htmlspecialchars($zone["computed"]) ?></small>
|
|
</div>
|
|
</article>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</section>
|
|
|
|
<section id="ownership" class="ownership-strip" aria-labelledby="ownership-title">
|
|
<div>
|
|
<p class="eyebrow">Icon order + bright pins</p>
|
|
<h2 id="ownership-title">Tap any icon, chapter pill, or box link to glow the exact owner on the page.</h2>
|
|
</div>
|
|
<div class="ownership-icons">
|
|
<?php foreach ($sections as $section): ?>
|
|
<a href="#<?= htmlspecialchars($section["id"]) ?>" data-highlight-target="<?= htmlspecialchars($section["id"]) ?>" aria-label="Highlight owner <?= htmlspecialchars($section["title"]) ?>"><span><?= htmlspecialchars($section["icon"]) ?></span><small><?= (int)($section["source_count"] ?? 0) ?></small></a>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="reference-tools" aria-label="Reference filters and modes">
|
|
<label class="search-box"><span>Filter</span><input type="search" id="linkFilter" placeholder="Search owners, PDFs, sheep data, systems…"></label>
|
|
<div class="reference-mode-switch" role="tablist" aria-label="Reference modes">
|
|
<button class="active" type="button" data-reference-mode="icons" aria-selected="true">⚛ Icons & blocks</button>
|
|
<button type="button" data-reference-mode="chapters" aria-selected="false">✦ Two chapters</button>
|
|
<button type="button" data-reference-mode="pdfs" aria-selected="false">📄 All PDFs only</button>
|
|
</div>
|
|
<label class="filter-mode-toggle" title="Toggle out-filtered items between dim and hide">
|
|
<input type="checkbox" id="filterDimToggle" checked>
|
|
<span aria-hidden="true">☁</span>
|
|
<span data-filter-mode-label>dim</span>
|
|
</label>
|
|
<div class="filter-status" id="filterStatus" role="status">All · dim</div>
|
|
<div class="category-legend" aria-label="Category totals">
|
|
<?php foreach ($categoryCounts as $category => $count): ?>
|
|
<span class="legend-pill link-kind-<?= htmlspecialchars($category) ?>"><b><?= htmlspecialchars(ref_label($category)) ?></b> <?= (int)$count ?></span>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</section>
|
|
|
|
<section id="curated-index" class="sections-grid blocks reference-mode-panel is-active" data-mode-panel="icons" data-section-grid aria-label="Curated source-owned icon groups">
|
|
<?php foreach ($sections as $section): ?>
|
|
<?php $sectionLinks = array_values(array_filter($links, fn($link) => $link["section"] === $section["id"])); $layout = $sectionLayout[$section["id"]] ?? null; ?>
|
|
<article class="section-card reference-card" id="<?= htmlspecialchars($section["id"]) ?>" data-section-card data-title="<?= htmlspecialchars(strtolower($section["title"] . " " . ($layout["zone"] ?? "") . " " . ($layout["note"] ?? ""))) ?>" data-chapter="<?= htmlspecialchars($section["chapter"]) ?>" data-tone="<?= htmlspecialchars((string)($section["tone"] ?? "neutral")) ?>">
|
|
<div class="section-head">
|
|
<div class="section-icon" aria-hidden="true"><?= htmlspecialchars($section["icon"]) ?></div>
|
|
<div>
|
|
<div class="section-chapter"><?= htmlspecialchars($section["chapter"]) ?></div>
|
|
<h2><?= htmlspecialchars($section["title"]) ?></h2>
|
|
<div class="section-meta"><span>#<?= htmlspecialchars($section["id"]) ?></span><span><?= (int)($section["source_count"] ?? count($sectionLinks)) ?> source links → <?= htmlspecialchars((string)($section["source_until"] ?? "next")) ?></span></div>
|
|
</div>
|
|
</div>
|
|
<p><?= htmlspecialchars($section["summary"]) ?></p>
|
|
<?php if ($layout): ?>
|
|
<div class="layout-note">
|
|
<b><?= htmlspecialchars($layout["zone"]) ?></b>
|
|
<span><?= htmlspecialchars($layout["computed"]) ?></span>
|
|
<small><?= htmlspecialchars($layout["parent"]) ?> · <?= htmlspecialchars($layout["position"]) ?></small>
|
|
<em><?= htmlspecialchars($layout["note"]) ?></em>
|
|
</div>
|
|
<?php endif; ?>
|
|
<button class="manual-highlight" type="button" data-highlight-target="<?= htmlspecialchars($section["id"]) ?>">✨ Pin box</button>
|
|
<div class="file-list">
|
|
<?php if ($sectionLinks): foreach ($sectionLinks as $link): ?>
|
|
<?php $category = ref_category($link); $filename = ref_filename($link); ?>
|
|
<a class="file-row link-kind-<?= htmlspecialchars($category) ?>" href="<?= htmlspecialchars($link["href"]) ?>" target="_blank" rel="noopener" data-link-row data-owner-target="<?= htmlspecialchars($section["id"]) ?>" data-kind="<?= htmlspecialchars($category) ?>" data-search="<?= htmlspecialchars(strtolower($link["name"] . " " . $link["summary"] . " " . $link["kind"] . " " . $category . " " . $filename . " " . $section["title"] . " " . ($layout["zone"] ?? ""))) ?>">
|
|
<span class="file-icon"><?= htmlspecialchars($link["icon"]) ?></span>
|
|
<span class="file-copy">
|
|
<strong><?= htmlspecialchars($link["name"]) ?></strong>
|
|
<small><span class="kind-pill kind-<?= htmlspecialchars($category) ?>"><?= htmlspecialchars(ref_label($category)) ?></span><?php if ($filename): ?> <span class="filename"><?= htmlspecialchars($filename) ?></span><?php endif; ?> · <?= htmlspecialchars($link["summary"]) ?></small>
|
|
</span>
|
|
<span class="file-arrow">↗</span>
|
|
</a>
|
|
<?php endforeach; else: ?>
|
|
<div class="empty-state">No branch links are assigned to this owner in CSS-aware mode. If the icon is Coffee, following links are utility chrome; if it is LaeLab, use live source text as context.</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</article>
|
|
<?php endforeach; ?>
|
|
</section>
|
|
|
|
<section id="chapter-index" class="chapter-reference reference-mode-panel" data-mode-panel="chapters" aria-label="Two main chapter link groups" hidden>
|
|
<?php foreach (($chapterGroups ?? []) as $chapter): ?>
|
|
<?php $chapterLinks = links_for_sections($links, $chapter["sections"]); $mainLinks = array_values(array_filter($chapterLinks, fn($link) => ref_category($link) === "pdf")); $branchLinks = array_values(array_filter($chapterLinks, fn($link) => ref_category($link) !== "pdf")); ?>
|
|
<article class="chapter-reference-card" id="<?= htmlspecialchars($chapter["id"]) ?>" data-section-card data-title="<?= htmlspecialchars(strtolower($chapter["title"] . " " . $chapter["summary"])) ?>" data-chapter="<?= htmlspecialchars($chapter["title"]) ?>" data-tone="chapter">
|
|
<div class="chapter-reference-head">
|
|
<span class="chapter-reference-icon" aria-hidden="true"><?= htmlspecialchars($chapter["icon"]) ?></span>
|
|
<div>
|
|
<p class="eyebrow">Main title gate · <?= htmlspecialchars($chapter["computed"]) ?></p>
|
|
<h2><?= htmlspecialchars($chapter["title"]) ?></h2>
|
|
<p><?= htmlspecialchars($chapter["summary"]) ?></p>
|
|
<button class="manual-highlight chapter-pin" type="button" data-highlight-target="<?= htmlspecialchars($chapter["id"]) ?>">✨ Pin chapter</button>
|
|
</div>
|
|
</div>
|
|
<a class="chapter-trigger link-kind-presentation" href="<?= htmlspecialchars($chapter["trigger"]["href"]) ?>" target="_blank" rel="noopener" data-link-row data-owner-target="<?= htmlspecialchars($chapter["id"]) ?>" data-kind="presentation" data-search="<?= htmlspecialchars(strtolower($chapter["title"] . " " . $chapter["trigger"]["name"] . " " . $chapter["trigger"]["summary"])) ?>">
|
|
<span><?= htmlspecialchars($chapter["trigger"]["icon"]) ?></span>
|
|
<b><?= htmlspecialchars($chapter["trigger"]["name"]) ?></b>
|
|
<small><?= htmlspecialchars($chapter["trigger"]["summary"]) ?></small>
|
|
</a>
|
|
<div class="chapter-section-pills" aria-label="Sections under <?= htmlspecialchars($chapter["title"]) ?>">
|
|
<?php foreach ($chapter["sections"] as $sid): $s = section_by_id($sections, $sid); if (!$s) continue; ?>
|
|
<a href="#<?= htmlspecialchars($sid) ?>" data-highlight-target="<?= htmlspecialchars($sid) ?>"><span><?= htmlspecialchars($s["icon"]) ?></span><?= htmlspecialchars($s["title"]) ?></a>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<div class="branch-columns">
|
|
<div>
|
|
<h3>📄 Main PDF block</h3>
|
|
<div class="branch-link-list">
|
|
<?php foreach ($mainLinks as $link): $filename = ref_filename($link); ?>
|
|
<a class="branch-row branch-main link-kind-pdf" href="<?= htmlspecialchars($link["href"]) ?>" target="_blank" rel="noopener" data-link-row data-owner-target="<?= htmlspecialchars($link["section"]) ?>" data-kind="pdf" data-search="<?= htmlspecialchars(strtolower($chapter["title"] . " " . $link["name"] . " " . $link["summary"] . " " . $filename)) ?>"><span><?= htmlspecialchars($link["icon"]) ?></span><b><?= htmlspecialchars($link["name"]) ?></b><small><?= htmlspecialchars($filename) ?></small></a>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<h3>Branch links / supporting systems</h3>
|
|
<div class="branch-link-list">
|
|
<?php if ($branchLinks): foreach ($branchLinks as $link): $category = ref_category($link); ?>
|
|
<a class="branch-row link-kind-<?= htmlspecialchars($category) ?>" href="<?= htmlspecialchars($link["href"]) ?>" target="_blank" rel="noopener" data-link-row data-owner-target="<?= htmlspecialchars($link["section"]) ?>" data-kind="<?= htmlspecialchars($category) ?>" data-search="<?= htmlspecialchars(strtolower($chapter["title"] . " " . $link["name"] . " " . $link["summary"] . " " . $category)) ?>"><span><?= htmlspecialchars($link["icon"]) ?></span><b><?= htmlspecialchars($link["name"]) ?></b><small><?= htmlspecialchars(ref_label($category)) ?> · <?= htmlspecialchars($link["summary"]) ?></small></a>
|
|
<?php endforeach; else: ?>
|
|
<span class="empty-state">No supporting branch links in this chapter group.</span>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
<?php endforeach; ?>
|
|
</section>
|
|
|
|
<section id="pdf-only-index" class="pdf-only-panel reference-mode-panel reference-card" data-mode-panel="pdfs" aria-labelledby="pdf-only-title" hidden>
|
|
<div class="pdf-only-head">
|
|
<p class="eyebrow">📄 PDF icon mode</p>
|
|
<h2 id="pdf-only-title">All PDFs together, and only PDFs.</h2>
|
|
<p>This mode ignores applets, repositories, datasets, media, counters and utility chrome. It is the final separation for the PDF-only icon path.</p>
|
|
</div>
|
|
<div class="pdf-grid" aria-label="PDF-only links">
|
|
<?php foreach ($pdfLinks as $pdf): $filename = ref_filename($pdf); ?>
|
|
<a class="pdf-card link-kind-pdf" href="<?= htmlspecialchars($pdf["href"]) ?>" target="_blank" rel="noopener" data-pdf-card data-link-row data-owner-target="<?= htmlspecialchars($pdf["section"]) ?>" data-kind="pdf" data-search="<?= htmlspecialchars(strtolower($pdf["name"] . " " . $pdf["summary"] . " " . $filename)) ?>">
|
|
<span class="pdf-symbol" aria-hidden="true">📄</span>
|
|
<span class="pdf-title"><?= htmlspecialchars($pdf["name"]) ?></span>
|
|
<span class="pdf-summary"><?= htmlspecialchars($pdf["summary"]) ?></span>
|
|
<span class="pdf-filename"><?= htmlspecialchars($filename) ?></span>
|
|
<span class="pdf-open">Open PDF ↗</span>
|
|
</a>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</section>
|
|
|
|
<section id="utility-chrome" class="utility-chrome-panel reference-card" aria-labelledby="utility-title">
|
|
<div>
|
|
<p class="eyebrow">Separated utility chrome</p>
|
|
<h2 id="utility-title">After Coffee: footer/download/RSS/lander links are not Coffee-owned branches.</h2>
|
|
<p>These links still exist in the source, but CSS/JS places some of them as fixed or absolute controls. They are listed here only as utility chrome.</p>
|
|
</div>
|
|
<div class="utility-link-grid">
|
|
<?php foreach (($utilityLinks ?? []) as $link): $category = ref_category($link); ?>
|
|
<a class="utility-row link-kind-<?= htmlspecialchars($category) ?>" href="<?= htmlspecialchars($link["href"]) ?>" target="_blank" rel="noopener" data-owner-target="utility-chrome"><span><?= htmlspecialchars($link["icon"]) ?></span><b><?= htmlspecialchars($link["name"]) ?></b><small><?= htmlspecialchars(ref_label($category)) ?> · <?= htmlspecialchars($link["summary"]) ?></small></a>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</section>
|
|
|
|
<section id="live-source-map" class="audit-panel source-map-panel" aria-labelledby="live-source-title">
|
|
<div>
|
|
<p class="eyebrow">Live precision scanner</p>
|
|
<h2 id="live-source-title">Source ownership map from spireason.neocities.org</h2>
|
|
<p>This scanner now reports the same CSS-aware separation: fixed/absolute chrome is not Coffee ownership, and every link keeps its source-order block context when possible.</p>
|
|
</div>
|
|
<button class="btn btn-dark btn-sm" id="loadStructureBottom" type="button">Load live source ownership</button>
|
|
<div class="audit-status" id="sourceStructureStatus" role="status">Not loaded yet.</div>
|
|
<div id="sourceStructure" class="source-structure" data-source-structure></div>
|
|
</section>
|
|
</main>
|
|
|
|
<footer class="site-footer">
|
|
<span>Runtime: PHP <?= htmlspecialchars(PHP_VERSION) ?></span>
|
|
<span>Updated <?= htmlspecialchars($now) ?> UTC</span>
|
|
<a href="api/scan_structure.php">Source structure API</a>
|
|
</footer>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script src="assets/js/main.js?v=<?= time() ?>" defer></script>
|
|
</body>
|
|
</html>
|