Notizie seta!!!

This commit is contained in:
Leocraft1
2025-11-02 18:52:20 +01:00
parent a237c35680
commit 3c3678b509
15 changed files with 189 additions and 62 deletions

View File

@@ -16,7 +16,7 @@
<ul>
<li><a href="/index.html"><h1 style="font-size: 100%;font-weight: 500;">Home</h1></a></li>
<li><a href="/service/newui.html"><h1 style="font-size: 100%;font-weight: 500;">SETA Modena</h1></a></li>
<li><a href="/seta_menu/documentistorici/index.html"><h1 style="font-size: 100%;font-weight: 500;">Documenti Storici</h1></a></li>
<li><a href="/seta_modena/menu/documentistorici/index.html"><h1 style="font-size: 100%;font-weight: 500;">Documenti Storici</h1></a></li>
</ul>
</nav>
</header>

View File

@@ -28,7 +28,7 @@
<a class="blue button" href="https://drive.serverissimo.freeddns.org/s/Mf3QczdRzHJja7a">Orari</a>
<a class="blue button" href="https://drive.serverissimo.freeddns.org/s/zQSdpf9gdRAPttL">Gare di assunzione</a>
<div style="height: 8px;"></div>
<a href="/seta_menu/documentistorici/radiati.html" class="red button">Veicoli radiati</a>
<a href="/seta_modena/menu/documentistorici/radiati.html" class="red button">Veicoli radiati</a>
</div>
</body>
</html>

View File

@@ -21,7 +21,7 @@
</header>
<h1>Indice veicoli radiati per anno</h1>
<div>
<a href="/seta_menu/radiati/estate25.html" class="red button">Estate 2025</a>
<a href="/seta_modena/menu/radiati/estate25.html" class="red button">Estate 2025</a>
</div>
</body>
</html>

View File

@@ -16,7 +16,7 @@
<ul>
<li><a href="/index.html"><h1 style="font-size: 100%;font-weight: 500;">Home</h1></a></li>
<li><a href="/service/newui.html"><h1 style="font-size: 100%;font-weight: 500;">SETA Modena</h1></a></li>
<li><a href="/seta_menu/filobus.html"><h1 style="font-size: 100%;font-weight: 500;">SETA Filobus</h1></a></li>
<li><a href="/seta_modena/menu/filobus.html"><h1 style="font-size: 100%;font-weight: 500;">SETA Filobus</h1></a></li>
<li><a href="/seta_modena/bus/filobus/busottongt.html"><h1 style="font-size: 100%;font-weight: 500;">Busotto NGT</h1></a></li>
</ul>
</nav>

View File

@@ -16,7 +16,7 @@
<ul>
<li><a href="/index.html"><h1 style="font-size: 100%;font-weight: 500;">Home</h1></a></li>
<li><a href="/service/newui.html"><h1 style="font-size: 100%;font-weight: 500;">SETA Modena</h1></a></li>
<li><a href="/seta_menu/documentistorici/index.html"><h1 style="font-size: 100%;font-weight: 500;">Documenti Storici</h1></a></li>
<li><a href="/seta_modena/menu/documentistorici/index.html"><h1 style="font-size: 100%;font-weight: 500;">Documenti Storici</h1></a></li>
</ul>
</nav>
</header>

View File

@@ -27,54 +27,17 @@
<br>
<div id="buttons">
<div>
<a href="/seta_menu/urbano.html" class="blue button">Urbano</a>
<a href="/seta_menu/suburbano.html" class="blue button">Suburbano</a>
<a href="/seta_menu/extraurbano.html" class="blue button">Extraurbano</a>
<a href="/seta_menu/filobus.html" class="blue button">Filobus</a>
<a href="/seta_modena/menu/urbano.html" class="blue button">Urbano</a>
<a href="/seta_modena/menu/suburbano.html" class="blue button">Suburbano</a>
<a href="/seta_modena/menu/extraurbano.html" class="blue button">Extraurbano</a>
<a href="/seta_modena/menu/filobus.html" class="blue button">Filobus</a>
<a href="/seta_modena/bus/minibus/sprinter.html" class="blue button">Minibus</a>
<a href="/seta_modena/bus/servizio.html" class="blue button">Veicoli di servizio</a>
</div>
<div style="height: 8px;"></div>
<hr class="solid">
<h2>News SETA Modena:</h2>
<div style="display:flex;overflow-x: scroll;">
<div class="product-card" style="min-width: 270px;">
<a href="">
<h3>Titolo</h3>
<p>Descrizione</p>
</a>
</div>
<div class="product-card" style="min-width: 270px;">
<a href="">
<h3>Titolo</h3>
<p>Descrizione</p>
</a>
</div>
<div class="product-card" style="min-width: 270px;">
<a href="">
<h3>Titolo</h3>
<p>Descrizione</p>
</a>
</div>
<div class="product-card" style="min-width: 270px;">
<a href="">
<h3>Titolo</h3>
<p>Descrizione</p>
</a>
</div>
<div class="product-card" style="min-width: 270px;">
<a href="">
<h3>Titolo</h3>
<p>Descrizione</p>
</a>
</div>
<div class="product-card" style="min-width: 270px;">
<a href="">
<h3>Titolo</h3>
<p>Descrizione</p>
</a>
</div>
</div>
<div id="news-container"></div>
<hr class="solid">
<h2>Servizi SETA Modena:</h2>
<div>
@@ -87,11 +50,12 @@
<hr class="solid">
<h2>Documenti storici:</h2>
<div>
<a class="green button" href="/seta_menu/documentistorici/index.html">Documenti e Foto</a>
<a class="green button" href="/seta_menu/documentistorici/wayback.html">Siti web con Wayback Machine</a>
<a class="green button" href="/seta_modena/menu/documentistorici/index.html">Documenti e Foto</a>
<a class="green button" href="/seta_modena/menu/documentistorici/wayback.html">Siti web con Wayback Machine</a>
</div>
</div>
<div style="height: 65px;"></div>
<script src="js/setasearch.js"></script>
<script src="js/notizie.js"></script>
</body>
</html>

