-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
81 lines (69 loc) · 2.17 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>Page Design</title>
</head>
<body>
<div id= "hero">
<div class="navbar">
<img src="Radiance_img/logo.png" class="logo">
<div class="user">
<button type="button">Explore</button>
<img src="Radiance_img/miro (1).png" >
</div>
</div>
<div class="container">
<div class="info">
<h1>DESCUBRA</h1>
<p>Encontre o lugar dos seus sonhos e desbrave o mundo. </p>
<input type="text" placeholder="search">
</div>
</div>
<div class="slider">
<img src="Radiance_img/left-arrow.png" id="prev">
<div class="preview">
<img src="Radiance_img/small1.png" class="active thumbnail">
<img src="Radiance_img/small2.png" class="thumbnail">
<img src="Radiance_img/small3.png" class="thumbnail">
<img src="Radiance_img/small4.png" class="thumbnail">
<img src="Radiance_img/small5.png" class="thumbnail">
</div>
<img src="Radiance_img/right-arrow.png" id="next">
</div>
</div>
<script>
var prev= document.getElementById("prev");
var next= document.getElementById("next");
var thumbnail= document.getElementsByClassName("thumbnail");
var hero = document.getElementById("hero");
var backgroundImg= new Array(
"Radiance_img/bg1.png",
"Radiance_img/bg2.png",
"Radiance_img/bg3.png",
"Radiance_img/bg4.png",
"Radiance_img/bg5.png",
);
let i = 0;
next.onclick= function(){
if(i<4){
hero.style.backgroundImage=
'url("'+backgroundImg[i+1]+'")';
thumbnail[i+1].classList.add("active");
thumbnail[i].classList.remove("active");
i++;
}
}
prev.onclick= function(){
if(i>0){
hero.style.backgroundImage=
'url("'+backgroundImg[i-1]+'")';
thumbnail[i-1].classList.add("active");
thumbnail[i].classList.remove("active");
i--;
}
}
</script>
</body>
</html>