diff --git a/index.html b/index.html index 0bec5cf..09a4bce 100644 --- a/index.html +++ b/index.html @@ -51,6 +51,7 @@

Ravenna:

+ Aggiunti servizi Start.
Aggiunte altre foto di BredaMenarinibus M231CU CNG (+ interni) e Karsan e-ATAK.
Aggiunti Iveco Urbanway 12 Mild Hybrid CNG.
Aggiornata la lista mezzi. diff --git a/start_menu/servizi/start-corsesopp/css/style.css b/start_menu/servizi/start-corsesopp/css/style.css new file mode 100644 index 0000000..92a408e --- /dev/null +++ b/start_menu/servizi/start-corsesopp/css/style.css @@ -0,0 +1,106 @@ +:root { + --primary-color: #afafaf; + --accent-color: #0074d9; + --bg-color: #2e2d2d; + --white: #ffffff; + --light-gray: #848991; + --border-color: #727070; + --text-color: #ffffff; + --black: #000000; +} + +* { + box-sizing: border-box; +} + +body { + margin: 0; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + background-color: var(--bg-color); + color: var(--text-color); +} + +header { + background-color: var(--bg-color); + color: var(--text-color); + text-align: center; + padding: 20px; + /*box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);*/ +} + +main { + max-width: 900px; + margin: 40px auto; + padding: 30px; + background-color: var(--bg-color); + /*border-radius: 10px;*/ + /*box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);*/ + text-align: center; +} + +form { + display: flex; + flex-wrap: wrap; + justify-content: center; + align-items: center; + gap: 15px; + margin-bottom: 30px; +} + +form label { + font-weight: 600; +} + +form select, +form button { + padding: 10px; + font-size: 16px; + border-radius: 6px; + border: 1px solid var(--border-color); +} + +form button { + background-color: var(--accent-color); + color: white; + border: none; + cursor: pointer; + transition: background-color 0.3s ease; +} + +form button:hover { + background-color: #005fa3; +} + +table { + width: 100%; + border-collapse: collapse; + display: none; +} + +th, td { + padding: 12px; + border: 1px solid var(--border-color); + text-align: left; +} + +th { + background-color: var(--light-gray); +} + +tr:nth-child(even) { + background-color: #505050; +} + +.loading-message { + text-align: center; + color: #777; + font-style: italic; + padding: 20px 0; +} + +footer { + text-align: center; +} +a { + color: var(--text-color); +} \ No newline at end of file diff --git a/start_menu/servizi/start-corsesopp/img/favicon.ico b/start_menu/servizi/start-corsesopp/img/favicon.ico new file mode 100644 index 0000000..95b83b1 Binary files /dev/null and b/start_menu/servizi/start-corsesopp/img/favicon.ico differ diff --git a/start_menu/servizi/start-corsesopp/img/start.png b/start_menu/servizi/start-corsesopp/img/start.png new file mode 100644 index 0000000..b9c43cf Binary files /dev/null and b/start_menu/servizi/start-corsesopp/img/start.png differ diff --git a/start_menu/servizi/start-corsesopp/index.html b/start_menu/servizi/start-corsesopp/index.html new file mode 100644 index 0000000..bfbe505 --- /dev/null +++ b/start_menu/servizi/start-corsesopp/index.html @@ -0,0 +1,44 @@ + + + + + START Romagna - Monitor corse non garantite + + + + +

+
Start Romagna
+

Monitor corse non garantite

+
+
+
+ + + +
+ + + + + + + + + + + + +
LineaInizioOra di InizioFineOra di FineData
+
+ + + + diff --git a/start_menu/servizi/start-corsesopp/js/script.js b/start_menu/servizi/start-corsesopp/js/script.js new file mode 100644 index 0000000..915bb7a --- /dev/null +++ b/start_menu/servizi/start-corsesopp/js/script.js @@ -0,0 +1,58 @@ +// VARIABILI DA MODIFICARE - VARIABLES TO MODIFY // +const ApiUri = 'https://api.vichingo455.freeddns.org/start-corsesopp.json'; //JSON Dinamico - Dynamic JSON + +// IMPORTANTE!! NON MODIFICARE SOTTO!! - IMPORTANT!! DO NOT MODIFY THE CODE BELOW!! // +let ultimaRichiesta = null; +let intervalloAggiornamento = null; +const delay = ms => new Promise(res => setTimeout(res, ms)); +async function caricaDati(event = null, richiestaManuale = false) { + if (event) event.preventDefault(); + const Bacino = document.getElementById("stazione").value; + const corpo = document.getElementById("corpoTabella"); + const tabella = document.getElementById("tabellaDati"); + // Salva la richiesta corrente per i refresh automatici + ultimaRichiesta = { Bacino }; + // Ottieni la data e l'ora di oggi + const oggi = new Date(); + const anno = oggi.getFullYear(); + const mese = String(oggi.getMonth() + 1).padStart(2, '0'); // i mesi partono da 0 + const giorno = String(oggi.getDate()).padStart(2, '0'); + const Data = `${anno}-${mese}-${giorno}`; + // Scrivi l'URL + const url = `${ApiUri}/?Bacino=${Bacino}&Data=${Data}`; + try { + if (richiestaManuale) { + tabella.style.display = "table"; + corpo.innerHTML = `Caricamento in corso...`; + } + const response = await fetch(url); + const data = await response.json(); + if (data.length === 0) { + corpo.innerHTML = `Nessun dato disponibile.`; + return; + } + corpo.innerHTML = data.map(row => + `${row.map(col => `${col}`).join('')}` + ).join(''); + } catch (error) { + console.error("Errore durante la richiesta:", error); + if (richiestaManuale) { + corpo.innerHTML = `Errore durante il caricamento dei dati. Per favore riprova.
PER GLI SVILUPPATORI: Controllare nella console del browser per i dettagli dell'errore.`; + await delay(7000); + tabella.style.display = "none"; + } + } +} +function avviaAggiornamentoAutomatico() { + if (intervalloAggiornamento) clearInterval(intervalloAggiornamento); + intervalloAggiornamento = setInterval(() => { + if (ultimaRichiesta) { + caricaDati(null, false); + } + }, 30000); // ogni 30 secondi +} +document.getElementById("formStazione").addEventListener("submit", (e) => { + caricaDati(e, true); + avviaAggiornamentoAutomatico(); +}); +caricaStazioni(); \ No newline at end of file diff --git a/start_menu/servizi/start-livebus/css/style.css b/start_menu/servizi/start-livebus/css/style.css new file mode 100644 index 0000000..c015d2e --- /dev/null +++ b/start_menu/servizi/start-livebus/css/style.css @@ -0,0 +1,126 @@ +body { + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + padding: 20px; + background-color: #282828; + margin: 0; + } + + h1 { + text-align: center; + color: white; + font-size: 2em; + margin-bottom: 30px; + } + h3 { + text-align: center; + color: white; + margin-bottom: 30px; + } + p { + text-align: center; + } + + #data-container { + margin-top: 20px; + max-width: 1000px; + margin-left: auto; + margin-right: auto; + background-color: #333; + padding: 20px; + border-radius: 12px; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); + } + + .filter-container { + margin-top: 20px; + max-width: 1000px; + margin-left: auto; + margin-right: auto; + background-color: #333; + padding: 20px; + border-radius: 12px; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); + align-items: center; + } + + .filter-container input { + flex: 1 1 200px; + padding: 10px 15px; + font-size: 16px; + border: 1px solid #ccc; + border-radius: 8px; + transition: border-color 0.3s ease; + background-color: gray; + color: white; + } + + .filter-container input:focus { + outline: none; + border-color: #3498db; + box-shadow: 0 0 5px rgba(52, 152, 219, 0.3); + } + + table { + width: 100%; + border-collapse: collapse; + margin-top: 20px; + font-size: 15px; + border-radius: 8px; + overflow: hidden; + } + + table, th, td { + border: 1px solid #e0e0e0; + } + + th { + background-color: slategray; + color: white; + padding: 12px; + text-align: left; + } + + td { + padding: 10px; + background-color: dimgray; + color: white; + } + + tr:nth-child(even) td { + background-color: gray; + } + + tr:hover td { + background-color: darkgray; + } + + @media (max-width: 768px) { + .filter-container { + flex-direction: column; + } + + .filter-container input button { + width: 100%; + } + } + + button { + background-color: gray; + color: white; + border: none; + padding: 10px 20px; + font-size: 16px; + font-family: inherit; + border: 1px solid #ccc; + border-radius: 8px; + cursor: pointer; + transition: background-color 0.3s ease, box-shadow 0.3s ease; + } + + button:disabled { + cursor: not-allowed; + } + + a { + color: orange; + } \ No newline at end of file diff --git a/start_menu/servizi/start-livebus/img/favicon.ico b/start_menu/servizi/start-livebus/img/favicon.ico new file mode 100644 index 0000000..95b83b1 Binary files /dev/null and b/start_menu/servizi/start-livebus/img/favicon.ico differ diff --git a/start_menu/servizi/start-livebus/img/start.png b/start_menu/servizi/start-livebus/img/start.png new file mode 100644 index 0000000..b9c43cf Binary files /dev/null and b/start_menu/servizi/start-livebus/img/start.png differ diff --git a/start_menu/servizi/start-livebus/index.html b/start_menu/servizi/start-livebus/index.html new file mode 100644 index 0000000..8b23e70 --- /dev/null +++ b/start_menu/servizi/start-livebus/index.html @@ -0,0 +1,29 @@ + + + + + + Start Romagna - Autobus in tempo reale + + + + +
Start Romagna
+

Autobus in tempo reale

+

00:00:00

+ +
+ + + + + +
+ +

Caricamento in corso, attendere prego...

+ +

Copyright (C) 2025 ER-TPL Team - ertpl.pages.dev - code by EmmeV (Vichingo455) Codice Sorgente

+

Start Romagna, Start e il logo Start Romagna sono marchi registrati e protetti da copyright da Start Romagna SpA. Vengono usati in questa pagina solo per riferimento.

+ + + diff --git a/start_menu/servizi/start-livebus/js/script.js b/start_menu/servizi/start-livebus/js/script.js new file mode 100644 index 0000000..c81eeb0 --- /dev/null +++ b/start_menu/servizi/start-livebus/js/script.js @@ -0,0 +1,98 @@ +// Funzione per applicare il filtro su ogni colonna +function applyFilter() { + const filterZona = document.getElementById('filterZona').value.toLowerCase(); + const filterLinea = document.getElementById('filterLinea').value.toLowerCase(); + const filterVeicolo = document.getElementById('filterVeicolo').value.toLowerCase(); + const filterCodiceFermata = document.getElementById('filterCodiceFermata').value.toLowerCase(); + + const table = document.querySelector('table'); + const rows = table.querySelectorAll('tr'); + + rows.forEach((row, index) => { + // Non applicare il filtro sulla prima riga (intestazione) + if (index === 0) return; + + const cells = row.getElementsByTagName('td'); + let match = true; + + // Verifica ogni cella rispetto al filtro per la colonna + if (cells[0] && !cells[0].textContent.toLowerCase().includes(filterZona)) match = false; + if (cells[1] && !cells[1].textContent.toLowerCase().includes(filterLinea)) match = false; + if (cells[4] && !cells[4].textContent.toLowerCase().includes(filterVeicolo)) match = false; + if (cells[3] && !cells[3].textContent.toLowerCase().includes(filterCodiceFermata)) match = false; + + // Mostra o nascondi la riga in base al filtro + row.style.display = match ? '' : 'none'; + }); + } + fetchData(); // Primo fetch + // Fetch dei dati ogni 30 secondi (30 000 millisecondi) + timer = setInterval(() => { + fetchData(); + }, 30000); + // Fetch dei dati e creazione della tabella + function fetchData() { + fetch('https://api.vichingo455.freeddns.org/infobus/') + .then(response => response.json()) + .then(data => { + const container = document.getElementById('data-container'); + container.innerHTML = ''; // Svuota il div prima di aggiungere la tabella + + // Crea la tabella + const table = document.createElement('table'); + + // Aggiungi l'intestazione della tabella + const header = table.createTHead(); + const headerRow = header.insertRow(); + headerRow.insertCell().textContent = 'Zona'; + headerRow.insertCell().textContent = 'Linea'; + headerRow.insertCell().textContent = 'Fermata'; + headerRow.insertCell().textContent = 'Codice Fermata'; + headerRow.insertCell().textContent = 'Veicolo'; + headerRow.insertCell().textContent = ' '; + headerRow.insertCell().textContent = 'Ultimo Aggiornamento'; + + // Aggiungi i dati alla tabella + const tbody = table.createTBody(); + data.forEach(row => { + const rowElement = tbody.insertRow(); + row.forEach(cellData => { + const cell = rowElement.insertCell(); + cell.textContent = cellData; + }); + }); + + // Aggiungi la tabella alla pagina + container.appendChild(table); + // Preserva il filtro + applyFilter(); + }) + .catch(err => { + //console.error("Errore nel caricamento dati:", err); + document.getElementById('data-container').innerHTML = `

Errore nel caricamento dei dati. Potrebbe essere un problema di rete, o un problema con la nostra API. Per favore riprova adesso o riprova più tardi.

`; + }); + } + function updateClock() { + const now = new Date(); + const hours = String(now.getHours()).padStart(2, '0'); + const minutes = String(now.getMinutes()).padStart(2, '0'); + const seconds = String(now.getSeconds()).padStart(2, '0'); + document.getElementById('clock').textContent = `${hours}:${minutes}:${seconds}`; + } + function clearFilters() { + // Pulisci tutti i filtri + document.getElementById("filterZona").value = ""; + document.getElementById("filterLinea").value = ""; + document.getElementById("filterVeicolo").value = ""; + document.getElementById("filterCodiceFermata").value = ""; + // Esegui la funzione per applicare i filtri (per sicurezza) + applyFilter(); + } + + setInterval(updateClock, 1000); + updateClock(); +// Applica il filtro ogni volta che l'utente digita +document.getElementById('filterZona').addEventListener('input', applyFilter); +document.getElementById('filterLinea').addEventListener('input', applyFilter); +document.getElementById('filterVeicolo').addEventListener('input', applyFilter); +document.getElementById('filterCodiceFermata').addEventListener('input', applyFilter); diff --git a/start_menu/start.html b/start_menu/start.html index 65e4155..ad3dd32 100644 --- a/start_menu/start.html +++ b/start_menu/start.html @@ -32,9 +32,12 @@ Extraurbano
-
+
Lista mezzi + Autobus in tempo reale + Corse non garantite
+

I servizi "Autobus in tempo reale" e "Corse non garantite" fanno uso di dati forniti da servizi Start Romagna.
L'unica cosa che facciamo è ottenerli e impaginarli in maniera differente dai servizi Start, spesso perchè fatti male.