Utilizzo iframe orari

This commit is contained in:
Leocraft1
2025-10-20 16:27:23 +02:00
parent 72e13714d8
commit d5a0e15d88
4 changed files with 54 additions and 25 deletions

View File

@@ -21,8 +21,8 @@ body {
margin:8px; margin:8px;
} }
#iframe{ iframe{
width: 97%; width: 100%;
height: 2000px; height: 2000px;
} }
@@ -31,6 +31,30 @@ table{
margin-right: auto; 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 { th,td {
border: none; border: none;
padding: .7vw; padding: .7vw;
@@ -39,10 +63,6 @@ th,td {
text-align: left; text-align: left;
} }
td.uguale{
width: 50%;
}
hr{ hr{
margin-top:19px; margin-top:19px;
} }
@@ -85,17 +105,6 @@ nav.index{
min-height: 46px; 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 { nav ul li {
margin-left: 20px; margin-left: 20px;
margin-right: 20px; margin-right: 20px;

View File

@@ -15,14 +15,19 @@
</head> </head>
<body> <body>
<header> <header>
<nav id="iframe-orari-nav"> <nav>
<ul> <ul>
<li><a href="/seta_menu/frequenze/index.html"><h1 style="font-size: 100%;font-weight: 500;">Selettore linea</h1></a></li> <li><a href="/seta_menu/frequenze/index.html"><h1 style="font-size: 100%;font-weight: 500;">Selettore linea</h1></a></li>
</ul> </ul>
</nav> </nav>
</header> </header>
<h2>Orari e mappa linea: <span id="linea-span"></span></h2> <h2>Linea: <span id="linea-span"></span></h2>
<iframe id="iframe" src="" frameborder="0" onload="javascript:adattaIframe();"></iframe> <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> <script src="js/iframeorari.js"></script>
<footer> <footer>
<div> <div>

View File

@@ -2,15 +2,30 @@ const params = new URLSearchParams(window.location.search);
const num = params.get('routenum'); const num = params.get('routenum');
const lineaSpan = document.getElementById('linea-span'); const lineaSpan = document.getElementById('linea-span');
const iframe = document.getElementById('iframe'); const iframe = document.getElementById('iframe');
const linkContainer = document.getElementById('link-a-seta'); const messageDiv = document.getElementById('message');
const date = new Date(); const date = new Date();
const todayDate=date.getDate()+"/"+(date.getMonth()+1)+"/"+date.getFullYear(); 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 //Display numero linea
lineaSpan.innerHTML=num; lineaSpan.textContent=num;
//Spawn iframe //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

@@ -41,6 +41,6 @@ fetch(urlDesc)
table.appendChild(tr); table.appendChild(tr);
i++; i++;
}); });
linkContainer.innerHTML=`<a href="${data[0].linkseta}" class="biancosott">Visualizza sul sito seta</a>`; linkContainer.innerHTML=`<a href="iframeorari.html?routenum=${data[0].linea}" class="biancosott">Visualizza tabella e mappa</a>`;
}) })
.catch(error => {descContainer.innerHTML="La linea specificata non possiede nessuna descrizione valida.";console.error(error);}) .catch(error => {descContainer.innerHTML="La linea specificata non possiede nessuna descrizione valida.";console.error(error);})