mirror of
https://github.com/Daniongithub/ER-TPL.git
synced 2025-12-06 20:12:03 +00:00
Integrazione iframeorari in percorsi + fix navbar percorsi @media
This commit is contained in:
228
seta_menu/percorsi/css/style-iframeorari.css
Normal file
228
seta_menu/percorsi/css/style-iframeorari.css
Normal file
@@ -0,0 +1,228 @@
|
||||
body {
|
||||
background-color: #282828;
|
||||
text-align: center;
|
||||
color: white;
|
||||
font-family: Titillium Web;
|
||||
}
|
||||
|
||||
.search-result {
|
||||
border: 2px solid white;
|
||||
border-radius: 8px;
|
||||
width: 20vw;
|
||||
margin: auto;
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
margin-top: 10px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#link-a-seta{
|
||||
margin:8px;
|
||||
}
|
||||
|
||||
iframe{
|
||||
width: 100%;
|
||||
height: 2000px;
|
||||
}
|
||||
|
||||
table{
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
th,td {
|
||||
border: none;
|
||||
padding: .7vw;
|
||||
padding-top: .6vw;
|
||||
padding-bottom: .6vw;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
hr{
|
||||
margin-top:19px;
|
||||
}
|
||||
|
||||
h1.warning {
|
||||
color:red;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
h1.yellow-warning {
|
||||
color:rgb(255, 205, 0);
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
header {
|
||||
font-size: 67%;
|
||||
background-color: #333;
|
||||
height: auto;
|
||||
padding: 0px 0px;
|
||||
align-items: start;
|
||||
width: 100%;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
nav ul {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
}
|
||||
|
||||
nav {
|
||||
text-align: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
nav.index{
|
||||
display: flex;
|
||||
min-height: 46px;
|
||||
}
|
||||
|
||||
nav ul li {
|
||||
margin-left: 20px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
nav ul li a {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
nav ul li a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.bus-card-red {
|
||||
background-color: rgb(55,0,0) !important;
|
||||
}
|
||||
.bus-card-yellow {
|
||||
background-color: rgb(65, 65, 0) !important;
|
||||
}
|
||||
.bus-card-green {
|
||||
background-color: rgb(0, 55, 0) !important;
|
||||
}
|
||||
|
||||
a {
|
||||
color: orange;
|
||||
}
|
||||
|
||||
a.bianco{
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.rosso{
|
||||
color:white;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.rosso div{
|
||||
background-color: rgb(55,0,0) !important;
|
||||
}
|
||||
|
||||
a.biancosott{
|
||||
color: white;
|
||||
}
|
||||
a.link-cell {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
color: white;
|
||||
}
|
||||
|
||||
img{
|
||||
height:300px;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
table#selettore-direzione th:first-child {
|
||||
background-color: rgb(50, 50, 50);
|
||||
border-top-left-radius: 8px;
|
||||
}
|
||||
table#selettore-direzione th:last-child {
|
||||
background-color: rgb(50, 50, 50);
|
||||
border-top-right-radius: 8px;
|
||||
}
|
||||
iframe{
|
||||
width: 100%;
|
||||
height: 2200px;
|
||||
}
|
||||
.search-result {
|
||||
display: block;
|
||||
width: 96.5%;
|
||||
}
|
||||
.container {
|
||||
flex-direction: column;
|
||||
}
|
||||
nav#corsie-nav ul li a{
|
||||
font-size: 75%;
|
||||
margin: 0;
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
h2.noreduction{
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
#searchBar {
|
||||
width: 80%;
|
||||
}
|
||||
#stopCodeBar {
|
||||
width: 80%;
|
||||
}
|
||||
hr{
|
||||
margin-bottom:19px;
|
||||
}
|
||||
img{
|
||||
width: 98%;
|
||||
height: auto;
|
||||
}
|
||||
nav ul:last-child li {
|
||||
margin-right: 20px;
|
||||
}
|
||||
nav ul li {
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
#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: 10.7px;
|
||||
padding-top: 9.2px;
|
||||
padding-bottom: 9.2px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
footer {
|
||||
position: relative;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
div.search-result div{
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
p.space{
|
||||
width: 20px;
|
||||
}
|
||||
@@ -32,9 +32,9 @@ th {
|
||||
|
||||
th,td {
|
||||
border: 2px solid #444;
|
||||
padding: .7vw;
|
||||
padding-top: .6vw;
|
||||
padding-bottom: .6vw;
|
||||
padding: 10.75px;
|
||||
padding-top: 9.2px;
|
||||
padding-bottom: 9.2px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@@ -162,6 +162,9 @@ img{
|
||||
}
|
||||
th,td {
|
||||
font-size: 90%;
|
||||
padding: .7vw;
|
||||
padding-top: .6vw;
|
||||
padding-bottom: .6vw;
|
||||
}
|
||||
nav#corsie-nav ul li a{
|
||||
font-size: 75%;
|
||||
@@ -189,12 +192,15 @@ img{
|
||||
width: 98%;
|
||||
height: auto;
|
||||
}
|
||||
nav ul:last-child li {
|
||||
margin-right: 20px;
|
||||
}
|
||||
nav ul li {
|
||||
margin-right: 8px;
|
||||
}
|
||||
nav#rcodes-nav ul:last-child li {
|
||||
margin-right: 20px;
|
||||
}
|
||||
nav#rcodes-nav ul li:last-child {
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 512px) {
|
||||
|
||||
39
seta_menu/percorsi/iframeorari.html
Normal file
39
seta_menu/percorsi/iframeorari.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="it">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="description" content="Visualizza i tempi di percorrenza di SETA a Modena.">
|
||||
<meta name="keywords" content="seta, modena, seta-modena, orari, in, tempo, reale, autobus, fermate, orario, palina">
|
||||
<meta name="author" content="ER-TPL Team">
|
||||
<title>SETA Modena - Tempi di percorrenza</title>
|
||||
<link rel="stylesheet" href="css/style-iframeorari.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="shortcut icon" href="https://www.setaweb.it/images/favicon/android-icon-192x192.png">
|
||||
<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">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="javascript:history.back()"><h1 style="font-size: 100%;font-weight: 500;">Torna indietro</h1></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<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>
|
||||
<div id="caricamento-div"></div>
|
||||
<iframe id="iframe" src="" frameborder="0" onload="javascript:removeLoading()"></iframe>
|
||||
<script src="js/iframeorari.js"></script>
|
||||
<footer>
|
||||
<div>
|
||||
<p>Copyright (C) 2025 ER-TPL Team - <a href="https://ertpl.pages.dev" target="_blank">ertpl.pages.dev</a> - code by Il Dani & SetaModenaFanpage <a href="https://github.com/Leocraft1/SetaAPI" target="_blank">Codice Sorgente</a> - I loghi SETA Spa sono marchi registrati e sono inseriti in questo sito solo a scopo di illustrazione.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
49
seta_menu/percorsi/js/iframeorari.js
Normal file
49
seta_menu/percorsi/js/iframeorari.js
Normal file
@@ -0,0 +1,49 @@
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const num = params.get('routenum');
|
||||
const lineaSpan = document.getElementById('linea-span');
|
||||
const iframe = document.getElementById('iframe');
|
||||
const messageDiv = document.getElementById('message');
|
||||
const loadingDiv = document.getElementById('caricamento-div');
|
||||
|
||||
const date = new Date();
|
||||
const todayDate=date.getDate()+"/"+(date.getMonth()+1)+"/"+date.getFullYear();
|
||||
|
||||
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.textContent=num;
|
||||
|
||||
//Schermata di caricamento, viene annullata da onload dell'iframe
|
||||
loadingDiv.style.margin="12px";
|
||||
loadingDiv.innerHTML="Caricamento in corso...";
|
||||
iframe.style.display="none";
|
||||
|
||||
//Spawn iframe
|
||||
iframe.setAttribute("src",asURL);
|
||||
if(num==undefined||num==""){
|
||||
iframe.setAttribute("src","");
|
||||
messageDiv.innerHTML=`
|
||||
<p>Non hai specificato nessuna linea nei parametri dell'url</p>
|
||||
`;
|
||||
}
|
||||
|
||||
function setAs(){
|
||||
loadingDiv.style.margin="12px";
|
||||
loadingDiv.innerHTML="Caricamento in corso...";
|
||||
iframe.style.display="none";
|
||||
iframe.setAttribute("src",asURL);
|
||||
}
|
||||
|
||||
function setDi(){
|
||||
loadingDiv.style.margin="12px";
|
||||
loadingDiv.innerHTML="Caricamento in corso...";
|
||||
iframe.style.display="none";
|
||||
iframe.setAttribute("src",diURL);
|
||||
}
|
||||
|
||||
function removeLoading(){
|
||||
loadingDiv.style.margin="";
|
||||
loadingDiv.innerHTML="";
|
||||
iframe.style.display="";
|
||||
}
|
||||
@@ -1,9 +1,18 @@
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const container = document.getElementById('res-container');
|
||||
const id = params.get('routenum');
|
||||
const nav = document.getElementById('rcodes-nav')
|
||||
|
||||
const url = "https://setaapi.serverissimo.freeddns.org/routecodesarchive";
|
||||
|
||||
//Spawn iframeorari
|
||||
if(id!=undefined&&id!=""){
|
||||
const ul = document.createElement('ul');
|
||||
ul.setAttribute("style","flex:1;justify-content: right;");
|
||||
ul.innerHTML=`<li><a href="/seta_menu/percorsi/iframeorari.html?routenum=${id}"><h1 style="font-size: 100%;font-weight: 500;">Orari e mappa di oggi</h1></a></li>`;
|
||||
nav.appendChild(ul);
|
||||
}
|
||||
|
||||
//Elenco percorsi
|
||||
fetch(url)
|
||||
.then(response => {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav style="display: flex;">
|
||||
<nav id="rcodes-nav" style="display: flex;">
|
||||
<ul>
|
||||
<li><a href="/index.html"><h1 style="font-size: 100%;font-weight: 500;">Home</h1></a></li>
|
||||
<li><a href="/seta_menu/percorsi/index.html"><h1 style="font-size: 100%;font-weight: 500;">Selettore linea</h1></a></li>
|
||||
|
||||
Reference in New Issue
Block a user