refactor: simplify interface and enable sharing defaults

This commit is contained in:
Darío Sevilla committed 2026-10-15 09:27:39 +00:00
1 parent e12164c312
commit 9ba1021acd
11 files changed
+53 -45

No files matched your search

+13 -14
View File
@@ -1,37 +1,36 @@
:root { color-scheme:dark; font:15px/1.5 Inter,ui-sans-serif,system-ui,sans-serif; --bg:#060a0e; --panel:#0b1218; --panel2:#0e1820; --line:#1b2b36; --line2:#28404d; --text:#e8f7fb; --muted:#78909c; --cyan:#45e6ff; --lime:#adff2f; --amber:#ffbe55; }
:root { color-scheme:dark; font:15px/1.5 Inter,ui-sans-serif,system-ui,sans-serif; --bg:#090d12; --panel:#111920; --panel2:#142029; --line:#293944; --line2:#38505e; --text:#f3f7f9; --muted:#a4b2ba; --cyan:#58ddf2; --lime:#b7f45b; --amber:#ffbe55; }
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; background:radial-gradient(circle at 70% -20%,#102c39 0,transparent 38%),var(--bg); color:var(--text); }
body::before { content:""; position:fixed; inset:0; pointer-events:none; opacity:.22; background-image:linear-gradient(rgba(69,230,255,.055) 1px,transparent 1px),linear-gradient(90deg,rgba(69,230,255,.055) 1px,transparent 1px); background-size:32px 32px; mask-image:linear-gradient(to bottom,#000,transparent 80%); }
body::before { content:""; position:fixed; inset:0; pointer-events:none; opacity:.12; background-image:linear-gradient(rgba(69,230,255,.055) 1px,transparent 1px),linear-gradient(90deg,rgba(69,230,255,.055) 1px,transparent 1px); background-size:32px 32px; mask-image:linear-gradient(to bottom,#000,transparent 80%); }
.noise { position:fixed; inset:0; pointer-events:none; opacity:.025; background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
main { position:relative; width:min(920px,calc(100% - 40px)); margin:0 auto; padding:46px 0 70px; }
.masthead { display:flex; align-items:center; justify-content:space-between; margin-bottom:30px; }
.identity { display:flex; align-items:center; gap:17px; }
.logo-shell { width:68px; height:68px; display:grid; place-items:center; border:1px solid #285064; border-radius:16px; background:linear-gradient(145deg,#132935,#081117); box-shadow:0 0 38px rgba(69,230,255,.1),inset 0 1px rgba(255,255,255,.04); }
.logo-shell img { width:53px; height:53px; object-fit:contain; }
.kicker,.section-tag,.system-state,.counter,.connected,.endpoint,.actions button { font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace; letter-spacing:.1em; }
.kicker,.section-tag,.system-state,.counter,.connected,.endpoint { font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace; letter-spacing:.06em; }
.kicker,.section-tag { margin:0 0 3px; color:var(--cyan); font-size:10px; font-weight:700; }
h1 { margin:0; font-size:34px; line-height:1.1; letter-spacing:-.035em; }
.lead { margin:5px 0 0; color:var(--muted); font-size:14px; }
.system-state { display:flex; align-items:center; gap:10px; padding:10px 13px; border:1px solid var(--line); border-radius:8px; background:rgba(8,16,21,.7); }
.system-state small,.system-state strong { display:block; font-size:9px; }.system-state small { color:var(--muted); }.system-state strong { margin-top:2px; color:var(--lime); }
.system-state { display:flex; align-items:center; gap:9px; padding:9px 12px; border:1px solid var(--line); border-radius:8px; background:rgba(15,24,30,.8); }
.system-state strong { color:var(--lime); font-size:10px; }
.state-dot { width:9px; height:9px; border-radius:50%; background:var(--lime); box-shadow:0 0 13px rgba(173,255,47,.75); }
form { display:grid; gap:16px; }
.panel { position:relative; padding:25px; border:1px solid var(--line); border-radius:14px; background:linear-gradient(145deg,rgba(14,24,32,.96),rgba(8,14,19,.97)); box-shadow:inset 0 1px rgba(255,255,255,.025),0 18px 50px rgba(0,0,0,.12); }
.panel { position:relative; padding:23px; border:1px solid var(--line); border-radius:14px; background:linear-gradient(145deg,rgba(19,29,37,.98),rgba(13,20,26,.98)); box-shadow:inset 0 1px rgba(255,255,255,.025),0 18px 50px rgba(0,0,0,.12); }
.panel::after { content:""; position:absolute; top:-1px; left:25px; width:70px; height:1px; background:var(--cyan); box-shadow:0 0 10px var(--cyan); opacity:.65; }
.master-panel { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:20px; }
.panel-index { color:#294450; font:700 36px/1 "SFMono-Regular",Consolas,monospace; }
.master-panel { display:grid; grid-template-columns:1fr auto; align-items:center; gap:20px; }
.panel-copy h2,.section-head h2 { margin:0; font-size:20px; letter-spacing:-.015em; }.panel-copy p:last-child,.hint { margin:5px 0 0; color:var(--muted); font-size:13px; }
.section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:18px; }
.counter { flex:none; margin-top:4px; padding:6px 9px; border:1px solid var(--line2); border-radius:5px; color:#9db4bf; font-size:9px; }
.counter { flex:none; margin-top:4px; padding:6px 9px; border:1px solid var(--line2); border-radius:5px; color:#bdd0d8; font-size:10px; }
.switch { display:flex; align-items:center; gap:9px; cursor:pointer; }.switch input { position:absolute; opacity:0; }.switch b { color:var(--muted); font:700 9px "SFMono-Regular",Consolas,monospace; letter-spacing:.1em; }.track { width:48px; height:26px; padding:4px; border:1px solid #2a3c46; border-radius:99px; background:#111b21; transition:.2s; }.track span { display:block; width:16px; height:16px; border-radius:50%; background:#657b86; transition:.2s; }.switch input:checked + .track { border-color:rgba(69,230,255,.7); background:rgba(69,230,255,.1); }.switch input:checked + .track span { transform:translateX(22px); background:var(--cyan); box-shadow:0 0 12px rgba(69,230,255,.75); }.switch input:checked ~ b { color:var(--cyan); }
.country-tools { display:flex; align-items:center; gap:10px; margin-bottom:11px; }.search-shell { flex:1; display:flex; align-items:center; gap:10px; padding:0 13px; border:1px solid var(--line2); border-radius:8px; background:#070c10; color:var(--cyan); }.search-shell:focus-within { border-color:#3cbdd0; box-shadow:0 0 0 3px rgba(69,230,255,.07); }.search-shell input { width:100%; border:0; outline:0; padding:11px 0; background:transparent; color:var(--text); font:inherit; }.search-shell input::placeholder { color:#506872; }
button { cursor:pointer; }.ghost,.primary,.danger { border-radius:7px; padding:11px 14px; font-weight:700; }.ghost { border:1px solid var(--line2); background:transparent; color:#8da4ae; font:700 9px "SFMono-Regular",Consolas,monospace; letter-spacing:.08em; }.ghost:hover { border-color:var(--cyan); color:var(--cyan); }
button { cursor:pointer; }.ghost,.primary,.danger { border-radius:7px; padding:11px 14px; font-weight:700; }.ghost { border:1px solid var(--line2); background:transparent; color:#b6c4ca; font:700 12px Inter,ui-sans-serif,system-ui,sans-serif; }.ghost:hover { border-color:var(--cyan); color:var(--cyan); }
.country-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:7px; max-height:420px; overflow:auto; scrollbar-color:#284550 #081016; padding:10px; border:1px solid var(--line); border-radius:10px; background:#070c10; }
.country-option { display:flex; align-items:center; gap:9px; min-width:0; padding:8px 9px; border:1px solid transparent; border-radius:7px; cursor:pointer; transition:.15s; }.country-option:hover { border-color:#203844; background:#0e1a21; }.country-option:has(input:checked) { border-color:rgba(69,230,255,.32); background:rgba(69,230,255,.075); }.country-option[hidden] { display:none; }.country-option input { accent-color:var(--cyan); }.country-flag { font-size:19px; line-height:1; }.country-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
.setting-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }.setting-card { display:flex; align-items:flex-start; gap:11px; padding:14px; border:1px solid var(--line); border-radius:9px; background:#091017; cursor:pointer; transition:.15s; }.setting-card:hover { border-color:#2d4a58; }.setting-card input { position:absolute; opacity:0; }.checkmark { flex:0 0 auto; width:18px; height:18px; border:1px solid #34505c; border-radius:4px; background:#071015; }.setting-card input:checked + .checkmark { border-color:var(--cyan); background:var(--cyan); box-shadow:0 0 12px rgba(69,230,255,.25); }.setting-card input:checked + .checkmark::after { content:""; display:block; width:8px; height:4px; margin:4px 0 0 4px; border:solid #041014; border-width:0 0 2px 2px; transform:rotate(-45deg); }.setting-card strong,.setting-card small { display:block; }.setting-card strong { font-size:13px; }.setting-card small { margin-top:3px; color:var(--muted); font-size:11px; line-height:1.45; }
.connected { display:flex; align-items:center; gap:7px; padding:6px 9px; border:1px solid rgba(173,255,47,.22); border-radius:5px; color:var(--lime); font-size:9px; }.connected i { width:6px; height:6px; border-radius:50%; background:var(--lime); box-shadow:0 0 9px rgba(173,255,47,.75); }
.endpoint { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:13px; margin-bottom:11px; padding:12px 13px; border:1px solid var(--line); border-radius:8px; background:#070d12; color:var(--muted); font-size:9px; }.endpoint code { overflow:hidden; color:#b8d6df; font-size:12px; letter-spacing:0; text-overflow:ellipsis; }.lock { color:#4f6873; }
.setting-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }.setting-card { display:flex; align-items:flex-start; gap:11px; padding:14px; border:1px solid var(--line); border-radius:9px; background:#091017; cursor:pointer; transition:.15s; }.setting-card:hover { border-color:#2d4a58; }.setting-card input { position:absolute; opacity:0; }.checkmark { flex:0 0 auto; width:18px; height:18px; border:1px solid #34505c; border-radius:4px; background:#071015; }.setting-card input:checked + .checkmark { border-color:var(--cyan); background:var(--cyan); box-shadow:0 0 12px rgba(69,230,255,.25); }.setting-card input:checked + .checkmark::after { content:""; display:block; width:8px; height:4px; margin:4px 0 0 4px; border:solid #041014; border-width:0 0 2px 2px; transform:rotate(-45deg); }.setting-card strong,.setting-card small { display:block; }.setting-card strong { font-size:13px; }.setting-card small { margin-top:3px; color:var(--muted); font-size:12px; line-height:1.4; }
.connected { display:flex; align-items:center; gap:7px; padding:6px 9px; border:1px solid rgba(183,244,91,.28); border-radius:5px; color:var(--lime); font-size:10px; }.connected i { width:6px; height:6px; border-radius:50%; background:var(--lime); box-shadow:0 0 9px rgba(173,255,47,.75); }
.endpoint { margin-bottom:11px; padding:12px 13px; border:1px solid var(--line); border-radius:8px; background:#0c1318; }.endpoint code { overflow:hidden; color:#b8d6df; font-size:12px; letter-spacing:0; text-overflow:ellipsis; }.lock { color:#4f6873; }
.contribution { max-width:none; }
.actions { display:flex; align-items:center; justify-content:space-between; min-height:50px; padding:4px 1px; }.actions > div { display:flex; gap:10px; }.primary { border:1px solid #2bc7de; background:linear-gradient(90deg,rgba(23,158,180,.25),rgba(69,230,255,.1)); color:var(--cyan); }.primary:hover { background:rgba(69,230,255,.16); box-shadow:0 0 20px rgba(69,230,255,.1); }.danger { border:1px solid #44363a; background:transparent; color:#c28c94; }.danger:hover { border-color:#a45762; color:#ff9aa7; }#status { min-width:170px; margin:0; color:var(--lime); font:11px "SFMono-Regular",Consolas,monospace; text-align:right; }
button:focus-visible,input:focus-visible,label:has(input:focus-visible) { outline:2px solid var(--cyan); outline-offset:2px; }
@media (max-width:680px) { main { width:min(100% - 24px,920px); padding-top:24px; }.masthead { align-items:flex-start; }.system-state { display:none; }.master-panel { grid-template-columns:auto 1fr; }.master-panel .switch { grid-column:2; }.section-head { display:block; }.counter,.connected { display:inline-flex; margin-top:10px; }.setting-grid { grid-template-columns:1fr; }.endpoint { grid-template-columns:1fr; }.endpoint span { display:none; }.actions { align-items:flex-start; gap:12px; flex-direction:column; }.actions > div { width:100%; }.actions button { flex:1; }#status { text-align:left; } }
@media (max-width:680px) { main { width:min(100% - 24px,920px); padding-top:24px; }.masthead { align-items:flex-start; }.system-state { display:none; }.master-panel { grid-template-columns:1fr; }.section-head { display:block; }.counter,.connected { display:inline-flex; margin-top:10px; }.setting-grid { grid-template-columns:1fr; }.endpoint { grid-template-columns:1fr; }.endpoint span { display:none; }.actions { align-items:flex-start; gap:12px; flex-direction:column; }.actions > div { width:100%; }.actions button { flex:1; }#status { text-align:left; } }
+14 -15
View File
@@ -5,39 +5,38 @@
<div class="noise" aria-hidden="true"></div>
<main>
<header class="masthead">
<div class="identity"><div class="logo-shell"><img src="../icons/icon.png" alt=""></div><div><p class="kicker">XGB // CONTROL SYSTEM</p><h1>X GeoBlock</h1><p class="lead">Geographic signal filtering for your X timeline.</p></div></div>
<div class="system-state"><span class="state-dot"></span><div><small>SYSTEM STATUS</small><strong>OPERATIONAL</strong></div></div>
<div class="identity"><div class="logo-shell"><img src="../icons/icon.png" alt=""></div><div><h1>X GeoBlock</h1><p class="lead">Location filtering for your X timeline.</p></div></div>
<div class="system-state"><span class="state-dot"></span><strong>Operational</strong></div>
</header>
<form id="settings">
<section class="panel master-panel">
<div class="panel-index">01</div>
<div class="panel-copy"><p class="section-tag">CORE</p><h2>Filter engine</h2><p>Analyze posts as they enter the timeline and apply your location rules.</p></div>
<label class="switch" for="enabled"><input id="enabled" type="checkbox"><span class="track"><span></span></span><b>ACTIVE</b></label>
<div class="panel-copy"><h2>Filtering</h2><p>Apply location rules as posts load.</p></div>
<label class="switch" for="enabled"><input id="enabled" type="checkbox"><span class="track"><span></span></span><b>Enabled</b></label>
</section>
<section class="panel">
<div class="section-head"><div><p class="section-tag">02 // TARGET MATRIX</p><h2>Blocked locations</h2><p class="hint">Select countries or broader regions reported by X. The list starts empty.</p></div><div class="counter" id="selection-count">0 locations selected</div></div>
<div class="country-tools"><label class="search-shell"><span aria-hidden="true">⌕</span><input id="country-search" type="search" placeholder="Search location database…" autocomplete="off"></label><button type="button" class="ghost" id="clear-selection">CLEAR ALL</button></div>
<div class="section-head"><div><h2>Blocked locations</h2><p class="hint">Countries and regions reported by X.</p></div><div class="counter" id="selection-count">0 locations selected</div></div>
<div class="country-tools"><label class="search-shell"><span aria-hidden="true">⌕</span><input id="country-search" type="search" placeholder="Search locations…" autocomplete="off"></label><button type="button" class="ghost" id="clear-selection">Clear</button></div>
<div id="country-list" class="country-list"></div>
</section>
<section class="panel">
<div class="section-head"><div><p class="section-tag">03 // BEHAVIOR</p><h2>Interface controls</h2></div></div>
<div class="section-head"><div><h2>Behavior</h2></div></div>
<div class="setting-grid">
<label class="setting-card"><input id="placeholder" type="checkbox"><span class="checkmark"></span><span><strong>Reveal controls</strong><small>Show a clickable marker where a post was hidden.</small></span></label>
<label class="setting-card"><input id="debug-mode" type="checkbox"><span class="checkmark"></span><span><strong>Diagnostic stream</strong><small>Write detailed activity to the X page console.</small></span></label>
<label class="setting-card"><input id="skip-followed" type="checkbox"><span class="checkmark"></span><span><strong>Ignore followed accounts</strong><small>Always allow posts from accounts you follow.</small></span></label>
<label class="setting-card"><input id="placeholder" type="checkbox"><span class="checkmark"></span><span><strong>Reveal controls</strong><small>Show a marker for hidden posts.</small></span></label>
<label class="setting-card"><input id="debug-mode" type="checkbox"><span class="checkmark"></span><span><strong>Debug logging</strong><small>Log activity in the X console.</small></span></label>
<label class="setting-card"><input id="skip-followed" type="checkbox"><span class="checkmark"></span><span><strong>Ignore followed accounts</strong><small>Always allow accounts you follow.</small></span></label>
</div>
</section>
<section class="panel cloud-panel">
<div class="section-head"><div><p class="section-tag">04 // DISTRIBUTED CACHE</p><h2>Cloud relay</h2><p class="hint">Confirmed shared results reduce requests to X. Reads are enabled automatically.</p></div><span class="connected"><i></i>CONNECTED</span></div>
<div class="endpoint"><span>ENDPOINT</span><code>x-geoblock-cache.dariosevilla.es</code><span class="lock" aria-label="Fixed endpoint">LOCKED</span></div>
<label class="setting-card contribution"><input id="cloud-contribute" type="checkbox"><span class="checkmark"></span><span><strong>Contribute observations</strong><small>Send a SHA-256 username hash and observed location. Following data, posts and your blocklist stay local.</small></span></label>
<div class="section-head"><div><h2>Cloud cache</h2><p class="hint">Shared results reduce requests to X.</p></div><span class="connected"><i></i>Connected</span></div>
<div class="endpoint"><code>x-geoblock-cache.dariosevilla.es</code></div>
<label class="setting-card contribution"><input id="cloud-contribute" type="checkbox"><span class="checkmark"></span><span><strong>Contribute observations</strong><small>Share hashed usernames and detected locations.</small></span></label>
</section>
<footer class="actions"><div><button type="submit" class="primary">SAVE CONFIGURATION</button><button type="button" class="danger" id="clear">PURGE LOCAL CACHE</button></div><p id="status" role="status"></p></footer>
<footer class="actions"><div><button type="submit" class="primary">Save settings</button><button type="button" class="danger" id="clear">Clear cache</button></div><p id="status" role="status"></p></footer>
</form>
</main>
<script src="../lib/config.js"></script><script src="../lib/countries.js"></script><script src="../lib/cloud-cache.js"></script><script src="options.js"></script>