This repository was archived by the owner on Feb 5, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
394 lines (334 loc) · 22.1 KB
/
Copy pathindex.html
File metadata and controls
394 lines (334 loc) · 22.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SQUIGLINK MONITOR</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap" rel="stylesheet">
<script src="https://cdn.tailwindcss.com"></script>
<style>
:root { --bg: #050505; --card: #111111; --border: #222222; --text: #f4f4f5; }
body { background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif; -webkit-font-smoothing: antialiased; }
.mono { font-family: 'JetBrains Mono', monospace; }
.stat-bar { background: var(--card); border: 1px solid var(--border); border-radius: 4px; display: flex; divide-x: 1px; divide-color: var(--border); }
.stat-segment { padding: 0.75rem 1.25rem; flex: 1; }
.item-row { border-bottom: 1px solid #161616; transition: all 0.2s ease; }
.item-row:hover { background: #0c0c0c; border-bottom-color: #333; }
.tab-btn, .filter-btn {
padding: 0.5rem 1rem;
font-size: 11px;
letter-spacing: 0.05em;
text-transform: uppercase;
color: #71717a;
font-weight: 700;
transition: all 0.2s;
}
.tab-btn.active { color: #ffffff; border-bottom: 2px solid #ffffff; }
.filter-btn { border: 1px solid var(--border); border-radius: 4px; background: #0a0a0a; }
.filter-btn.active { border-color: #52525b; color: #fff; background: #18181b; }
.filter-count { font-size: 9px; background: #27272a; color: #fff; padding: 1px 5px; border-radius: 10px; margin-left: 4px; }
.chart-bar-container { background: #1a1a1a; height: 8px; border-radius: 2px; overflow: hidden; margin: 8px 0; }
.chart-bar-fill { height: 100%; transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); }
.recent-list-mini li { margin-bottom: 6px; border-left: 2px solid #222; padding-left: 8px; font-size: 13px; }
.legend-dot { width: 8px; height: 8px; border-radius: 1px; display: inline-block; margin-right: 6px; }
input#search { border-bottom: 1px solid #18181b; font-weight: 600; }
input#search:focus { border-bottom-color: #52525b; background: rgba(255,255,255,0.01); }
.rig-tag {
font-size: 9px;
padding: 1px 6px;
border-radius: 2px;
font-weight: 800;
letter-spacing: 0.02em;
text-transform: uppercase;
}
</style>
</head>
<body class="max-w-6xl lg:max-w-7xl mx-auto px-6 py-8">
<header class="mb-8">
<div class="stat-bar mb-6">
<div class="stat-segment border-r border-zinc-800">
<span class="block text-[9px] uppercase tracking-widest text-zinc-500 font-bold mb-0.5">Syncs (12H)</span>
<span id="stat-total" class="text-lg font-bold mono text-white">0</span>
</div>
<div class="stat-segment border-r border-zinc-800">
<span class="block text-[9px] uppercase tracking-widest text-zinc-500 font-bold mb-0.5">Total Database</span>
<span id="stat-db-total" class="text-lg font-bold mono text-white">0</span>
</div>
<div class="stat-segment">
<span class="block text-[9px] uppercase tracking-widest text-zinc-500 font-bold mb-0.5">Reviewers</span>
<span id="stat-sources" class="text-lg font-bold mono text-white">0</span>
</div>
</div>
<div class="flex flex-col md:flex-row justify-between items-center border-b border-zinc-900 mb-6 gap-4">
<div class="flex gap-2">
<button onclick="switchTab('feed')" id="tab-feed" class="tab-btn active mono">Live Feed</button>
<button onclick="switchTab('stats')" id="tab-stats" class="tab-btn mono">Statistics</button>
</div>
<div class="flex items-center gap-3 py-1.5 px-3 bg-zinc-900/40 rounded-full border border-zinc-800/50 mb-1">
<span class="text-[9px] mono text-zinc-500 uppercase font-bold tracking-widest">System Live</span>
<span class="relative flex h-1.5 w-1.5">
<span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-500 opacity-75"></span>
<span class="relative inline-flex rounded-full h-1.5 w-1.5 bg-emerald-500"></span>
</span>
</div>
</div>
<div id="rig-filters-container">
<div class="flex flex-col gap-4 mb-6">
<div class="flex flex-col md:flex-row justify-between gap-4">
<div id="rig-filters" class="flex gap-2">
<button onclick="setRigFilter('ALL')" class="filter-btn active mono" id="filter-ALL">All <span class="filter-count" id="count-ALL">0</span></button>
<button onclick="setRigFilter('711')" class="filter-btn mono" id="filter-711">711 <span class="filter-count" id="count-711">0</span></button>
<button onclick="setRigFilter('5128')" class="filter-btn mono" id="filter-5128">5128 <span class="filter-count" id="count-5128">0</span></button>
</div>
<div id="global-legend" class="flex flex-wrap gap-x-4 gap-y-1 mono text-[9px] uppercase font-bold text-zinc-600">
<div class="flex items-center"><span class="legend-dot bg-emerald-500"></span>5128 IEM</div>
<div class="flex items-center"><span class="legend-dot bg-zinc-600"></span>711 IEM</div>
<div class="flex items-center"><span class="legend-dot bg-blue-500"></span>711 HP</div>
<div class="flex items-center"><span class="legend-dot bg-indigo-500"></span>TWS</div>
</div>
</div>
<div id="type-filters" class="flex gap-2">
<button onclick="setTypeFilter('ALL')" class="filter-btn active mono" id="type-ALL">All Types <span class="filter-count" id="tcount-ALL">0</span></button>
<button onclick="setTypeFilter('IEM')" class="filter-btn mono" id="type-IEM">IE <span class="filter-count" id="tcount-IEM">0</span></button>
<button onclick="setTypeFilter('Over-Ear')" class="filter-btn mono" id="type-OE">OE <span class="filter-count" id="tcount-OE">0</span></button>
</div>
</div>
<input type="text" id="search" placeholder="FILTER MEASUREMENTS..."
class="w-full bg-transparent py-3 text-lg outline-none transition-all uppercase tracking-widest text-white placeholder-zinc-800">
</div>
</header>
<main id="feed" class="flex flex-col"></main>
<main id="stats" class="hidden flex flex-col py-4 space-y-10"></main>
<button id="load-all-btn" class="mono text-xs uppercase hidden border border-zinc-800 py-3 w-full mt-6 hover:bg-white hover:text-black transition-all">Load More Entries</button>
<script>
let fullHistory = [];
let currentFilteredSet = [];
let databaseData = {};
let currentIndex = 0;
let currentTab = 'feed';
let currentRigFilter = 'ALL';
let currentTypeFilter = 'ALL';
let searchTimeout = null;
const THEME_COLORS = {
"IEM (5128)": { text: "text-white", bg: "bg-emerald-600", tagBg: "bg-emerald-950/50" },
"Over-Ear (5128)": { text: "text-white", bg: "bg-teal-600", tagBg: "bg-teal-950/50" },
"IEM (711)": { text: "text-white", bg: "bg-zinc-700", tagBg: "bg-zinc-900" },
"Over-Ear (711)": { text: "text-white", bg: "bg-blue-600", tagBg: "bg-blue-950/50" },
"TWS & Earbuds": { text: "text-white", bg: "bg-indigo-600", tagBg: "bg-indigo-950/50" },
"Misc/Unknown": { text: "text-white", bg: "bg-amber-800", tagBg: "bg-amber-950/50" }
};
let statsPagination = { "IEM (5128)": 15, "Over-Ear (5128)": 15, "IEM (711)": 15, "Over-Ear (711)": 15, "Misc/Unknown": 10, "TWS & Earbuds": 10 };
const PAGE_SIZE = 50;
const NEW_BADGE_MS = 4 * 60 * 60 * 1000;
function toLocalTime(dateStr) {
if (!dateStr) return null;
const months = { Jan:0, Feb:1, Mar:2, Apr:3, May:4, Jun:5, Jul:6, Aug:7, Sep:8, Oct:9, Nov:10, Dec:11 };
const match = dateStr.match(/([A-Za-z]+)\s+(\d+),\s+(\d+):(\d+)/);
if (match) {
const [_, mon, day, hr, min] = match;
return new Date(Date.UTC(2026, months[mon], parseInt(day), parseInt(hr), parseInt(min)));
}
return new Date(dateStr);
}
function getRelativeTime(date) {
if (!date) return "Recent";
const diff = Math.floor((new Date() - date) / 1000);
if (diff < 60) return `${diff}s`;
if (diff < 3600) return `${Math.floor(diff/60)}m`;
if (diff < 84400) return `${Math.floor(diff/3600)}h`;
return `${Math.floor(diff/86400)}d`;
}
function resolveName(data) { return typeof data === 'string' ? data : (data.name || "Unknown Device"); }
function getEntryMetadata(entry) {
const link = (entry.link || "").toLowerCase();
const reviewer = (entry.reviewer || "").toLowerCase().replace(/['\s]/g, "");
const item = resolveName(entry.item).toLowerCase();
// 1. DOMAIN RULES (Top Priority - Hard Overrides)
// Rule: dl.squig.link is always 711 IE
if (link.includes('dl.squig.link')) return "IEM (711)";
// Rule: Earphone Archive Specifics
if (link.includes('earphonesarchive.squig.link/headphones')) return "Over-Ear (5128)";
if (link.includes('earphonesarchive.squig.link')) return "IEM (5128)";
// Rule: listener.squig.link is always 711 OE
if (link.includes('listener.squig.link')) return "Over-Ear (711)";
// Rule: Hangout 711 IE path
if (link.includes('graph.hangout.audio/iem/711')) return "IEM (711)";
// 2. RIG DETECTION (General 5128)
let hostname = "";
try { hostname = new URL(link).hostname; } catch(e) { hostname = link; }
const is5128 = hostname.includes('hangout.audio') ||
link.includes('listener800.github.io/5128') ||
reviewer.includes("5128") || reviewer.includes("4620") ||
item.includes("5128") || item.includes("4620");
// 3. PATH & TYPE VALIDATION
const isIEMPath = link.includes('/iem/') || link.includes('/iems/');
const isHPPath = link.includes('/headphones/') || link.includes('/hp/') || item.includes('over-ear') || item.includes('headphone') || link.includes('type=headphone');
// 4. SPECIAL CATEGORIES
const isBuds = link.includes('/earbuds/') || link.includes('type=tws') || link.includes('/earbud/') || item.includes('earbud');
if (isBuds) return "TWS & Earbuds";
if (is5128) {
if (isHPPath && !isIEMPath) return "Over-Ear (5128)";
return "IEM (5128)";
}
// 5. 711 PINNAE/HP DETECTION
const pinnaeKeywords = ["kb5", "kb6", "k005", "k006", "kb006", "kb5000", "kb0065", "kb0066", "kb007"];
const hasPinnaeKeyword = pinnaeKeywords.some(key => item.includes(key) || reviewer.includes(key));
if (hasPinnaeKeyword || (isHPPath && !isIEMPath)) return "Over-Ear (711)";
return "IEM (711)";
}
async function fetchData() {
try {
const cacheBuster = new Date().getTime();
const [hReq, dReq] = await Promise.all([fetch(`history.json?v=${cacheBuster}`), fetch(`database.json?v=${cacheBuster}`)]);
const newHistory = await hReq.json();
const newDatabase = await dReq.json();
if (newHistory.length !== fullHistory.length || Object.keys(newDatabase).length !== Object.keys(databaseData).length) {
fullHistory = newHistory; databaseData = newDatabase;
fullHistory.sort((a,b) => (toLocalTime(b.date) - toLocalTime(a.date)));
updateDashboard();
if (currentTab === 'feed') applyFilters(); else renderStats();
}
} catch (e) { console.error("Sync Error", e); }
}
function updateDashboard() {
const now = new Date().getTime();
const last12h = fullHistory.filter(e => { const t = toLocalTime(e.date); return t && (now - t.getTime() < 12*60*60*1000); }).length;
document.getElementById('stat-total').innerText = last12h;
document.getElementById('stat-db-total').innerText = fullHistory.length.toLocaleString();
document.getElementById('stat-sources').innerText = Math.max(0, Object.keys(databaseData).length - 1);
}
function renderItems(data, containerId, append = false) {
const container = document.getElementById(containerId);
const html = data.map(entry => {
const date = toLocalTime(entry.date);
const isNew = date && (new Date() - date) < NEW_BADGE_MS;
const rigType = getEntryMetadata(entry);
const theme = THEME_COLORS[rigType] || THEME_COLORS["Misc/Unknown"];
return `
<div class="item-row py-6 flex justify-between items-center group px-2">
<div class="min-w-0 pr-4">
<div class="flex items-center gap-2.5 mb-1.5">
${isNew ? '<span class="bg-white text-black px-1.5 py-0.5 text-[9px] font-black uppercase rounded-sm">NEW</span>' : ''}
<span class="text-[11px] font-extrabold text-zinc-500 uppercase tracking-widest">${entry.reviewer}</span>
<span class="rig-tag ${theme.bg} ${theme.text}">${rigType}</span>
<span class="text-[11px] text-zinc-600 mono font-bold uppercase">${getRelativeTime(date)}</span>
</div>
<h2 class="text-lg lg:text-xl font-bold text-zinc-100 group-hover:text-white truncate tracking-tight transition-colors">${resolveName(entry.item)}</h2>
</div>
<a href="${entry.link}" target="_blank" class="shrink-0 p-3 border border-zinc-800 text-zinc-600 transition-all hover:bg-zinc-100 hover:text-black hover:border-white">
<svg class="w-4 h-4 lg:w-5 lg:h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path d="M14 5l7 7m0 0l-7 7m7-7H3" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
</a>
</div>`;
}).join('');
if (append) container.insertAdjacentHTML('beforeend', html);
else container.innerHTML = html || `<div class="py-20 text-center mono text-zinc-700">No matching results</div>`;
}
function applyFilters() {
const searchVal = document.getElementById('search').value.toLowerCase();
let countAll = 0, count711 = 0, count5128 = 0;
let tcountAll = 0, tcountIEM = 0, tcountOE = 0;
const filtered = fullHistory.filter(entry => {
const matchesSearch = resolveName(entry.item).toLowerCase().includes(searchVal) || entry.reviewer.toLowerCase().includes(searchVal);
if (!matchesSearch) return false;
const metadata = getEntryMetadata(entry);
countAll++;
if (metadata.includes('711')) count711++;
if (metadata.includes('5128')) count5128++;
tcountAll++;
if (metadata.includes('IEM') || metadata.includes('TWS')) tcountIEM++;
if (metadata.includes('Over-Ear')) tcountOE++;
const matchesRig = currentRigFilter === 'ALL' || metadata.includes(currentRigFilter);
let matchesType = true;
if (currentTypeFilter === 'IEM') matchesType = metadata.includes('IEM') || metadata.includes('TWS');
if (currentTypeFilter === 'Over-Ear') matchesType = metadata.includes('Over-Ear');
return matchesRig && matchesType;
});
document.getElementById('count-ALL').innerText = countAll;
document.getElementById('count-711').innerText = count711;
document.getElementById('count-5128').innerText = count5128;
document.getElementById('tcount-ALL').innerText = tcountAll;
document.getElementById('tcount-IEM').innerText = tcountIEM;
document.getElementById('tcount-OE').innerText = tcountOE;
currentIndex = 0; currentFilteredSet = filtered; loadMore(false);
}
function loadMore(append = true) {
const nextBatch = currentFilteredSet.slice(currentIndex, currentIndex + PAGE_SIZE);
renderItems(nextBatch, 'feed', append);
currentIndex += PAGE_SIZE;
document.getElementById('load-all-btn').classList.toggle('hidden', currentIndex >= currentFilteredSet.length || currentTab === 'stats');
}
function renderStats() {
const statsContainer = document.getElementById('stats');
const categories = ["IEM (5128)", "Over-Ear (5128)", "IEM (711)", "Over-Ear (711)", "Misc/Unknown", "TWS & Earbuds"];
const counts = {}; const lists = {}; categories.forEach(c => { counts[c] = 0; lists[c] = []; });
const contributors = {};
fullHistory.forEach(entry => {
const cat = getEntryMetadata(entry);
if (counts[cat] !== undefined) { counts[cat]++; lists[cat].push(entry); }
if (cat.includes("5128")) {
let rawRev = entry.reviewer || "Unknown";
let cleanName = rawRev.replace(/5128/gi, '').replace(/\d+$/, '').trim();
const rev = cleanName.charAt(0).toUpperCase() + cleanName.slice(1).toLowerCase();
contributors[rev] = (contributors[rev] || 0) + 1;
}
});
const sortedContributors = Object.entries(contributors).sort((a,b) => b[1] - a[1]);
const totalDB = fullHistory.length || 1;
const renderCategoryCard = (title, key) => {
const limit = statsPagination[key] || 15;
const items = lists[key].slice(0, limit);
const theme = THEME_COLORS[key] || THEME_COLORS["Misc/Unknown"];
return `
<div class="stat-card p-4 bg-[#111] border border-zinc-800 rounded">
<span class="text-[11px] uppercase mono font-black mb-3 block ${theme.text}">${title}</span>
<div class="flex justify-between text-[9px] mono text-zinc-500 mb-1"><span>Database Share</span><span>${counts[key]}</span></div>
<div class="chart-bar-container"><div class="chart-bar-fill ${theme.bg}" style="width:${(counts[key]/totalDB)*100}%"></div></div>
<ul class="recent-list-mini mt-4">
${items.map(i => `<li><a href="${i.link}" target="_blank" class="block truncate text-zinc-400 hover:text-white">${resolveName(i.item)} <span class="opacity-30 text-[8px] ml-1">${i.reviewer}</span></a></li>`).join('')}
</ul>
${lists[key].length > limit ? `<div class="text-[9px] font-bold text-center mt-3 pt-3 border-t border-zinc-900 cursor-pointer text-zinc-500 hover:text-white" onclick="expandCategory('${key}')">VIEW MORE</div>` : ''}
</div>`;
};
statsContainer.innerHTML = `
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
${renderCategoryCard("5128 IEMs", "IEM (5128)")} ${renderCategoryCard("5128 Over-Ears", "Over-Ear (5128)")}
${renderCategoryCard("711 IEMs", "IEM (711)")} ${renderCategoryCard("711 Over-Ears", "Over-Ear (711)")}
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div class="stat-card p-4 bg-[#111] border border-zinc-800 rounded md:col-span-1">
<span class="text-[11px] uppercase mono font-black text-emerald-500 mb-4 block">5128 Contributors</span>
<table class="w-full text-[11px] mono text-zinc-500">
${sortedContributors.slice(0, 8).map(([name, count]) => `<tr class="border-b border-zinc-900"><td class="py-1.5">${name}</td><td class="text-right text-white font-bold">${count}</td></tr>`).join('')}
</table>
</div>
${renderCategoryCard("TWS & Earbuds", "TWS & Earbuds")} ${renderCategoryCard("Misc / Targets", "Misc/Unknown")}
</div>`;
}
function expandCategory(key) { statsPagination[key] += 15; renderStats(); }
function setRigFilter(rig) {
currentRigFilter = rig;
document.querySelectorAll('#rig-filters .filter-btn').forEach(btn => btn.classList.toggle('active', btn.id === `filter-${rig}`));
applyFilters();
}
function setTypeFilter(type) {
currentTypeFilter = type;
const idMap = { 'ALL': 'type-ALL', 'IEM': 'type-IEM', 'Over-Ear': 'type-OE' };
document.querySelectorAll('#type-filters .filter-btn').forEach(btn => btn.classList.toggle('active', btn.id === idMap[type]));
applyFilters();
}
function switchTab(tab) {
currentTab = tab;
document.getElementById('feed').classList.toggle('hidden', tab !== 'feed');
document.getElementById('stats').classList.toggle('hidden', tab !== 'stats');
document.getElementById('rig-filters-container').classList.toggle('hidden', tab === 'stats');
document.getElementById('tab-feed').classList.toggle('active', tab === 'feed');
document.getElementById('tab-stats').classList.toggle('active', tab === 'stats');
if (tab === 'stats') renderStats(); else applyFilters();
}
document.getElementById('search').addEventListener('input', () => { clearTimeout(searchTimeout); searchTimeout = setTimeout(applyFilters, 300); });
document.getElementById('load-all-btn').addEventListener('click', () => loadMore(true));
fetchData();
setInterval(fetchData, 5 * 60 * 1000);
</script>
</body>
</html>