diff --git a/scripts/bus.json b/scripts/bus.json
deleted file mode 100644
index 1d4e3a7..0000000
--- a/scripts/bus.json
+++ /dev/null
@@ -1,65 +0,0 @@
-[
- {
- "matricola": "10108",
- "compagnia": "START Romagna",
- "settore" : "Extraurbano",
- "modello" : "Scania De Simon IL.3",
- "link": "startravenna_bus/extraurbano/desimon.html#10108",
- "linkmodello": "startravenna_bus/extraurbano/desimon.html",
- "linksettore": "start_menu/start_menu/startextra.html"
- },
- {
- "matricola": "10109",
- "compagnia": "START Romagna",
- "settore" : "Extraurbano",
- "modello" : "Scania De Simon IL.3",
- "link": "startravenna_bus/extraurbano/desimon.html#10109",
- "linkmodello": "startravenna_bus/extraurbano/desimon.html",
- "linksettore": "start_menu/start_menu/startextra.html"
- },
- {
- "matricola": "10110",
- "compagnia": "START Romagna",
- "settore" : "Extraurbano",
- "modello" : "Scania De Simon IL.3",
- "link": "startravenna_bus/extraurbano/desimon.html#10110",
- "linkmodello": "startravenna_bus/extraurbano/desimon.html",
- "linksettore": "start_menu/start_menu/startextra.html"
- },
- {
- "matricola": "10111",
- "compagnia": "START Romagna",
- "settore" : "Extraurbano",
- "modello" : "Scania De Simon IL.3",
- "link": "startravenna_bus/extraurbano/desimon.html#10111",
- "linkmodello": "startravenna_bus/extraurbano/desimon.html",
- "linksettore": "start_menu/start_menu/startextra.html"
- },
- {
- "matricola": "10112",
- "compagnia": "START Romagna",
- "settore" : "Extraurbano",
- "modello" : "Scania De Simon IL.3",
- "link": "startravenna_bus/extraurbano/desimon.html#10112",
- "linkmodello": "startravenna_bus/extraurbano/desimon.html",
- "linksettore": "start_menu/start_menu/startextra.html"
- },
- {
- "matricola": "10113",
- "compagnia": "START Romagna",
- "settore" : "Extraurbano",
- "modello" : "Scania De Simon IL.3",
- "link": "startravenna_bus/extraurbano/desimon.html#10113",
- "linkmodello": "startravenna_bus/extraurbano/desimon.html",
- "linksettore": "start_menu/start_menu/startextra.html"
- },
- {
- "matricola": "10114",
- "compagnia": "START Romagna",
- "settore" : "Extraurbano",
- "modello" : "Scania De Simon IL.3",
- "link": "startravenna_bus/extraurbano/desimon.html#10114",
- "linkmodello": "startravenna_bus/extraurbano/desimon.html",
- "linksettore": "start_menu/start_menu/startextra.html"
- }
-]
diff --git a/scripts/ertpl.js b/scripts/ertpl.js
deleted file mode 100644
index 991aabb..0000000
--- a/scripts/ertpl.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
-The function(s) below are used to fall back to the second (not for importance) server if the first is not available
-Swaps both links and images sources
-aid = identifier for the anchor (a tag)
-imgid = identifier for the image (img tag)
-path = path for the image starting from the root, for example /Dani/10225.jpg
-*/
-function changeUrlToFallback(aid,imgid,path) {
- try {
- document.getElementById(imgid).src = "http://serverissimo.freeddns.org:30081/apps/files_sharing/publicpreview/ffdqobqRg2ezKXt?file=" + path + "&x=1920&y=1080&a=true";
- } catch {}
- try {
- document.getElementById(aid).href = "http://serverissimo.freeddns.org:30081/apps/files_sharing/publicpreview/ffdqobqRg2ezKXt?file=" + path + "&x=1920&y=1080&a=true";
- } catch {}
-}
-function changeUrlToFallbackNoTrue(aid,imgid,path) {
- try {
- document.getElementById(imgid).src = "http://serverissimo.freeddns.org:30081/apps/files_sharing/publicpreview/ffdqobqRg2ezKXt?file=" + path + "&x=1920&y=1080";
- } catch {}
- try {
- document.getElementById(aid).href = "http://serverissimo.freeddns.org:30081/apps/files_sharing/publicpreview/ffdqobqRg2ezKXt?file=" + path + "&x=1920&y=1080";
- } catch {}
-}
\ No newline at end of file
diff --git a/scripts/search.js b/scripts/search.js
deleted file mode 100644
index b5d78ec..0000000
--- a/scripts/search.js
+++ /dev/null
@@ -1,54 +0,0 @@
-const searchBar = document.getElementById('searchBar');
-const productsContainer = document.getElementById('bus-container');
-let allProducts = [];
-
-const url = '/scripts/bus.json'; // cambia con il tuo URL
-
-window.onbeforeunload=searchBar.value="";
-fetch(url)
- .then(response => {
- if (!response.ok) throw new Error("Errore nel caricamento dei dati.");
- return response.json();
- })
- .then(data => {
- allProducts = data;
- //renderProducts(allProducts);
- })
- .catch(error => console.error('Errore nel caricamento dei dati:', error));
-
-searchBar.addEventListener('input', () => {
- if (searchBar.value == '') {
- productsContainer.innerHTML = '';
- return;
- }
- const searchTerm = searchBar.value.toLowerCase();
- const filtered = allProducts.filter(bus =>
- bus.matricola.toLowerCase().includes(searchTerm)
- );
- renderProducts(filtered);
-});
-searchBar.addEventListener('click', () => {
- if (searchBar.value == '') {
- productsContainer.innerHTML = '';
- return;
- }
- const searchTerm = searchBar.value.toLowerCase();
- const filtered = allProducts.filter(bus =>
- bus.matricola.toLowerCase().includes(searchTerm)
- );
- renderProducts(filtered);
-});
-
-function renderProducts(products) {
- productsContainer.innerHTML = '';
- products.forEach(bus => {
- const div = document.createElement('div');
- div.className = 'product-card';
- div.innerHTML = `
- ${bus.compagnia} - ${bus.settore} ${bus.modello}${bus.matricola}
-
${bus.settore}
+${bus.modello}
+ + `; + productsContainer.appendChild(div); + }); + } \ No newline at end of file diff --git a/scripts/startbus.json b/scripts/startbus.json new file mode 100644 index 0000000..43bd3d9 --- /dev/null +++ b/scripts/startbus.json @@ -0,0 +1,58 @@ +[ + { + "matricola": "10108", + "settore" : "Extraurbano", + "modello" : "Scania De Simon IL.3", + "link": "/startravenna_bus/extraurbano/desimon.html#10108", + "linkmodello": "/startravenna_bus/extraurbano/desimon.html", + "linksettore": "/start_menu/start_menu/startextra.html" + }, + { + "matricola": "10109", + "settore" : "Extraurbano", + "modello" : "Scania De Simon IL.3", + "link": "/startravenna_bus/extraurbano/desimon.html#10109", + "linkmodello": "/startravenna_bus/extraurbano/desimon.html", + "linksettore": "/start_menu/start_menu/startextra.html" + }, + { + "matricola": "10110", + "settore" : "Extraurbano", + "modello" : "Scania De Simon IL.3", + "link": "/startravenna_bus/extraurbano/desimon.html#10110", + "linkmodello": "/startravenna_bus/extraurbano/desimon.html", + "linksettore": "/start_menu/start_menu/startextra.html" + }, + { + "matricola": "10111", + "settore" : "Extraurbano", + "modello" : "Scania De Simon IL.3", + "link": "/startravenna_bus/extraurbano/desimon.html#10111", + "linkmodello": "/startravenna_bus/extraurbano/desimon.html", + "linksettore": "/start_menu/start_menu/startextra.html" + }, + { + "matricola": "10112", + "settore" : "Extraurbano", + "modello" : "Scania De Simon IL.3", + "link": "/startravenna_bus/extraurbano/desimon.html#10112", + "linkmodello": "/startravenna_bus/extraurbano/desimon.html", + "linksettore": "/start_menu/start_menu/startextra.html" + }, + { + "matricola": "10113", + "settore" : "Extraurbano", + "modello" : "Scania De Simon IL.3", + "link": "/startravenna_bus/extraurbano/desimon.html#10113", + "linkmodello": "/startravenna_bus/extraurbano/desimon.html", + "linksettore": "/start_menu/start_menu/startextra.html" + }, + { + "matricola": "10114", + "settore" : "Extraurbano", + "modello" : "Scania De Simon IL.3", + "link": "/startravenna_bus/extraurbano/desimon.html#10114", + "linkmodello": "/startravenna_bus/extraurbano/desimon.html", + "linksettore": "/start_menu/start_menu/startextra.html" + } +] \ No newline at end of file diff --git a/scripts/startsearch.js b/scripts/startsearch.js new file mode 100644 index 0000000..853a80f --- /dev/null +++ b/scripts/startsearch.js @@ -0,0 +1,57 @@ + const searchBar = document.getElementById('searchBar'); + const productsContainer = document.getElementById('bus-container'); + const buttons = document.getElementById('buttons'); + + let allProducts = []; + + const url = '/scripts/startbus.json'; + fetch(url) + .then(response => { + if (!response.ok) throw new Error("Errore nel caricamento dei dati."); + return response.json(); + }) + .then(data => { + allProducts = data; + }) + .catch(error => console.error('Errore nel caricamento dei dati:', error)); + + searchBar.addEventListener('input', () => { + if (searchBar.value == '') { + productsContainer.innerHTML = ' '; + buttons.innerHTML = ` + + +${bus.modello}
+${bus.settore}
+ `; + productsContainer.appendChild(div); + }); + } \ No newline at end of file diff --git a/seta_menu/seta.html b/seta_menu/seta.html index 29616bd..7152418 100644 --- a/seta_menu/seta.html +++ b/seta_menu/seta.html @@ -25,17 +25,27 @@