mirror of
https://github.com/Dasemu/X-GeoBlock.git
synced 2026-11-26 23:36:11 +00:00
refactor: simplify interface and enable sharing defaults
This commit is contained in:
1 parent
e12164c312
commit
9ba1021acd
11 files changed
+53
-45
No files matched your search
+2
-2
@@ -1,7 +1,7 @@
|
||||
:root { color-scheme: dark; font: 14px/1.45 Inter, ui-sans-serif, system-ui, sans-serif; --bg:#070b10; --panel:#0d141c; --line:#1c2b38; --cyan:#45e6ff; --lime:#adff2f; --muted:#78909f; }
|
||||
:root { color-scheme: dark; font: 14px/1.45 Inter, ui-sans-serif, system-ui, sans-serif; --bg:#0a0e13; --panel:#121b22; --line:#2a3a45; --cyan:#58ddf2; --lime:#b7f45b; --muted:#a0afb7; }
|
||||
* { box-sizing:border-box; }
|
||||
body { margin:0; min-width:340px; background:var(--bg); color:#edfaff; }
|
||||
body::before { content:""; position:fixed; inset:0; pointer-events:none; opacity:.24; background-image:linear-gradient(rgba(69,230,255,.07) 1px,transparent 1px),linear-gradient(90deg,rgba(69,230,255,.07) 1px,transparent 1px); background-size:24px 24px; mask-image:linear-gradient(to bottom,#000,transparent 72%); }
|
||||
body::before { content:""; position:fixed; inset:0; pointer-events:none; opacity:.12; background-image:linear-gradient(rgba(69,230,255,.07) 1px,transparent 1px),linear-gradient(90deg,rgba(69,230,255,.07) 1px,transparent 1px); background-size:24px 24px; mask-image:linear-gradient(to bottom,#000,transparent 72%); }
|
||||
main { position:relative; padding:20px; }
|
||||
.brand { display:flex; align-items:center; gap:11px; margin-bottom:18px; }
|
||||
.logo-shell { width:43px; height:43px; display:grid; place-items:center; border:1px solid #244253; border-radius:11px; background:linear-gradient(145deg,#132430,#081016); box-shadow:0 0 24px rgba(69,230,255,.09); }
|
||||
|
||||
+4
-4
@@ -1,12 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>X GeoBlock</title><link rel="stylesheet" href="popup.css"></head>
|
||||
<body><main>
|
||||
<header class="brand"><div class="logo-shell"><img src="../icons/icon.png" alt=""></div><div><p class="eyebrow">NETWORK FILTER</p><h1>X GeoBlock</h1></div><span class="version" id="version">v—</span></header>
|
||||
<header class="brand"><div class="logo-shell"><img src="../icons/icon.png" alt=""></div><div><h1>X GeoBlock</h1><p class="eyebrow">Timeline location filter</p></div><span class="version" id="version">v—</span></header>
|
||||
<section class="status-card">
|
||||
<div class="status-line"><span class="pulse" aria-hidden="true"></span><span>FILTER ENGINE</span><strong id="engine-status">ONLINE</strong></div>
|
||||
<div class="status-line"><span class="pulse" aria-hidden="true"></span><span>Filter status</span><strong id="engine-status">Online</strong></div>
|
||||
<label class="switch-row" for="enabled"><span><strong>Protection</strong><small>Scan posts as they load</small></span><span class="switch"><input id="enabled" type="checkbox"><span class="slider"></span></span></label>
|
||||
</section>
|
||||
<div class="metric"><span>BLOCKLIST</span><strong id="summary">—</strong></div>
|
||||
<div class="metric"><span>Blocklist</span><strong id="summary">—</strong></div>
|
||||
<div class="cloud-line"><span class="cloud-dot"></span><span>Cloud cache linked</span></div>
|
||||
<button id="settings"><span>OPEN CONTROL PANEL</span><span aria-hidden="true">→</span></button>
|
||||
<button id="settings"><span>Open settings</span><span aria-hidden="true">→</span></button>
|
||||
</main><script src="../lib/config.js"></script><script src="popup.js"></script></body></html>
|
||||
+3
-3
@@ -6,13 +6,13 @@ const engineStatus = document.querySelector("#engine-status");
|
||||
document.querySelector("#version").textContent = `v${extensionApi.runtime.getManifest().version}`;
|
||||
extensionApi.storage.sync.get(XGeoConfig.DEFAULT_SETTINGS).then((value) => {
|
||||
enabled.checked = value.enabled;
|
||||
summary.textContent = `${String(value.blacklist.length).padStart(2, "0")} LOCATIONS`;
|
||||
engineStatus.textContent = value.enabled ? "ONLINE" : "PAUSED";
|
||||
summary.textContent = `${value.blacklist.length} locations`;
|
||||
engineStatus.textContent = value.enabled ? "Online" : "Paused";
|
||||
document.body.dataset.enabled = String(value.enabled);
|
||||
});
|
||||
enabled.addEventListener("change", () => {
|
||||
extensionApi.storage.sync.set({ enabled: enabled.checked });
|
||||
engineStatus.textContent = enabled.checked ? "ONLINE" : "PAUSED";
|
||||
engineStatus.textContent = enabled.checked ? "Online" : "Paused";
|
||||
document.body.dataset.enabled = String(enabled.checked);
|
||||
});
|
||||
document.querySelector("#settings").addEventListener("click", () => extensionApi.runtime.openOptionsPage());
|
||||
Reference in new issue
Block a user