View File

@@ -0,0 +1,29 @@
const params = new URLSearchParams(window.location.search);
const link = params.get('link');
const notiziaContainer = document.getElementById('notizia-container');
//URL
const newsURL = "https://setaapi.serverissimo.freeddns.org/news?link="+link;
notiziaContainer.innerHTML="<p>Caricamento notizia...</p>";
fetch(newsURL)
.then(response => {
if (!response.ok){
notiziaContainer.innerHTML="<p>Impossibile raggiungere l'API.</p>";
throw new Error("Errore nel caricamento dei dati.");
}
return response.json();
}).then(element =>{
notiziaContainer.innerHTML="";
var div = document.createElement('div');
var h1 = document.createElement('h1');
var p = document.createElement('p');
var p2 = document.createElement('p');
p.innerHTML=element.date;
h1.innerHTML=element.title;
div.appendChild(p);
div.appendChild(h1);
p2.innerHTML=element.content;
div.appendChild(p2);
notiziaContainer.appendChild(div);
})

View File

@@ -0,0 +1,57 @@
const newsContainer = document.getElementById('news-container');
//URL
const newsURL = "https://setaapi.serverissimo.freeddns.org/allnews";
newsContainer.innerHTML="<p>Caricamento notizie...</p>";
fetch(newsURL)
.then(response => {
if (!response.ok){
newsContainer.innerHTML="<p>Impossibile raggiungere l'API.</p>";
throw new Error("Errore nel caricamento dei dati.");
}
return response.json();
}).then(data =>{
newsContainer.innerHTML="";
data.news.forEach(element => {
var div = document.createElement('div');
div.setAttribute("class","news-card");
var a = document.createElement('a');
var h3 = document.createElement('h3');
var p = document.createElement('p');
var span = document.createElement('span');
if(element.type=="Importante"){
span.setAttribute("class","red");
}
if(element.type=="Informazione"){
span.setAttribute("class","yellow");
}
if(element.type=="Novità"){
span.setAttribute("class","green");
}
if(element.type=="Orari"){
span.setAttribute("class","yellow");
}
if(element.type=="Autobus Treno"){
span.setAttribute("class","blu");
}
if(element.type=="Lavori in corso"){
span.setAttribute("class","red");
}
if(element.type=="Biglietti"){
span.setAttribute("class","blu");
}
//P creation
span.innerHTML=element.type;
p.innerHTML=element.date+" - ";
p.appendChild(span);
h3.innerHTML=element.title;
//Link creation
const link = "/seta_modena/menu/notizia.html?link="+element.link;
a.setAttribute("href",link);
a.appendChild(p);
a.appendChild(h3);
div.appendChild(a);
newsContainer.appendChild(div);
});
})

View File

@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ER-TPL - SETA Suburbano</title>
<link rel="stylesheet" href="/style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Titillium+Web:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700&display=swap" rel="stylesheet">
<link rel="shortcut icon" href="https://drive.serverissimo.freeddns.org/apps/files_sharing/publicpreview/ffdqobqRg2ezKXt?file=/Immagini%20sito/atcma.png" type="image/x-icon">
</head>
<body>
<header>
<nav>
<ul>
<li><a href="/index.html"><h1 style="font-size: 100%;font-weight: 500;">Home</h1></a></li>
<li><a href="/service/newui.html"><h1 style="font-size: 100%;font-weight: 500;">SETA Modena</h1></a></li>
</ul>
</nav>
</header>
<div id="notizia-container"></div>
<script src="js/notizia.js"></script>
</body>
</html>

View File

@@ -16,7 +16,7 @@
<ul>
<li><a href="/index.html"><h1 style="font-size: 100%;font-weight: 500;">Home</h1></a></li>
<li><a href="/service/newui.html"><h1 style="font-size: 100%;font-weight: 500;">SETA Modena</h1></a></li>
<li><a href="/seta_menu/radiatimenu.html"><h1 style="font-size: 100%;font-weight: 500;">Menu radiati</h1></a></li>
<li><a href="/seta_modena/menu/radiatimenu.html"><h1 style="font-size: 100%;font-weight: 500;">Menu radiati</h1></a></li>
</ul>
</nav>
</header>

View File

@@ -13,7 +13,6 @@
<body>
<header>
<nav>
<ul>
<li><a href="/index.html"><h1 style="font-size: 100%;font-weight: 500;">Home</h1></a></li>
<li><a href="/service/newui.html"><h1 style="font-size: 100%;font-weight: 500;">SETA Modena</h1></a></li>