diff --git a/.backups/ghosttrack.css.bak b/.backups/ghosttrack.css.bak new file mode 100644 index 0000000..b810a20 --- /dev/null +++ b/.backups/ghosttrack.css.bak @@ -0,0 +1,157 @@ +/* Tema Premium GhostTrack-v2 */ + +body { + margin: 0; + font-family: system-ui, sans-serif; + background: #050711; + color: #e5f7ff; +} + +header { + padding: 16px; + text-align: center; + border-bottom: 1px solid #1b2235; + background: radial-gradient(circle at top, #1b2a4a, #050711); +} + +h1 { + margin: 0; + font-size: 22px; +} + +h2 { + margin: 0; + font-size: 14px; + opacity: 0.8; +} + +#tabs { + display: flex; + flex-wrap: wrap; + border-bottom: 1px solid #1b2235; + background: #070a16; +} + +.tab { + flex: 1 1 50%; + padding: 10px; + text-align: center; + cursor: pointer; + font-size: 13px; + border-right: 1px solid #1b2235; + border-bottom: 1px solid #1b2235; +} + +.tab.active { + background: #11182b; + color: #7fffd4; + font-weight: 600; +} + +.panel { + padding: 14px; +} + +.grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); + gap: 10px; +} + +.card { + background: #0b1020; + border: 1px solid #1b2235; + border-radius: 8px; + padding: 10px; + font-size: 12px; +} + +.badge { + display: inline-block; + padding: 2px 6px; + border-radius: 4px; + font-size: 10px; + margin: 2px 2px 0 0; + border: 1px solid #2f3c5f; +} + +.badge-ok { border-color: #00c853; color: #00c853; } +.badge-warn { border-color: #ffb300; color: #ffb300; } +.badge-off { border-color: #546e7a; color: #546e7a; } + +input, button { + background: #050814; + border: 1px solid #1b2235; + color: #e5f7ff; + padding: 6px; + border-radius: 4px; +} + +button { + cursor: pointer; + background: #11182b; +} + +button:hover { + background: #1a2540; +} + +/* Menu Button and Panel */ +.menu-btn { + position: absolute; + top: 12px; + right: 12px; + background: linear-gradient(180deg,#11182b,#0b1220); + border: 1px solid #1b2235; + color: #e5f7ff; + padding: 8px 10px; + border-radius: 6px; + font-size: 16px; + z-index: 1200; +} + +.menu-btn:active { transform: translateY(1px); } + +#menuPanel .card { margin-bottom: 10px; } +#menuPanel .muted { color: #9fb0c8; font-size: 12px; margin-top: 6px; } +.video-wrap { background:#000; border-radius:6px; overflow:hidden; } + +/* Menu Button and Panel */ +.menu-btn { + position: absolute; + top: 12px; + right: 12px; + background: linear-gradient(180deg,#11182b,#0b1220); + border: 1px solid #1b2235; + color: #e5f7ff; + padding: 8px 10px; + border-radius: 6px; + font-size: 16px; + z-index: 1200; +} + +.menu-btn:active { transform: translateY(1px); } + +#menuPanel .card { margin-bottom: 10px; } +#menuPanel .muted { color: #9fb0c8; font-size: 12px; margin-top: 6px; } +.video-wrap { background:#000; border-radius:6px; overflow:hidden; } + +/* Menu Button and Panel */ +.menu-btn { + position: absolute; + top: 12px; + right: 12px; + background: linear-gradient(180deg,#11182b,#0b1220); + border: 1px solid #1b2235; + color: #e5f7ff; + padding: 8px 10px; + border-radius: 6px; + font-size: 16px; + z-index: 1200; +} + +.menu-btn:active { transform: translateY(1px); } + +#menuPanel .card { margin-bottom: 10px; } +#menuPanel .muted { color: #9fb0c8; font-size: 12px; margin-top: 6px; } +.video-wrap { background:#000; border-radius:6px; overflow:hidden; } diff --git a/.backups/ghosttrack.js.bak b/.backups/ghosttrack.js.bak new file mode 100644 index 0000000..43aa240 --- /dev/null +++ b/.backups/ghosttrack.js.bak @@ -0,0 +1,299 @@ +// docs/assets/js/ghosttrack.js + +// ========================= +// 1) TAB ENGINE +// ========================= +(function () { + const tabs = document.querySelectorAll('.tab'); + const panels = document.querySelectorAll('.panel'); + + function activateTab(targetId) { + tabs.forEach(t => t.classList.remove('active')); + panels.forEach(p => p.style.display = 'none'); + const tab = document.querySelector(`.tab[data-target="${targetId}"]`); + const panel = document.getElementById(targetId); + if (tab) tab.classList.add('active'); + if (panel) panel.style.display = 'block'; + } + + tabs.forEach(tab => { + tab.addEventListener('click', () => { + const target = tab.dataset.target; + activateTab(target); + if (target === 'env') GhostTrackEnv.requestUpdate(); + }); + }); + + // pannello di default + activateTab('mission'); +})(); + +// ========================= +// 2) CHAT LOCALE +// ========================= +const GhostTrackChat = (function () { + const chatLog = document.getElementById('chatlog'); + const chatInput = document.getElementById('chatinput'); + + function append(role, text) { + if (!chatLog) return; + chatLog.innerHTML += `
${role}: ${text}
`; + chatLog.scrollTop = chatLog.scrollHeight; + } + + function init() { + if (!chatInput) return; + chatInput.addEventListener('keydown', e => { + if (e.key !== 'Enter') return; + const msg = chatInput.value.trim(); + if (!msg) return; + append('Tu', msg); + chatInput.value = ''; + setTimeout(() => { + append('Nodo', 'Ricevuto. Modalità offline demo.'); + }, 300); + }); + } + + init(); + return { append }; +})(); + +// ========================= +// 3) CREDITO ENERGETICO +// ========================= +const GhostTrackEnergy = (function () { + let state = { + value: 0, + level: 'Seed', + log: [] + }; + + function updateLevel() { + const v = state.value; + if (v < 50) state.level = 'Seed'; + else if (v < 150) state.level = 'Node'; + else if (v < 300) state.level = 'Constellation'; + else state.level = 'Mythic'; + } + + function render() { + updateLevel(); + const box = document.getElementById('energy-current'); + const logBox = document.getElementById('energy-log'); + if (!box || !logBox) return; + box.innerHTML = ` + Energia: ${state.value} CE
+ Livello: ${state.level}
+ `; + logBox.textContent = state.log.join('\n') || '[log] Nessun evento ancora.'; + } + + function log(msg) { + const ts = new Date().toISOString().slice(0, 19).replace('T', ' '); + state.log.unshift(`[${ts}] ${msg}`); + if (state.log.length > 8) state.log.pop(); + render(); + } + + function event(type) { + switch (type) { + case 'uptime-tick': + state.value += 1; + log('+1 CE — uptime nodo'); + break; + case 'obs-session': + state.value += 5; + log('+5 CE — sessione osservazione'); + break; + case 'mesh-sync': + state.value += 3; + log('+3 CE — sync mesh'); + break; + case 'heavy-ritual': + state.value -= 2; + log('-2 CE — rituale pesante'); + break; + } + if (state.value < 0) state.value = 0; + render(); + } + + // tick simbolico ogni minuto + setInterval(() => event('uptime-tick'), 60000); + render(); + + return { event, render }; +})(); + +// ========================= +// 4) ENVIRONMENT (Open-Meteo) +// ========================= +const GhostTrackEnv = (function () { + const api = { + weather: 'https://api.open-meteo.com/v1/forecast', + air: 'https://air-quality-api.open-meteo.com/v1/air-quality' + }; + const microclimaBox = document.getElementById('microclima'); + const agroBox = document.getElementById('agro'); + + async function update(lat, lon) { + try { + const weatherUrl = + `${api.weather}?latitude=${lat}&longitude=${lon}` + + `¤t=temperature_2m,relative_humidity_2m,pressure_msl,wind_speed_10m`; + const airUrl = + `${api.air}?latitude=${lat}&longitude=${lon}` + + `&hourly=pm10,pm2_5,carbon_monoxide,ozone`; + + const [wRes, aRes] = await Promise.all([fetch(weatherUrl), fetch(airUrl)]); + const wData = await wRes.json(); + const aData = await aRes.json(); + const c = wData.current || {}; + const h = aData.hourly || {}; + if (microclimaBox) { + microclimaBox.innerHTML = ` + Lat: ${lat.toFixed(4)}
+ Lon: ${lon.toFixed(4)}
+ Temperatura: ${c.temperature_2m ?? 'n/d'} °C
+ Umidità: ${c.relative_humidity_2m ?? 'n/d'} %
+ Pressione: ${c.pressure_msl ?? 'n/d'} hPa
+ Vento: ${c.wind_speed_10m ?? 'n/d'} km/h + `; + } + if (agroBox) { + const idx = 0; + agroBox.innerHTML = ` + SoilSense + RainPulse + WindWatch
+ ForestGuard + GeoSentinel +

+ PM10: ${h.pm10 ? h.pm10[idx] : 'n/d'} µg/m³
+ PM2.5: ${h.pm2_5 ? h.pm2_5[idx] : 'n/d'} µg/m³
+ CO: ${h.carbon_monoxide ? h.carbon_monoxide[idx] : 'n/d'} µg/m³
+ Ozono: ${h.ozone ? h.ozone[idx] : 'n/d'} µg/m³ +

+ `; + } + } catch (e) { + if (microclimaBox) { + microclimaBox.innerHTML = 'Errore: impossibile contattare le API.'; + } + } + } + + function requestUpdate() { + if (!navigator.geolocation) { + if (microclimaBox) { + microclimaBox.innerHTML = 'Errore: Geolocalizzazione non supportata.'; + } + return; + } + navigator.geolocation.getCurrentPosition( + pos => update(pos.coords.latitude, pos.coords.longitude), + () => { + if (microclimaBox) { + microclimaBox.innerHTML = 'Errore: Geolocalizzazione negata o fallita.'; + } + } + ); + } + + return { requestUpdate }; +})(); + +// ========================= +// 5) ISS + MOON +// ========================= +const GhostTrackSpace = (function () { + const issBox = document.getElementById('isspos'); + const moonBox = document.getElementById('moonphase'); + + function loadISS() { + if (!issBox) return; + fetch('http://api.open-notify.org/iss-now.json') + .then(r => r.json()) + .then(d => { + const lat = d.iss_position.latitude; + const lon = d.iss_position.longitude; + issBox.innerHTML = `Lat: ${lat}
Lon: ${lon}`; + }) + .catch(() => { + issBox.innerHTML = 'Impossibile ottenere dati ISS.'; + }); + } + + function loadMoon() { + if (!moonBox) return; + fetch('https://api.open-meteo.com/v1/forecast?latitude=45&longitude=9&daily=moon_phase&timezone=auto') + .then(r => r.json()) + .then(d => { + const phase = d.daily && d.daily.moon_phase ? d.daily.moon_phase[0] : 'n/d'; + moonBox.innerHTML = 'Fase lunare: ' + phase; + }) + .catch(() => { + moonBox.innerHTML = 'Impossibile ottenere dati lunari.'; + }); + } + + loadISS(); + loadMoon(); + return { loadISS, loadMoon }; +})(); + +// ========================= +// 6) TELEMETRIA (STUB) +// ========================= +const GhostTrackTelemetry = (function () { + const box = document.getElementById('node-telemetry'); + + async function load() { + // in futuro: leggere docs/telemetry.json + if (!box) return; + box.innerHTML = ` + Uptime: demo
+ Load Avg: demo
+ Disco: demo
+ IP: demo
+ Status: OK + `; + } + + load(); + return { load }; +})(); + +// ========================= +// 7) AUTH (STUB CONCETTUALE) +// ========================= +// Qui potresti in futuro agganciare un provider esterno. +// Con sola pagina statica non fai OAuth completo in sicurezza. +// Manteniamo solo un hook simbolico. + +const GhostTrackAuth = (function () { + let operatorMode = false; + + function enableOperatorMode(code) { + if (code === 'GHOST-PRAGONE') { + operatorMode = true; + alert('Operator mode attivata (locale, simbolica).'); + GhostTrackEnergy.event('obs-session'); + } else { + alert('Codice non valido.'); + } + } + + return { enableOperatorMode }; +})(); + +/* GhostTrack Menu Module */ +const GhostTrackMenu = { + toggle() { + const panel = document.getElementById("menuPanel"); + if (!panel) return console.warn("menuPanel non trovato"); + panel.style.display = panel.style.display === "none" ? "block" : "none"; + if (panel.style.display === "block") panel.scrollIntoView({behavior: "smooth"}); + } +}; diff --git a/.backups/index.html.bak b/.backups/index.html.bak new file mode 100644 index 0000000..af920f3 --- /dev/null +++ b/.backups/index.html.bak @@ -0,0 +1,298 @@ + + + + +GhostTrack‑v2 — Premium Cosmic Node + + + + +
+ +

🌌 GhostTrack‑v2

+

Premium Cosmic Node — Pragone Constellation

+
Osservazione etica · Territorio · Orbita · Sport · Reti · Astro · Chat locale
+
+
+
🛰 Mission
+
🌍 Environment
+
🛡 Security
+
📡 Orbital
+
🗺 Maps
+
🔥 Sport
+
💬 Chat
+
🌌 Astro
+
🎓 Docs
+
✨ Citizen
+
+ +
+

🛰 Mission Control — System & Telemetry

+
+
+

📡 Telemetria Nodo

+

+ Uptime: demo
+ Load Avg: demo
+ Disco: demo
+ IP: demo
+ Status: OK +

+

In futuro può leggere da docs/telemetry.json.

+
+

🧱 Sistema Core

+

+ NodeCore + RitualEngine + TelemetryCore
+ LogEngine + ConfigSystem
+ RepairEngine + SyncEngine +

🔧 Rituali

+
+MasterRitual   ✔ ultima esecuzione: demo
+FullRitual     ✔ ultima esecuzione: demo
+OmegaRitual    ⏳ in attesa
+AutoSync       ✔ attivo
+SuperCommit    ✔ attivo
+      
+
+
+ +