From fbc6dbf5c4e54b9b2c41e6ec15bc1ccf1d55f1b8 Mon Sep 17 00:00:00 2001 From: Lopinosaurus Date: Thu, 12 Mar 2026 13:41:55 +0100 Subject: [PATCH] all: increase font, larger RSS --- public/app.js | 13 +++++++------ public/style.css | 12 ++++++------ server.js | 10 +++++++--- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/public/app.js b/public/app.js index 35f0b27..0679c86 100644 --- a/public/app.js +++ b/public/app.js @@ -27,7 +27,7 @@ function connectWS() { renderRootme(msg.ranking); } else if (msg.type === 'rootme_flag') { renderRootme(rootmeCache); - showNotif(`FLAG ! ${msg.login} +${msg.gained} PTS — TOTAL : ${msg.newScore} PTS`, true); + showNotif(`FLAG ! ${msg.login} +${msg.gained} PTS — TOTAL : ${msg.newScore} PTS`); } }); @@ -67,9 +67,10 @@ const notifOverlay = document.getElementById('notif-overlay'); const notifMessage = document.getElementById('notif-message'); const notifBarInner = document.getElementById('notif-bar-inner'); const softAlarmAudio = new Audio('/soft_alarm.mp3'); +const newsAudio = new Audio('/news.mp3'); let notifTimer = null; -function showNotif(message, sound = true) { +function showNotif(message, audio = softAlarmAudio) { notifMessage.textContent = message; // Re-déclencher l'animation de la barre @@ -83,9 +84,9 @@ function showNotif(message, sound = true) { notifOverlay.classList.remove('hidden'); - if (sound) { - softAlarmAudio.currentTime = 0; - softAlarmAudio.play().catch(err => console.error('soft_alarm:', err)); + if (audio) { + audio.currentTime = 0; + audio.play().catch(err => console.error('notif audio:', err)); } if (notifTimer) clearTimeout(notifTimer); @@ -259,7 +260,7 @@ async function loadGeo() { } else { const newGeoItems = items.filter(i => !seenGeoLinks.has(i.link)); if (newGeoItems.length) { - showNotif(`Nouvelle actualité géopolitique : ${newGeoItems[0].title}`, false); + showNotif(`Nouvelle actualité géopolitique : ${newGeoItems[0].title}`, newsAudio); seenGeoLinks = currentLinks; } } diff --git a/public/style.css b/public/style.css index 60b635a..b6f227b 100644 --- a/public/style.css +++ b/public/style.css @@ -92,7 +92,7 @@ main.grid { .rootme-rank { color: var(--text-dim); - font-size: 11px; + font-size: 13px; letter-spacing: 1px; text-align: right; } @@ -103,7 +103,7 @@ main.grid { .rootme-login { color: var(--green); - font-size: 13px; + font-size: 15px; font-weight: bold; letter-spacing: 1px; overflow: hidden; @@ -113,7 +113,7 @@ main.grid { .rootme-score { color: var(--green-dim); - font-size: 11px; + font-size: 13px; letter-spacing: 1px; white-space: nowrap; } @@ -191,9 +191,9 @@ main.grid { .anssi-item a { color: var(--green); text-decoration: none; - font-size: 12px; + font-size: 14px; display: block; - margin-bottom: 2px; + margin-bottom: 3px; line-height: 1.4; } @@ -201,7 +201,7 @@ main.grid { .anssi-date { color: var(--text-dim); - font-size: 10px; + font-size: 11px; } /* CVE items */ diff --git a/server.js b/server.js index 801ec5c..0436cfb 100644 --- a/server.js +++ b/server.js @@ -106,7 +106,8 @@ app.get('/api/feeds/anssi', async (req, res) => { pubDate: item.pubDate || '', description: item.description || '' })) - .sort((a, b) => new Date(b.pubDate) - new Date(a.pubDate)); + .sort((a, b) => new Date(b.pubDate) - new Date(a.pubDate)) + .slice(0, 7); res.json(entries); } catch (err) { res.status(502).json({ error: 'Feed fetch failed', detail: err.message }); @@ -115,7 +116,10 @@ app.get('/api/feeds/anssi', async (req, res) => { // Géopolitique — Google News RSS (conflits, cyberattaques, Ukraine, Iran…) app.get('/api/feeds/geo', async (req, res) => { - const query = encodeURIComponent('Ukraine OR Iran OR "Moyen-Orient" OR cyberattaque OR guerre'); + const query = encodeURIComponent( + 'Ukraine OR Russie OR Iran OR "Moyen-Orient" OR OTAN OR guerre OR conflit' + + ' OR cyberattaque OR ransomware OR APT OR "zero-day" OR vulnérabilité OR hack OR malware OR breach' + ); const url = `https://news.google.com/rss/search?q=${query}&hl=fr&gl=FR&ceid=FR:fr`; try { const response = await fetch(url, { @@ -134,7 +138,7 @@ app.get('/api/feeds/geo', async (req, res) => { source: item.source?.['#text'] || item.source || '' })) .sort((a, b) => new Date(b.pubDate) - new Date(a.pubDate)) - .slice(0, 15); + .slice(0, 7); res.json(entries); } catch (err) { res.status(502).json({ error: 'Geo feed fetch failed', detail: err.message });