Fix vari e TPER work in progress
This commit is contained in:
parent
955558766a
commit
ee6fd0b283
|
@ -1,3 +1,4 @@
|
|||
{
|
||||
"liveServer.settings.port": 5500
|
||||
"liveServer.settings.port": 5500,
|
||||
"remove-empty-lines.allowedNumberOfEmptyLines": 500
|
||||
}
|
||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2024 Curry141
|
||||
Copyright (c) 2025 ER-TPL Team
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<h2 class="piccolospazio">SETA:</h2>
|
||||
<!--Si chiama Citymood, non Menarino. Leo, fai il serio almeno nel sito!-->
|
||||
<p class="piccolospazio">
|
||||
Nuove foto interni <a class="novita" href="/setamodena_bus/extraurbano/integro.html">Integro</a>
|
||||
Nuove foto interni <a class="novita" href="/setamodena_bus/extraurbano/integro.html">Integro</a><br>
|
||||
Aggiunto pulsante video <a class="novita" href="/setamodena_bus/extraurbano/integro.html">Integro</a>
|
||||
</p>
|
||||
</div>
|
||||
|
@ -49,7 +49,7 @@
|
|||
<h2 class="piccolospazio">Ravenna:</h2>
|
||||
<p class="piccolospazio">
|
||||
Aggiunti <a class="novita" href="/startravenna_bus/suburbano/uwmh.html">Iveco Urbanway 12 Mild Hybrid CNG</a>.<br>
|
||||
Aggiunti link alla lista mezzi.
|
||||
Aggiunti link alla <a href="/startravenna_bus/listamezzi.html">lista mezzi</a>.
|
||||
</p>
|
||||
</div>
|
||||
<div class="riga">
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<a href="/ravenna_privatibus/gamberini.html" class="button">Gamberini</a>
|
||||
<a href="/ravenna_privatibus/pollini.html" class="button">Pollini</a>
|
||||
<a href="/ravenna_privatibus/zaganelli.html" class="button">Zaganelli</a>
|
||||
<a href="/ravenna_privatibus/riolo.html" class="button">Cooperativa Trasporti di Riolo Terme</a>
|
||||
<a href="/ravenna_privatibus/riolo.html" class="button">Riolo Terme</a>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/scripts/metesearch.js"></script>
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"matricola": "placeholderMatricola",
|
||||
"settore": "placeholderSettore",
|
||||
"modello": "placeholderModello",
|
||||
"link": "placeholderLink"
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
const searchBar = document.getElementById('searchBar');
|
||||
const productsContainer = document.getElementById('bus-container');
|
||||
const buttons = document.getElementById('buttons');
|
||||
|
||||
let allProducts = [];
|
||||
window.onbeforeunload=searchBar.value="";
|
||||
|
||||
const url = '/scripts/tperbus.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 = `
|
||||
<div class="verticale">
|
||||
<a href="/tper_menu/tpersub.html" class="button">Suburbano</a>
|
||||
<a href="/tper_menu/tperextra.html" class="button">Extraurbano</a>
|
||||
</div>
|
||||
`;
|
||||
return;
|
||||
}
|
||||
buttons.innerHTML = ' ';
|
||||
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 = `
|
||||
<a href="${bus.link}">
|
||||
<h3>${bus.matricola}</h3>
|
||||
<p>${bus.modello}</p>
|
||||
<p>${bus.settore}</p>
|
||||
</a>
|
||||
`;
|
||||
productsContainer.appendChild(div);
|
||||
});
|
||||
}
|
5
todo.txt
5
todo.txt
|
@ -1,6 +1,3 @@
|
|||
citarole articolo la linea
|
||||
integro cercare articolo
|
||||
ares cercare articolo
|
||||
|
||||
Dani:
|
||||
fallback menu no true quando leo sistemerà Iliad
|
||||
ares cercare articolo
|
|
@ -26,8 +26,16 @@
|
|||
</header>
|
||||
<h1>TPER</h1>
|
||||
<div class="verticale">
|
||||
<a href="/tper_menu/tpersub.html" class="button">Suburbano</a>
|
||||
<a href="/tper_menu/tperextra.html" class="button">Extraurbano</a>
|
||||
<input type="text" id="searchBar" placeholder="Cerca una matricola...">
|
||||
<div id="bus-container"></div>
|
||||
</div>
|
||||
<br>
|
||||
<div id="buttons">
|
||||
<div class="verticale">
|
||||
<a href="/tper_menu/tpersub.html" class="button">Suburbano</a>
|
||||
<a href="/tper_menu/tperextra.html" class="button">Extraurbano</a>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/scripts/tpersearch.js"></script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue