-
Notifications
You must be signed in to change notification settings - Fork 0
/
slideshow.html
83 lines (77 loc) · 2.13 KB
/
slideshow.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
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Slideshow</title>
<style>
:root{
--n-elem-slide: 5;
--time-elem-slide: 4s;
}
:root *, :root *::before, :root *::after {
padding: 0;
margin: 0;
box-sizing: border-box;
}
.slideshow{
width: 98vw;
overflow: hidden;
margin-left: auto;
margin-right: auto;
}
.slide-container{
list-style: none;
width: calc(var(--n-elem-slide)*100%);
height: 500px;
display: flex;
animation: cambio calc(var(--n-elem-slide)*var(--time-elem-slide)) infinite;
}
.slide-item, .slide-img{
width: 100%;
height: 100%;
}
@keyframes cambio {
0% {
margin-left: 0;
}
20% {
margin-left: 0;
}
25% {
margin-left: -100%;
}
45% {
margin-left: -100%;
}
50% {
margin-left: -200%;
}
70% {
margin-left: -200%
}
75% {
margin-left: -300%;
}
95% {
margin-left: -300%;
}
100%{
margin-left: -400%;
}
}
</style>
</head>
<body>
<div class="slideshow">
<ul class="slide-container">
<li class="slide-item"><img class="slide-img" src="01.jpg" alt=""></li>
<li class="slide-item"><img class="slide-img" src="02.jpg" alt=""></li>
<li class="slide-item"><img class="slide-img" src="03.jpg" alt=""></li>
<li class="slide-item"><img class="slide-img" src="04.jpg" alt=""></li>
<li class="slide-item"><img class="slide-img" src="01.jpg" alt=""></li>
</ul>
</div>
</body>
</html>