-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
261 lines (236 loc) · 11.6 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>petlove</title>
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/Footer.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
</head>
<body style="background-color: #c29898;">
<!--navbar inicio-->
<nav class="navbar navbar-expand-lg navbar-primary bg-light ">
<div class="container-fluid">
<a class="navbar-brand mb-0 h1" href="#">
<img src="img\icono.png" alt="Logo" class="logo-image">
</a>
<button class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#mi-menu">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse " id="mi-menu">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
TODAS LAS CATEGORIAS
</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="juguete.html">Juguetes</a></li>
<li><a class="dropdown-item" href="alimento.html">Alimentos</a></li>
<li><a class="dropdown-item" href="#">Ropa</a></li>
<li><a class="dropdown-item" href="#">Higiene</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#">Transportadores</a></li>
</ul>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="carro.html">CARRO</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="registro.html">INICIAR SESION / REGISTRAR</a>
</li>
</li>
</ul>
</div>
</div>
</nav>
<!--navbar fin-->
<!--carousel inicio-->
<div class="container-fluid mt-3">
<div id="carouselExampleInterval" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active" data-bs-interval="10000">
<img src="img/carousel1.jpeg" class="carousel1" style="width: 100%;">
</div>
<div class="carousel-item" data-bs-interval="2000">
<img src="img/carousel2.jpg" class="carousel2" width="100%">
</div>
<div class="carousel-item">
<img src="img/carousel3.jpg" class="carousel3" width="100%">
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleInterval" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleInterval" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
</div>
<!--carousel fin-->
<!--card inicio-->
<div class="container-fluid mt-3">
<div class="row">
<div class="col-md-3">
<div class="card">
<img src="img/juguetes.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Juguetes</h5>
<p class="card-text">Ven y obtén la mejor entretención para tu mascota.</p>
<a href="juguete.html" class="btn btn-warning">Ir</a>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card">
<img src="img/alimentos.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Alimentos</h5>
<p class="card-text">Tenemos las mejores marcas en alimento para el cuidado de tu mascota.</p>
<a href="alimento.html" class="btn btn-warning">Ir</a>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card">
<img src="img/ropa.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Ropa</h5>
<p class="card-text">Obtén el mejor look para lucir a tu mascota.</p>
<a href="#" class="btn btn-warning">Ir</a>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card">
<img src="img/higiene.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Higiene</h5>
<p class="card-text">El cuidado de tu mascota es importante tenemos los mejores productos para la higiene .</p>
<a href="#" class="btn btn-warning">Ir</a>
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid mt-3">
<div class="row">
<div class="col-md-3">
<div class="card">
<img src="img/tramportadorgato.jpg" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">Transportadores</h5>
<p class="card-text">Para estar siempre juntos.</p>
<a href="#" class="btn btn-warning">Ir</a>
</div>
</div>
</div>
</div>
</div>
<!--card fin-->
<!-- Comienzo bloque API -->
<div class="apiStyle">
<div id="mascotasCarousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" id="carousel-inner">
<!-- acá se inyectan los items desde Js -->
</div>
<a class="carousel-control-prev" href="#mascotasCarousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" id="flecha-prev-API" aria-hidden="true"></span>
<span class="sr-only"></span>
</a>
<a class="carousel-control-next" href="#mascotasCarousel" role="button" data-slide="next">
<span class="carousel-control-next-icon" id="flecha-next-API" aria-hidden="true"></span>
<span class="sr-only"></span>
</a>
</div>
<script>
// URL de la API de Huachitos
const apiUrl = "https://huachitos.cl/api/animales";
// Función para obtener los datos de la API y actualizar el carrusel
async function fetchMascotas() {
try {
const response = await fetch(apiUrl);
const result = await response.json();
const data = result.data;
const carouselInner = document.getElementById('carousel-inner');
data.forEach((animal, index) => {
const item = document.createElement('div');
item.className = `carousel-item ${index === 0 ? 'active' : ''}`;
item.innerHTML = `
<div class="carousel-content">
<div class="carousel-caption">
<h5>${animal.nombre}</h5>
<p><strong>Tipo:</strong> ${animal.tipo}</p>
<p><strong>Género:</strong> ${animal.genero}</p>
<p><strong>Descripción Física:</strong> ${animal.desc_fisica}</p>
</div>
<img src="${animal.imagen}" class="d-block" id="img-API" alt="${animal.nombre}">
</div>
`;
carouselInner.appendChild(item);
});
} catch (error) {
console.error('Error fetching the data', error);
}
}
// Llamar a la función para obtener los datos y actualizar el carrusel
fetchMascotas();
</script>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</div>
<!-- fin consumo API -->
<!--inicio footer-->
<footer class="footer">
<div class="container">
<div class="top-section">
<a href="https://www.google.com/" class="logo-link">
<img src="img\icono.png" alt="Logo" class="logo-image">
<span class="company-name">Pet Love</span>
</a>
<div class="icon-links">
<a href="https://www.instagram.com" class="instagram-link" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="2" y="2" width="20" height="20" rx="5" ry="5"></rect>
<path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"></path>
<line x1="17.5" y1="6.5" x2="17.51" y2="6.5"></line>
</svg>
<span>Instagram</span>
</a>
<a href="https://www.facebook.com" class="Facebook-link" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"></path>
</svg>
<span>Facebook</span>
</a>
<a href="mailto:ve.cabezas@duocuc.cl" class="gmail-link" target="_blank"> <!--abre una nueva ventana con aplicacion de gmail si tiene configurada-->
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M22 4H2v16h20V4zM4 8V6l8 5 8-5v2l-8 5-8-5z"></path>
</svg>
<span>Gmail</span>
</a>
</div>
<ul class="navigation">
<li><a href="#">¿Quiénes Somos?</a></li>
<li><a href="#">Política de Privacidad</a></li>
<li><a href="#">Contáctanos</a></li>
</ul>
</div>
<hr class="divider" />
<ul class="navigation">
<div class="Volver3">
<div style="width: 9rem;">
<!-- <a href="#" class="btn btn-primary">Volver Arriba</a> -->
<button id="volver-arriba" onclick="scrollToTop()">Volver Arriba</button>
</div>
</div>
</div>
</footer>
</div>
<!--footer fin-->
<script src="index.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
</body>
</html>