742 lines
30 KiB
HTML
742 lines
30 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>revenge-plugins</title>
|
|
<meta name="description" content="Plugins for Revenge, the Discord Android client mod.">
|
|
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='4' fill='%230a0a0c'/%3E%3Ctext x='6' y='23' font-family='monospace' font-size='19' fill='%2339e881'%3E%3E_%3C/text%3E%3C/svg%3E">
|
|
<style>
|
|
:root {
|
|
--bg: #f4f5f2;
|
|
--bg-elevated: #ffffff;
|
|
--bg-sunken: #eceee9;
|
|
--border: #d7dad2;
|
|
--text: #14150f;
|
|
--text-muted: #62675c;
|
|
--text-dim: #8a8f80;
|
|
--accent: #0d8a4e;
|
|
--accent-text: #ffffff;
|
|
--danger: #c0392b;
|
|
--danger-bg: #fbe9e7;
|
|
--shadow: 0 1px 2px rgba(20, 21, 15, 0.05);
|
|
--mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
|
|
color-scheme: light;
|
|
}
|
|
@media (prefers-color-scheme: dark) {
|
|
:root {
|
|
--bg: #0a0a0c; --bg-elevated: #111213; --bg-sunken: #0d0e0f; --border: #24262a;
|
|
--text: #e4e6e1; --text-muted: #8b9088; --text-dim: #5c6058; --accent: #39e881; --accent-text: #05170d;
|
|
--danger: #ff6b5e; --danger-bg: #241211;
|
|
--shadow: 0 1px 2px rgba(0,0,0,0.4);
|
|
color-scheme: dark;
|
|
}
|
|
}
|
|
:root[data-theme="dark"] {
|
|
--bg: #0a0a0c; --bg-elevated: #111213; --bg-sunken: #0d0e0f; --border: #24262a;
|
|
--text: #e4e6e1; --text-muted: #8b9088; --text-dim: #5c6058; --accent: #39e881; --accent-text: #05170d;
|
|
--danger: #ff6b5e; --danger-bg: #241211;
|
|
--shadow: 0 1px 2px rgba(0,0,0,0.4); color-scheme: dark;
|
|
}
|
|
:root[data-theme="light"] {
|
|
--bg: #f4f5f2; --bg-elevated: #ffffff; --bg-sunken: #eceee9; --border: #d7dad2;
|
|
--text: #14150f; --text-muted: #62675c; --text-dim: #8a8f80; --accent: #0d8a4e; --accent-text: #ffffff;
|
|
--danger: #c0392b; --danger-bg: #fbe9e7;
|
|
--shadow: 0 1px 2px rgba(20,21,15,0.05); color-scheme: light;
|
|
}
|
|
|
|
* { box-sizing: border-box; }
|
|
html { scroll-behavior: smooth; }
|
|
body {
|
|
margin: 0;
|
|
background:
|
|
repeating-linear-gradient(0deg, color-mix(in srgb, var(--text) 2%, transparent) 0px, transparent 1px, transparent 2px),
|
|
var(--bg);
|
|
color: var(--text);
|
|
font-family: var(--mono);
|
|
-webkit-font-smoothing: antialiased;
|
|
font-size: 14px;
|
|
}
|
|
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
|
|
a { color: inherit; }
|
|
|
|
/* ---------- Header ---------- */
|
|
.hero {
|
|
border-bottom: 1px solid var(--border);
|
|
padding: 40px 0 28px;
|
|
}
|
|
.mark {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
font-size: 12.5px;
|
|
font-weight: 700;
|
|
color: var(--accent);
|
|
letter-spacing: 0.04em;
|
|
margin-bottom: 22px;
|
|
}
|
|
.mark::before { content: ">"; }
|
|
h1 {
|
|
font-size: clamp(22px, 3.4vw, 30px);
|
|
line-height: 1.3;
|
|
margin: 0 0 6px;
|
|
font-weight: 700;
|
|
letter-spacing: -0.01em;
|
|
}
|
|
h1 .grad { color: var(--accent); }
|
|
.hero p.sub {
|
|
color: var(--text-muted);
|
|
font-size: 13.5px;
|
|
max-width: 620px;
|
|
margin: 0 0 20px;
|
|
line-height: 1.65;
|
|
}
|
|
.hero p.sub::before { content: "# "; color: var(--text-dim); }
|
|
.hero-links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
|
|
.hero-links a {
|
|
font-size: 12.5px; font-weight: 600; text-decoration: none;
|
|
padding: 7px 12px; border: 1px solid var(--border); background: var(--bg-elevated);
|
|
}
|
|
.hero-links a.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
|
|
.hero-links a:hover { border-color: var(--accent); }
|
|
.kbd-hint {
|
|
display: inline-flex; align-items: center; gap: 6px;
|
|
font-size: 12px; color: var(--text-dim); font-weight: 600;
|
|
}
|
|
.kbd-hint kbd {
|
|
font-family: var(--mono); font-size: 11px; background: var(--bg-sunken);
|
|
border: 1px solid var(--border); border-radius: 3px; padding: 2px 5px;
|
|
}
|
|
.stats { display: flex; gap: 28px; flex-wrap: wrap; }
|
|
.stats .stat-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
|
|
.stats .stat-label { font-size: 11.5px; color: var(--text-dim); }
|
|
.stats .stat-value::before { content: "["; color: var(--text-dim); }
|
|
.stats .stat-value::after { content: "]"; color: var(--text-dim); }
|
|
|
|
/* ---------- Controls ---------- */
|
|
.controls { position: sticky; top: 0; background: var(--bg); padding: 14px 0; z-index: 5; border-bottom: 1px solid transparent; transition: border-color 0.15s; }
|
|
.controls.stuck { border-bottom-color: var(--border); }
|
|
.search-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; border: 1px solid var(--border); background: var(--bg-elevated); padding: 0 12px; }
|
|
.search-row::before { content: "$"; color: var(--accent); font-weight: 700; }
|
|
.search {
|
|
flex: 1; padding: 10px 8px; border: none;
|
|
background: transparent; color: var(--text); font-size: 13.5px; font-family: var(--mono);
|
|
}
|
|
.search:focus { outline: none; }
|
|
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
|
|
.chip { font-size: 12px; font-weight: 600; padding: 6px 10px; background: var(--bg-sunken); color: var(--text-muted); border: 1px solid var(--border); cursor: pointer; }
|
|
.chip::before { content: "#"; margin-right: 3px; color: var(--text-dim); }
|
|
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
|
|
.chip[aria-pressed="true"]::before { color: var(--accent-text); opacity: 0.7; }
|
|
|
|
main { padding: 20px 0 56px; }
|
|
.count { color: var(--text-dim); font-size: 12px; margin: 0 0 14px; }
|
|
.count::before { content: "> "; }
|
|
|
|
/* ---------- Grid / cards ---------- */
|
|
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
|
|
.card {
|
|
position: relative;
|
|
background: var(--bg-elevated);
|
|
border: 1px solid var(--border);
|
|
padding: 16px 16px 14px;
|
|
box-shadow: var(--shadow);
|
|
display: flex;
|
|
flex-direction: column;
|
|
cursor: pointer;
|
|
text-align: left;
|
|
font: inherit;
|
|
color: inherit;
|
|
width: 100%;
|
|
transition: border-color 0.12s ease;
|
|
}
|
|
.card.is-broken { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
|
|
.card:hover, .card:focus-visible {
|
|
border-color: var(--accent);
|
|
outline: none;
|
|
}
|
|
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
|
|
.card h3 { font-size: 14.5px; margin: 0; font-weight: 700; }
|
|
.badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 2px 6px; white-space: nowrap; flex-shrink: 0; border: 1px solid currentColor; }
|
|
.badge.new { color: var(--accent); }
|
|
.badge.revived { color: #6a8dff; }
|
|
.badge.rebuilt { color: #e6a53a; }
|
|
.badge.broken { color: var(--danger); background: var(--danger-bg); border-color: var(--danger); }
|
|
.card .category { font-size: 10.5px; color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 8px; }
|
|
.card p.tagline { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; margin: 0 0 10px; flex-grow: 1; }
|
|
.card .taglist { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
|
|
.card .taglist span { font-size: 10px; color: var(--text-dim); border: 1px solid var(--border); padding: 1px 5px; }
|
|
.card .cta { font-size: 11.5px; font-weight: 700; color: var(--accent); }
|
|
.card .cta::after { content: " ->"; }
|
|
|
|
.empty { text-align: center; padding: 48px 20px; color: var(--text-dim); font-size: 13px; }
|
|
|
|
footer { border-top: 1px solid var(--border); padding: 24px 0 40px; }
|
|
footer p { color: var(--text-dim); font-size: 12px; margin: 0; }
|
|
footer p::before { content: "# "; }
|
|
|
|
/* ---------- Detail view ---------- */
|
|
.detail { display: none; }
|
|
.detail.active { display: block; }
|
|
.grid-view.hidden, .hero.hidden, .controls.hidden { display: none; }
|
|
|
|
.detail-banner {
|
|
padding: 36px 0 28px;
|
|
border-bottom: 1px solid var(--border);
|
|
}
|
|
.back-link {
|
|
display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
|
|
color: var(--text-dim); text-decoration: none; margin-bottom: 18px; background: none; border: none; cursor: pointer; padding: 0; font-family: inherit;
|
|
}
|
|
.back-link::before { content: "< "; }
|
|
.back-link:hover { color: var(--accent); }
|
|
.detail-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
|
|
.detail-top h2 { font-size: clamp(20px, 3vw, 26px); margin: 0; font-weight: 700; }
|
|
.detail-category { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-dim); margin-bottom: 12px; }
|
|
.detail-tagline { font-size: 14px; color: var(--text-muted); max-width: 660px; line-height: 1.6; margin: 0 0 18px; }
|
|
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
|
|
.detail-tags span { font-size: 11px; color: var(--text-dim); border: 1px solid var(--border); padding: 2px 7px; }
|
|
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
|
|
.detail-actions button, .detail-actions a {
|
|
font-size: 12.5px; font-weight: 700; padding: 9px 14px; border: 1px solid var(--border);
|
|
background: var(--bg-elevated); color: var(--text); text-decoration: none; cursor: pointer;
|
|
}
|
|
.detail-actions button.install { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
|
|
.detail-actions a:hover, .detail-actions button:hover { border-color: var(--accent); }
|
|
|
|
.detail-body { padding: 28px 0 56px; display: grid; grid-template-columns: 2fr 1fr; gap: 32px; }
|
|
@media (max-width: 720px) { .detail-body { grid-template-columns: 1fr; } }
|
|
.detail-section { margin-bottom: 28px; }
|
|
.detail-section h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); margin: 0 0 12px; }
|
|
.detail-section h4::before { content: "// "; }
|
|
.detail-section p { font-size: 13.5px; line-height: 1.7; color: var(--text); margin: 0 0 12px; white-space: pre-line; }
|
|
|
|
.feature-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
|
|
.feature-list li { display: flex; gap: 8px; font-size: 13px; line-height: 1.55; }
|
|
.feature-list li::before { content: "+"; color: var(--accent); font-weight: 700; flex-shrink: 0; }
|
|
|
|
.cmd-table { border: 1px solid var(--border); }
|
|
.cmd-row { padding: 10px 12px; border-bottom: 1px solid var(--border); }
|
|
.cmd-row:last-child { border-bottom: none; }
|
|
.cmd-row code { display: block; font-size: 12.5px; font-weight: 700; color: var(--accent); margin-bottom: 3px; }
|
|
.cmd-row span { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
|
|
|
|
.side-card { background: var(--bg-elevated); border: 1px solid var(--border); padding: 14px; margin-bottom: 14px; }
|
|
.side-card h5 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-dim); margin: 0 0 8px; }
|
|
.side-card h5::before { content: "// "; }
|
|
.side-card p { font-size: 12.5px; line-height: 1.55; margin: 0; color: var(--text); }
|
|
.side-card.warn { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
|
|
.side-card.warn h5 { color: var(--danger); }
|
|
.authors-line { font-size: 12px; color: var(--text-muted); }
|
|
|
|
/* ---------- Command palette ---------- */
|
|
.palette-overlay {
|
|
position: fixed; inset: 0; background: rgba(5,6,5,0.6); backdrop-filter: blur(2px);
|
|
display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; z-index: 100;
|
|
}
|
|
.palette-overlay.open { display: flex; }
|
|
.palette {
|
|
width: min(560px, 92vw); background: var(--bg-elevated); border: 1px solid var(--border);
|
|
box-shadow: 0 20px 60px rgba(0,0,0,0.4); overflow: hidden;
|
|
}
|
|
.palette input {
|
|
width: 100%; border: none; background: transparent; color: var(--text); font-size: 15px; font-family: var(--mono);
|
|
padding: 16px 18px; border-bottom: 1px solid var(--border);
|
|
}
|
|
.palette input:focus { outline: none; }
|
|
.palette-results { max-height: 50vh; overflow-y: auto; padding: 6px; }
|
|
.palette-item {
|
|
display: flex; align-items: center; gap: 10px; padding: 9px 10px; cursor: pointer; font-size: 13px;
|
|
}
|
|
.palette-item[aria-selected="true"] { background: var(--bg-sunken); }
|
|
.palette-item .dot { width: 6px; height: 6px; background: var(--accent); flex-shrink: 0; }
|
|
.palette-item .name { font-weight: 600; }
|
|
.palette-item .cat { color: var(--text-dim); font-size: 11px; margin-left: auto; }
|
|
.palette-empty { padding: 18px; text-align: center; color: var(--text-dim); font-size: 12.5px; }
|
|
|
|
.toast {
|
|
position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(0);
|
|
background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 700; font-family: var(--mono);
|
|
padding: 9px 14px; opacity: 0; pointer-events: none;
|
|
transition: opacity 0.2s ease, transform 0.2s ease; z-index: 50;
|
|
}
|
|
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-8px); }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<header class="hero" id="hero">
|
|
<div class="wrap">
|
|
<div class="mark">revenge-plugins</div>
|
|
<h1>Discord, <span class="grad">rebuilt on your terms.</span></h1>
|
|
<p class="sub">A hand-built collection of plugins for Revenge, the Discord Android client mod - rebuilt from scratch where the old ecosystem broke, net-new where nothing existed yet, confirmed against decompiled source and live device testing, not guessed.</p>
|
|
<div class="hero-links">
|
|
<a class="primary" href="https://github.com/everestmcarthur/revenge-plugins">GitHub repo</a>
|
|
<a href="https://github.com/revenge-mod/revenge-bundle">About Revenge</a>
|
|
<a href="https://github.com/everestmcarthur/revenge-plugins/issues/new">Report an issue</a>
|
|
</div>
|
|
<div class="stats" id="stats" aria-hidden="true"></div>
|
|
</div>
|
|
</header>
|
|
|
|
<div class="wrap grid-view" id="gridView">
|
|
<div class="controls" id="controls">
|
|
<div class="search-row">
|
|
<input id="search" class="search" type="search" placeholder="search plugins... (or press /)" aria-label="Search plugins">
|
|
<span class="kbd-hint"><kbd>⌘</kbd><kbd>K</kbd></span>
|
|
</div>
|
|
<div class="chips" id="categoryChips" role="group" aria-label="Filter by category"></div>
|
|
</div>
|
|
|
|
<main>
|
|
<p class="count" id="count"></p>
|
|
<div class="grid" id="grid"></div>
|
|
<div class="empty" id="empty" hidden>No plugins match your search.</div>
|
|
</main>
|
|
</div>
|
|
|
|
<div class="detail" id="detailView"></div>
|
|
|
|
<footer>
|
|
<div class="wrap">
|
|
<p>built with <a href="https://github.com/everestmcarthur/revenge-plugins">revenge-plugins</a> - not affiliated with Discord or the Revenge project - install links point to this site</p>
|
|
</div>
|
|
</footer>
|
|
|
|
<div class="toast" id="toast" role="status" aria-live="polite"></div>
|
|
|
|
<div class="palette-overlay" id="paletteOverlay">
|
|
<div class="palette">
|
|
<input id="paletteInput" type="text" placeholder="Jump to a plugin…" aria-label="Jump to a plugin">
|
|
<div class="palette-results" id="paletteResults"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
(function () {
|
|
var STATUS_LABEL = { new: "New", revived: "Revived", rebuilt: "Rebuilt" };
|
|
var state = { plugins: [], query: "", category: "All" };
|
|
|
|
var grid = document.getElementById("grid");
|
|
var empty = document.getElementById("empty");
|
|
var count = document.getElementById("count");
|
|
var chipsEl = document.getElementById("categoryChips");
|
|
var searchEl = document.getElementById("search");
|
|
var toastEl = document.getElementById("toast");
|
|
var statsEl = document.getElementById("stats");
|
|
var heroEl = document.getElementById("hero");
|
|
var controlsEl = document.getElementById("controls");
|
|
var gridViewEl = document.getElementById("gridView");
|
|
var detailViewEl = document.getElementById("detailView");
|
|
var paletteOverlay = document.getElementById("paletteOverlay");
|
|
var paletteInput = document.getElementById("paletteInput");
|
|
var paletteResults = document.getElementById("paletteResults");
|
|
|
|
function escapeHtml(str) {
|
|
return String(str).replace(/[&<>"']/g, function (c) {
|
|
return { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }[c];
|
|
});
|
|
}
|
|
|
|
function showToast(msg) {
|
|
toastEl.textContent = msg;
|
|
toastEl.classList.add("show");
|
|
clearTimeout(showToast._t);
|
|
showToast._t = setTimeout(function () { toastEl.classList.remove("show"); }, 1600);
|
|
}
|
|
|
|
function copyToClipboard(text) {
|
|
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
return navigator.clipboard.writeText(text);
|
|
}
|
|
var ta = document.createElement("textarea");
|
|
ta.value = text;
|
|
ta.style.position = "fixed";
|
|
ta.style.opacity = "0";
|
|
document.body.appendChild(ta);
|
|
ta.select();
|
|
try { document.execCommand("copy"); } catch (e) {}
|
|
document.body.removeChild(ta);
|
|
return Promise.resolve();
|
|
}
|
|
|
|
function installButton(url, extraStyle) {
|
|
var btn = document.createElement("button");
|
|
btn.className = "install";
|
|
btn.textContent = "Install";
|
|
if (extraStyle) btn.setAttribute("style", extraStyle);
|
|
btn.addEventListener("click", function (e) {
|
|
e.stopPropagation();
|
|
copyToClipboard(url).then(function () {
|
|
var original = btn.textContent;
|
|
btn.textContent = "Copied!";
|
|
showToast("Install link copied - paste it into Revenge's plugin browser");
|
|
setTimeout(function () { btn.textContent = original; }, 1400);
|
|
});
|
|
});
|
|
return btn;
|
|
}
|
|
|
|
function countUp(el, target) {
|
|
var start = 0;
|
|
var duration = 500;
|
|
var startTime = null;
|
|
function step(ts) {
|
|
if (!startTime) startTime = ts;
|
|
var progress = Math.min((ts - startTime) / duration, 1);
|
|
var eased = 1 - Math.pow(1 - progress, 3);
|
|
el.textContent = Math.round(start + (target - start) * eased);
|
|
if (progress < 1) requestAnimationFrame(step);
|
|
}
|
|
requestAnimationFrame(step);
|
|
}
|
|
|
|
function renderStats() {
|
|
var categories = Array.from(new Set(state.plugins.map(function (p) { return p.category; })));
|
|
var revivedCount = state.plugins.filter(function (p) { return p.status !== "new"; }).length;
|
|
var brokenCount = state.plugins.filter(function (p) { return p.broken; }).length;
|
|
var stats = [
|
|
{ value: state.plugins.length, label: "plugins" },
|
|
{ value: categories.length, label: "categories" },
|
|
{ value: revivedCount, label: "revived or rebuilt" }
|
|
];
|
|
if (brokenCount > 0) stats.push({ value: brokenCount, label: "currently broken" });
|
|
statsEl.innerHTML = stats.map(function (s, i) {
|
|
return '<div><div class="stat-value" id="stat-' + i + '">0</div><div class="stat-label">' + s.label + '</div></div>';
|
|
}).join("");
|
|
stats.forEach(function (s, i) {
|
|
countUp(document.getElementById("stat-" + i), s.value);
|
|
});
|
|
}
|
|
|
|
/* ---------- Grid ---------- */
|
|
|
|
function render() {
|
|
var q = state.query.trim().toLowerCase();
|
|
var filtered = state.plugins.filter(function (p) {
|
|
var matchesCategory = state.category === "All" || p.category === state.category;
|
|
var haystack = (p.name + " " + p.description + " " + p.category + " " + (p.tagline || "") + " " + (p.tags || []).join(" ")).toLowerCase();
|
|
var matchesQuery = !q || haystack.indexOf(q) !== -1;
|
|
return matchesCategory && matchesQuery;
|
|
});
|
|
|
|
count.textContent = filtered.length + " plugin" + (filtered.length === 1 ? "" : "s");
|
|
grid.innerHTML = "";
|
|
empty.hidden = filtered.length !== 0;
|
|
|
|
filtered.forEach(function (p) {
|
|
var card = document.createElement("button");
|
|
card.type = "button";
|
|
card.className = "card" + (p.broken ? " is-broken" : "");
|
|
card.innerHTML =
|
|
'<div class="card-top">' +
|
|
'<h3>' + escapeHtml(p.name) + '</h3>' +
|
|
'<span class="badge ' + (p.broken ? "broken" : p.status) + '">' + (p.broken ? "Broken" : (STATUS_LABEL[p.status] || p.status)) + '</span>' +
|
|
'</div>' +
|
|
'<div class="category">' + escapeHtml(p.category) + '</div>' +
|
|
'<p class="tagline">' + escapeHtml(p.broken ? p.broken.reason : (p.tagline || p.description)) + '</p>' +
|
|
(p.tags && p.tags.length ? '<div class="taglist">' + p.tags.map(function (t) { return '<span>' + escapeHtml(t) + '</span>'; }).join("") + '</div>' : '') +
|
|
'<div class="cta">view details</div>';
|
|
|
|
card.addEventListener("click", function () {
|
|
navigateToPlugin(p.id);
|
|
});
|
|
|
|
grid.appendChild(card);
|
|
});
|
|
}
|
|
|
|
function renderChips() {
|
|
var categories = ["All"].concat(
|
|
Array.from(new Set(state.plugins.map(function (p) { return p.category; }))).sort()
|
|
);
|
|
chipsEl.innerHTML = "";
|
|
categories.forEach(function (cat) {
|
|
var chip = document.createElement("button");
|
|
chip.className = "chip";
|
|
chip.textContent = cat;
|
|
chip.setAttribute("aria-pressed", String(cat === state.category));
|
|
chip.addEventListener("click", function () {
|
|
state.category = cat;
|
|
Array.from(chipsEl.children).forEach(function (c) {
|
|
c.setAttribute("aria-pressed", String(c === chip));
|
|
});
|
|
render();
|
|
});
|
|
chipsEl.appendChild(chip);
|
|
});
|
|
}
|
|
|
|
searchEl.addEventListener("input", function (e) {
|
|
state.query = e.target.value;
|
|
render();
|
|
});
|
|
|
|
window.addEventListener("scroll", function () {
|
|
controlsEl.classList.toggle("stuck", window.scrollY > 8);
|
|
});
|
|
|
|
/* ---------- Detail view ---------- */
|
|
|
|
function renderDetail(p) {
|
|
var featuresHtml = (p.features || []).map(function (f) {
|
|
return '<li>' + escapeHtml(f) + '</li>';
|
|
}).join("");
|
|
|
|
var commandsHtml = (p.commands && p.commands.length)
|
|
? '<div class="detail-section"><h4>Commands</h4><div class="cmd-table">' +
|
|
p.commands.map(function (c) {
|
|
return '<div class="cmd-row"><code>' + escapeHtml(c.cmd) + '</code><span>' + escapeHtml(c.desc) + '</span></div>';
|
|
}).join("") +
|
|
'</div></div>'
|
|
: "";
|
|
|
|
var howItWorksHtml = p.howItWorks
|
|
? '<div class="detail-section"><h4>How it works</h4><p>' + escapeHtml(p.howItWorks) + '</p></div>'
|
|
: "";
|
|
|
|
var featuresSection = featuresHtml
|
|
? '<div class="detail-section"><h4>Features</h4><ul class="feature-list">' + featuresHtml + '</ul></div>'
|
|
: "";
|
|
|
|
var tagsHtml = (p.tags && p.tags.length)
|
|
? '<div class="detail-tags">' + p.tags.map(function (t) { return '<span>' + escapeHtml(t) + '</span>'; }).join("") + '</div>'
|
|
: "";
|
|
|
|
var brokenNote = p.broken
|
|
? '<div class="side-card warn"><h5>Currently broken</h5><p>' + escapeHtml(p.broken.reason) + '</p></div>'
|
|
: "";
|
|
|
|
detailViewEl.innerHTML =
|
|
'<div class="detail-banner">' +
|
|
'<div class="wrap">' +
|
|
'<button class="back-link" id="backLink">all plugins</button>' +
|
|
'<div class="detail-top">' +
|
|
'<h2>' + escapeHtml(p.name) + '</h2>' +
|
|
'<span class="badge ' + (p.broken ? "broken" : p.status) + '">' + (p.broken ? "Broken" : (STATUS_LABEL[p.status] || p.status)) + '</span>' +
|
|
'</div>' +
|
|
'<div class="detail-category">' + escapeHtml(p.category) + '</div>' +
|
|
'<p class="detail-tagline">' + escapeHtml(p.tagline || p.description) + '</p>' +
|
|
tagsHtml +
|
|
'<div class="detail-actions" id="detailActions"></div>' +
|
|
'</div>' +
|
|
'</div>' +
|
|
'<div class="wrap">' +
|
|
'<div class="detail-body">' +
|
|
'<div>' + howItWorksHtml + featuresSection + commandsHtml + '</div>' +
|
|
'<div>' +
|
|
brokenNote +
|
|
(p.note ? '<div class="side-card"><h5>Backstory</h5><p>' + escapeHtml(p.note) + '</p></div>' : "") +
|
|
(p.limitations ? '<div class="side-card warn"><h5>Known limitations</h5><p>' + escapeHtml(p.limitations) + '</p></div>' : "") +
|
|
(p.authors && p.authors.length ? '<div class="side-card"><h5>Author</h5><p class="authors-line">' + escapeHtml(p.authors.join(", ")) + '</p></div>' : "") +
|
|
'</div>' +
|
|
'</div>' +
|
|
'</div>';
|
|
|
|
var actions = document.getElementById("detailActions");
|
|
actions.appendChild(installButton(p.installUrl));
|
|
var sourceLink = document.createElement("a");
|
|
sourceLink.href = p.sourceUrl;
|
|
sourceLink.target = "_blank";
|
|
sourceLink.rel = "noopener";
|
|
sourceLink.textContent = "Source";
|
|
actions.appendChild(sourceLink);
|
|
var issueLink = document.createElement("a");
|
|
issueLink.href = p.issueUrl;
|
|
issueLink.target = "_blank";
|
|
issueLink.rel = "noopener";
|
|
issueLink.textContent = "Report issue";
|
|
actions.appendChild(issueLink);
|
|
|
|
document.getElementById("backLink").addEventListener("click", function () {
|
|
history.pushState(null, "", "/");
|
|
showGrid();
|
|
});
|
|
}
|
|
|
|
function showDetail(id) {
|
|
var plugin = state.plugins.filter(function (p) { return p.id === id; })[0];
|
|
if (!plugin) { showGrid(); return; }
|
|
|
|
renderDetail(plugin);
|
|
heroEl.classList.add("hidden");
|
|
controlsEl.classList.add("hidden");
|
|
gridViewEl.classList.add("hidden");
|
|
detailViewEl.classList.add("active");
|
|
window.scrollTo(0, 0);
|
|
document.title = plugin.name + " · revenge-plugins";
|
|
}
|
|
|
|
function showGrid() {
|
|
heroEl.classList.remove("hidden");
|
|
controlsEl.classList.remove("hidden");
|
|
gridViewEl.classList.remove("hidden");
|
|
detailViewEl.classList.remove("active");
|
|
document.title = "revenge-plugins";
|
|
}
|
|
|
|
/**
|
|
* Each plugin has a real static page at /<id>/ (a copy of this same file), so a direct visit or
|
|
* refresh works without any server-side routing - this just avoids a full reload when navigating
|
|
* from within an already-loaded page.
|
|
*/
|
|
function navigateToPlugin(id) {
|
|
history.pushState(null, "", "/" + id + "/");
|
|
showDetail(id);
|
|
}
|
|
|
|
function routeFromLocation() {
|
|
var match = location.pathname.match(/^\/([\w-]+)\/?$/);
|
|
if (match && match[1]) {
|
|
showDetail(match[1]);
|
|
} else {
|
|
showGrid();
|
|
}
|
|
}
|
|
|
|
window.addEventListener("popstate", routeFromLocation);
|
|
|
|
/* ---------- Command palette ---------- */
|
|
|
|
var paletteIndex = 0;
|
|
var paletteMatches = [];
|
|
|
|
function openPalette() {
|
|
paletteOverlay.classList.add("open");
|
|
paletteInput.value = "";
|
|
renderPalette("");
|
|
setTimeout(function () { paletteInput.focus(); }, 0);
|
|
}
|
|
|
|
function closePalette() {
|
|
paletteOverlay.classList.remove("open");
|
|
}
|
|
|
|
function renderPalette(q) {
|
|
q = q.trim().toLowerCase();
|
|
paletteMatches = state.plugins.filter(function (p) {
|
|
return !q || (p.name + " " + p.category).toLowerCase().indexOf(q) !== -1;
|
|
});
|
|
paletteIndex = 0;
|
|
|
|
if (!paletteMatches.length) {
|
|
paletteResults.innerHTML = '<div class="palette-empty">No matches</div>';
|
|
return;
|
|
}
|
|
|
|
paletteResults.innerHTML = paletteMatches.map(function (p, i) {
|
|
return '<div class="palette-item" data-idx="' + i + '" aria-selected="' + (i === 0) + '">' +
|
|
'<span class="dot"></span><span class="name">' + escapeHtml(p.name) + '</span><span class="cat">' + escapeHtml(p.category) + '</span>' +
|
|
'</div>';
|
|
}).join("");
|
|
|
|
Array.from(paletteResults.children).forEach(function (el, i) {
|
|
el.addEventListener("click", function () { selectPaletteItem(i); });
|
|
});
|
|
}
|
|
|
|
function updatePaletteSelection() {
|
|
Array.from(paletteResults.children).forEach(function (el, i) {
|
|
el.setAttribute("aria-selected", String(i === paletteIndex));
|
|
});
|
|
var active = paletteResults.children[paletteIndex];
|
|
if (active) active.scrollIntoView({ block: "nearest" });
|
|
}
|
|
|
|
function selectPaletteItem(i) {
|
|
var plugin = paletteMatches[i];
|
|
if (!plugin) return;
|
|
closePalette();
|
|
navigateToPlugin(plugin.id);
|
|
}
|
|
|
|
paletteInput.addEventListener("input", function (e) { renderPalette(e.target.value); });
|
|
paletteOverlay.addEventListener("click", function (e) { if (e.target === paletteOverlay) closePalette(); });
|
|
|
|
paletteInput.addEventListener("keydown", function (e) {
|
|
if (e.key === "ArrowDown") { e.preventDefault(); paletteIndex = Math.min(paletteIndex + 1, paletteMatches.length - 1); updatePaletteSelection(); }
|
|
else if (e.key === "ArrowUp") { e.preventDefault(); paletteIndex = Math.max(paletteIndex - 1, 0); updatePaletteSelection(); }
|
|
else if (e.key === "Enter") { e.preventDefault(); selectPaletteItem(paletteIndex); }
|
|
else if (e.key === "Escape") { closePalette(); }
|
|
});
|
|
|
|
document.addEventListener("keydown", function (e) {
|
|
var isTyping = document.activeElement && (document.activeElement.tagName === "INPUT" || document.activeElement.tagName === "TEXTAREA");
|
|
|
|
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k") {
|
|
e.preventDefault();
|
|
openPalette();
|
|
return;
|
|
}
|
|
if (e.key === "/" && !isTyping) {
|
|
e.preventDefault();
|
|
openPalette();
|
|
return;
|
|
}
|
|
if (e.key === "Escape" && paletteOverlay.classList.contains("open")) {
|
|
closePalette();
|
|
}
|
|
});
|
|
|
|
/* ---------- Boot + live updates ---------- */
|
|
|
|
function reloadPlugins(isInitial) {
|
|
return fetch("https://rp.jarviscli.dev/plugins-data.json", { cache: "no-store" })
|
|
.then(function (r) { return r.json(); })
|
|
.then(function (data) {
|
|
state.plugins = data;
|
|
renderStats();
|
|
renderChips();
|
|
render();
|
|
|
|
var match = location.pathname.match(/^\/([\w-]+)\/?$/);
|
|
if (isInitial) {
|
|
routeFromLocation();
|
|
} else if (match && match[1]) {
|
|
// Re-render the open detail page too, in case what changed is the plugin being viewed
|
|
// right now (e.g. it just got marked broken).
|
|
showDetail(match[1]);
|
|
showToast("Updated");
|
|
} else {
|
|
showToast("Updated");
|
|
}
|
|
})
|
|
.catch(function () {
|
|
if (!isInitial) return;
|
|
count.textContent = "";
|
|
empty.hidden = false;
|
|
empty.textContent = "Couldn't load the plugin list - try refreshing.";
|
|
});
|
|
}
|
|
|
|
/**
|
|
* One shared WebSocket room (api/src/index.ts's OverlayHub Durable Object) that every open tab
|
|
* connects to - any successful admin write broadcasts through it, so a change from the admin
|
|
* plugin shows up here without needing a manual refresh. Reconnects with backoff if it drops
|
|
* (Cloudflare recycling the connection, a network blip, etc) rather than just giving up.
|
|
*/
|
|
var liveRetryDelay = 2000;
|
|
function connectLive() {
|
|
var proto = location.protocol === "https:" ? "wss:" : "ws:";
|
|
var ws;
|
|
try {
|
|
ws = new WebSocket(proto + "//" + location.host + "/ws");
|
|
} catch (e) {
|
|
return;
|
|
}
|
|
|
|
ws.addEventListener("open", function () { liveRetryDelay = 2000; });
|
|
ws.addEventListener("message", function () { reloadPlugins(false); });
|
|
ws.addEventListener("close", function () {
|
|
setTimeout(connectLive, liveRetryDelay);
|
|
liveRetryDelay = Math.min(liveRetryDelay * 1.5, 30000);
|
|
});
|
|
ws.addEventListener("error", function () { ws.close(); });
|
|
}
|
|
|
|
reloadPlugins(true);
|
|
connectLive();
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|