Compare commits

...

3 Commits

Author SHA1 Message Date
Leocraft1
c8778a6df7 Ho rotto tutto 2025-10-20 16:37:50 +02:00
Leocraft1
e234ba9003 Link alla mappa compare comunque 2025-10-20 16:31:44 +02:00
Leocraft1
d5a0e15d88 Utilizzo iframe orari 2025-10-20 16:27:23 +02:00
4 changed files with 60 additions and 30 deletions

View File

@@ -21,8 +21,8 @@ body {
margin:8px;
}
#iframe{
width: 97%;
iframe{
width: 100%;
height: 2000px;
}
@@ -31,6 +31,30 @@ table{
margin-right: auto;
}
#selettore-direzione {
border-collapse: collapse;
border-radius: 8px;
width: 100%;
margin: auto;
}
table#selettore-direzione th:hover {
background-color: rgb(204, 132, 0);
}
table#selettore-direzione th:active{
background-color: rgb(255, 234, 196);
}
table#selettore-direzione th {
border-left: 1px solid #282828;
border-right: 1px solid #282828;
padding: .7vw;
padding-top: .6vw;
padding-bottom: .6vw;
text-align: center;
}
th,td {
border: none;
padding: .7vw;
@@ -39,10 +63,6 @@ th,td {
text-align: left;
}
td.uguale{
width: 50%;
}
hr{
margin-top:19px;
}
@@ -85,17 +105,6 @@ nav.index{
min-height: 46px;
}
nav#corsie-nav ul{
justify-content: center;
}
nav#corsie-nav ul li a{
color: white;
text-decoration: underline;
}
nav#corsie-nav ul li{
margin-left: 8px;
margin-right: 7px;
}
nav ul li {
margin-left: 20px;
margin-right: 20px;
@@ -161,9 +170,6 @@ img{
.container {
flex-direction: column;
}
th,td {
font-size: 90%;
}
nav#corsie-nav ul li a{
font-size: 75%;
margin: 0;

View File

@@ -15,14 +15,19 @@
</head>
<body>
<header>
<nav id="iframe-orari-nav">
<nav>
<ul>
<li><a href="/seta_menu/frequenze/index.html"><h1 style="font-size: 100%;font-weight: 500;">Selettore linea</h1></a></li>
</ul>
</nav>
</header>
<h2>Orari e mappa linea: <span id="linea-span"></span></h2>
<iframe id="iframe" src="" frameborder="0" onload="javascript:adattaIframe();"></iframe>
<h2>Linea: <span id="linea-span"></span></h2>
<div id="message"></div>
<table id="selettore-direzione">
<th onclick="javascript:setAs()">Andata</th>
<th onclick="javascript:setDi()">Ritorno</th>
</table>
<iframe id="iframe" src="" frameborder="0"></iframe>
<script src="js/iframeorari.js"></script>
<footer>
<div>

View File

@@ -2,15 +2,30 @@ const params = new URLSearchParams(window.location.search);
const num = params.get('routenum');
const lineaSpan = document.getElementById('linea-span');
const iframe = document.getElementById('iframe');
const linkContainer = document.getElementById('link-a-seta');
const messageDiv = document.getElementById('message');
const date = new Date();
const todayDate=date.getDate()+"/"+(date.getMonth()+1)+"/"+date.getFullYear();
const baseURL = "https://setaapi.serverissimo.freeddns.org/lineedyn_linea_dett_percorsi/?b=mo&l=MO"+num+"&dd="+todayDate+"&v=As";
const asURL = "https://setaapi.serverissimo.freeddns.org/lineedyn_linea_dett_percorsi/?b=mo&l=MO"+num+"&dd="+todayDate+"&v=As";
const diURL = "https://setaapi.serverissimo.freeddns.org/lineedyn_linea_dett_percorsi/?b=mo&l=MO"+num+"&dd="+todayDate+"&v=Di";
//Display numero linea
lineaSpan.innerHTML=num;
lineaSpan.textContent=num;
//Spawn iframe
iframe.setAttribute("src",baseURL);
iframe.setAttribute("src",asURL);
if(num==undefined||num==""){
iframe.setAttribute("src","");
message.innerHTML=`
<p>Non hai specificato nessuna linea nei parametri dell'url</p>
`;
}
function setAs(){
iframe.setAttribute("src",asURL);
}
function setDi(){
iframe.setAttribute("src",diURL);
}

View File

@@ -16,11 +16,13 @@ fetch(urlDesc)
return response.json();
})
.then(data =>{
linkContainer.innerHTML=`<a href="iframeorari.html?routenum=${data[0].linea}" class="biancosott">Visualizza tabella e mappa</a>`;
descContainer.innerHTML=`
<table id="desc-table">
<th>Destinazione</th>
<th>Tempo di percorrenza</th>
<th>Frequenza</th>
<th>Tempo di percorrenza (min)</th>
<th>Frequenza (min)</th>
<th>Sabato dopo le 14 e domenica (min)</th>
</table>`;
const table = document.getElementById('desc-table');
if(data[0].linea==undefined){
@@ -38,9 +40,11 @@ fetch(urlDesc)
var td = document.createElement('td');
td.innerHTML=data[0].frequenze[i];
tr.appendChild(td);
//var td = document.createElement('td');
//td.innerHTML=data[0].frequenze_dom[i];
//tr.appendChild(td);
table.appendChild(tr);
i++;
});
linkContainer.innerHTML=`<a href="${data[0].linkseta}" class="biancosott">Visualizza sul sito seta</a>`;
})
.catch(error => {descContainer.innerHTML="La linea specificata non possiede nessuna descrizione valida.";console.error(error);})