mirror of
https://github.com/Dasemu/X-GeoBlock.git
synced 2026-11-26 23:36:11 +00:00
feat: redesign controls and configure cloud cache
This commit is contained in:
1 parent
070e07845c
commit
e12164c312
15 files changed
+178
-78
No files matched your search
+35
-1
@@ -1 +1,35 @@
|
||||
:root { color-scheme: light dark; font: 14px/1.4 system-ui,sans-serif; } body { margin: 0; min-width: 280px; background: #0f1419; color: #e7e9ea; } main { padding: 18px; } .brand { display:flex; align-items:center; gap:10px; margin-bottom:16px; }.brand img { width:36px; height:36px; object-fit:contain; }h1 { font-size: 20px; margin: 0; } label { display:block; } p { color:#8b98a5; } button { border:0; border-radius:999px; padding:8px 14px; background:#1d9bf0; color:white; font-weight:700; cursor:pointer; }
|
||||
: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; }
|
||||
* { 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%); }
|
||||
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); }
|
||||
.brand img { width:34px; height:34px; object-fit:contain; }
|
||||
.eyebrow,.version,.status-line,.metric,.cloud-line,button { font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace; letter-spacing:.08em; }
|
||||
.eyebrow { margin:0 0 1px; color:var(--cyan); font-size:9px; }
|
||||
h1 { margin:0; font-size:19px; letter-spacing:-.02em; }
|
||||
.version { margin-left:auto; color:#5e7482; font-size:9px; border:1px solid var(--line); padding:3px 6px; border-radius:4px; }
|
||||
.status-card { overflow:hidden; border:1px solid var(--line); border-radius:12px; background:linear-gradient(135deg,rgba(16,29,39,.96),rgba(9,14,20,.96)); box-shadow:inset 0 1px rgba(255,255,255,.025); }
|
||||
.status-line { display:flex; align-items:center; gap:7px; padding:9px 12px; border-bottom:1px solid var(--line); color:var(--muted); font-size:9px; }
|
||||
.status-line strong { margin-left:auto; color:var(--lime); font-size:9px; }
|
||||
.pulse,.cloud-dot { width:7px; height:7px; border-radius:50%; background:var(--lime); box-shadow:0 0 10px rgba(173,255,47,.7); }
|
||||
body[data-enabled="false"] .pulse { background:#ffb84d; box-shadow:0 0 10px rgba(255,184,77,.6); }
|
||||
body[data-enabled="false"] .status-line strong { color:#ffb84d; }
|
||||
.switch-row { display:flex; align-items:center; justify-content:space-between; padding:14px 13px; cursor:pointer; }
|
||||
.switch-row strong,.switch-row small { display:block; }
|
||||
.switch-row strong { font-size:14px; }
|
||||
.switch-row small { margin-top:2px; color:var(--muted); font-size:11px; }
|
||||
.switch { position:relative; width:44px; height:24px; }
|
||||
.switch input { position:absolute; opacity:0; }
|
||||
.slider { position:absolute; inset:0; border:1px solid #2b3d49; border-radius:99px; background:#131e26; transition:.2s; }
|
||||
.slider::after { content:""; position:absolute; width:16px; height:16px; left:3px; top:3px; border-radius:50%; background:#6f8490; transition:.2s; }
|
||||
.switch input:checked + .slider { border-color:rgba(69,230,255,.6); background:rgba(69,230,255,.12); }
|
||||
.switch input:checked + .slider::after { transform:translateX(20px); background:var(--cyan); box-shadow:0 0 12px rgba(69,230,255,.7); }
|
||||
.metric { display:flex; justify-content:space-between; margin-top:12px; padding:11px 12px; border:1px solid var(--line); border-radius:9px; color:var(--muted); font-size:10px; }
|
||||
.metric strong { color:#dffaff; }
|
||||
.cloud-line { display:flex; align-items:center; gap:7px; margin:12px 2px 16px; color:#6f8997; font-size:9px; }
|
||||
.cloud-dot { width:5px; height:5px; background:var(--cyan); box-shadow:0 0 8px rgba(69,230,255,.8); }
|
||||
button { width:100%; display:flex; justify-content:space-between; align-items:center; border:1px solid #2bc7de; border-radius:8px; padding:11px 13px; background:linear-gradient(90deg,rgba(28,167,190,.2),rgba(69,230,255,.08)); color:var(--cyan); font-size:10px; font-weight:700; cursor:pointer; transition:.18s; }
|
||||
button:hover { background:rgba(69,230,255,.17); box-shadow:0 0 20px rgba(69,230,255,.1); }
|
||||
button:focus-visible,input:focus-visible { outline:2px solid var(--cyan); outline-offset:2px; }
|
||||
+12
-2
@@ -1,2 +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><div class="brand"><img src="../icons/icon.png" alt=""><h1>X GeoBlock</h1></div><label><input id="enabled" type="checkbox"> Filtering enabled</label><p id="summary"></p><button id="settings">Open settings</button></main><script src="../lib/config.js"></script><script src="popup.js"></script></body></html>
|
||||
<!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>
|
||||
<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>
|
||||
<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="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>
|
||||
</main><script src="../lib/config.js"></script><script src="popup.js"></script></body></html>
|
||||
+10
-2
@@ -2,9 +2,17 @@
|
||||
const extensionApi = globalThis.browser || chrome;
|
||||
const enabled = document.querySelector("#enabled");
|
||||
const summary = document.querySelector("#summary");
|
||||
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 = `${value.blacklist.length} ${value.blacklist.length === 1 ? "country" : "countries"} blocked.`;
|
||||
summary.textContent = `${String(value.blacklist.length).padStart(2, "0")} 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";
|
||||
document.body.dataset.enabled = String(enabled.checked);
|
||||
});
|
||||
enabled.addEventListener("change", () => extensionApi.storage.sync.set({ enabled: enabled.checked }));
|
||||
document.querySelector("#settings").addEventListener("click", () => extensionApi.runtime.openOptionsPage());
|
||||
Reference in new issue
Block a user