-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
138 lines (137 loc) · 5.25 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8" />
<link
rel="icon"
type="image/x-icon"
href="https://rfig.enekogarrido.com/resources/img/favicon.png"
/>
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin="anonymous"
/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"
></script>
<style>
img {
margin-left: 3rem;
margin-right: 3rem;
}
</style>
<title>Buscador estaciones - RFIG</title>
<!-- Matomo -->
<script>
var _paq = (window._paq = window._paq || []);
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function () {
var u = "https://analytics.enekogarrido.com/";
_paq.push(["setTrackerUrl", u + "matomo.php"]);
_paq.push(["setSiteId", "6"]);
var d = document,
g = d.createElement("script"),
s = d.getElementsByTagName("script")[0];
g.async = true;
g.src = u + "matomo.js";
s.parentNode.insertBefore(g, s);
})();
</script>
<noscript>
<p>
<img
src="https://analytics.enekogarrido.com/matomo.php?idsite=6&rec=1"
style="border: 0"
alt=""
/>
</p>
</noscript>
<!-- End Matomo Code -->
</head>
<body>
<div class="container" style="padding-top: 5rem">
<h1>Introduce la estación</h1>
<form role="form">
<div class="form-group">
<input
type="input"
class="form-control input-lg"
id="txt-search"
placeholder="Puedes introducir el nombre o el número"
/>
</div>
</form>
<div class="container">
<div
class="row row-cols-2 row-cols-lg-2 g-2 g-lg-2"
style="margin-top: 3rem"
id="filter-records"
></div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
$("#txt-search").keyup(function () {
var searchField = $(this).val();
if (searchField === "") {
$("#filter-records").html("");
return;
}
var regex = new RegExp(searchField, "i");
var output = "";
var data;
$.getJSON(
"https://rfig.enekogarrido.com/resources/json/estaciones.json",
function (data) {
$.each(data, function (key, val) {
if (
val["NUMERO"].toString().search(regex) != -1 ||
val.NOMBRE.search(regex) != -1
) {
output += '<div class="col">';
output +=
'<div class="bg-success p-2 text-dark bg-opacity-25">';
output += '<div style="margin:0.5rem;" class="">';
output +=
'<h5 style="text-transform: uppercase;">' +
val.NOMBRE +
"</h5>";
output += "<p>" + val.NUMERO + "</p>";
if (val.CERCANIAS == "SI" && val.FEVE == "NO") {
//output += "<p>Dispone de Cercanías</p>";
output +=
"<div class='d-flex justify-content-center'><img height='55rem' src='https://rfig.enekogarrido.com/resources/img/cercanias.svg' alt='Logo Renfe Cercanías. Esta estación dispone de servicios de Cercanías.' /></div>";
}
if (val.FEVE == "SI" && val.CERCANIAS == "NO") {
output +=
"<div class='d-flex justify-content-center'><img height='55rem' src='https://rfig.enekogarrido.com/resources/img/feve.svg' alt='Logo Renfe Feve. Esta estación dispone de servicios de Feve.' /></div>";
}
if (val.FEVE == "SI" && val.CERCANIAS == "SI") {
output +=
"<div class='d-flex justify-content-center'><img height='55rem' src='https://rfig.enekogarrido.com/resources/img/cercanias.svg' alt='Logo Renfe Cercanías. Esta estación dispone de servicios de Cercanías.' /> <img height='55rem' src='https://rfig.enekogarrido.com/resources/img/feve.svg' alt='Logo Renfe Feve. Esta estación dispone de servicios de Feve.' /></div>";
}
if (val.FEVE == "NO" && val.CERCANIAS == "NO") {
output +=
"<div><p>No dispone de Cercanías ni FEVE</p></div>";
}
output += "</div>";
output += "</div>";
output += "</div>";
}
});
output += "</div>";
$("#filter-records").html(output);
}
);
});
});
</script>
</body>
</html>