-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
196 lines (183 loc) · 6.06 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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, viewport-fit=cover"
/>
<title>Droid Watches</title>
<meta
name="description"
content="Modern technology on your every day life"
/>
<link href="styles.css" rel="stylesheet" />
<link
href="https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css"
rel="stylesheet"
/>
<link
rel="preload"
as="image"
href="https://cdn.pixabay.com/photo/2022/01/03/21/54/smart-watch-6913690_1280.png"
/>
<link
rel="preload"
as="video"
href="https://assets.mixkit.co/videos/47881/47881-720.mp4"
/>
<link
rel="canonical"
href="https://mixkit.co/free-stock-video/young-fit-man-checking-his-smart-watch-as-he-runs-47881/"
/>
<script>
document.addEventListener("DOMContentLoaded", function () {
const navLinks = document.querySelectorAll("#nav-bar .nav-link");
const sections = document.querySelectorAll("main section");
function updateActiveLink() {
let index = 0;
const fromTop = window.scrollY + 50;
sections.forEach((section, i) => {
if (
section.offsetTop <= fromTop &&
section.offsetTop + section.offsetHeight > fromTop
) {
index = i;
}
});
navLinks.forEach((link) => link.classList.remove("active"));
navLinks[index].classList.add("active");
}
updateActiveLink();
window.addEventListener("scroll", updateActiveLink);
navLinks.forEach((link) => {
link.addEventListener("click", function (event) {
event.preventDefault();
const targetId = this.getAttribute("href").substring(1);
const targetElement = document.getElementById(targetId);
if (targetElement) {
const offset = 100;
const targetPosition =
targetElement.getBoundingClientRect().top +
window.pageYOffset -
offset;
window.scrollTo({
top: targetPosition,
behavior: "smooth",
});
}
});
const icon = link.querySelector("i");
link.addEventListener("mouseenter", () => {
if (icon.classList.contains("bx-food-menu")) {
icon.classList.replace("bx-food-menu", "bxs-food-menu");
} else if (icon.classList.contains("bxs-cart")) {
icon.classList.replace("bxs-cart", "bxs-cart-add");
}
});
link.addEventListener("mouseleave", () => {
if (icon.classList.contains("bxs-food-menu")) {
icon.classList.replace("bxs-food-menu", "bx-food-menu");
} else if (icon.classList.contains("bxs-cart-add")) {
icon.classList.replace("bxs-cart-add", "bxs-cart");
}
});
});
});
</script>
</head>
<body>
<header id="header">
<nav id="nav-bar">
<a id="logo-link" class="nav-link" href="#main-title">
<img
id="header-img"
src="https://cdn.pixabay.com/photo/2022/01/03/21/54/smart-watch-6913690_1280.png"
alt="A smart watch"
/>
<p>Droid<br />Watches</p>
</a>
<span class="link-wrapper">
<a id="features-link" class="nav-link" href="#features">
<i class="bx bx-food-menu"></i>
<p>Features</p>
</a>
<a id="cart-link" class="nav-link" href="#form">
<i class="bx bxs-cart"></i>
<p>Order Now</p>
</a>
</span>
</nav>
</header>
<main>
<section>
<header>
<h1 id="main-title">New Era. New Technologies</h1>
<video
autoplay
loop
muted
id="video"
src="https://assets.mixkit.co/videos/47881/47881-720.mp4"
alt="Young fit man checking his smart watch as he runs on the treadmill"
></video>
<a
id="video-credits"
href="https://mixkit.co/free-stock-video/young-fit-man-checking-his-smart-watch-as-he-runs-47881/"
target="_blank"
>Video By Mixkit</a
>
</header>
<div id="features">
<div class="feature-vital">
<i class="bx bx-stats"></i>
<div class="text-wrapper">
<h3>Smart Vital Track</h3>
<h4>Track your vitals precisely with no effort</h4>
<p>
Sleep cycles, BPM, glucose, fat, even heart attack detection!
</p>
</div>
</div>
<div class="feature-use">
<i class="bx bxs-hand-up"></i>
<div class="text-wrapper">
<h3>Easy Use</h3>
<h4>Easily understandable interface</h4>
<p>
Most of accessibility is built-in with settings to adjust to
your need.
</p>
</div>
</div>
<div class="feature-delivery">
<i class="bx bx-package"></i>
<div class="text-wrapper">
<h3>Fast Delivery</h3>
<h4>Delivery even in weekends*</h4>
<p>30% faster than competition!*</p>
</div>
</div>
</div>
</section>
<h2 class="form-title">Order now!</h2>
<form action="https://www.freecodecamp.com/email-submit" id="form">
<input
required
name="email"
type="email"
id="email"
placeholder="Your email here"
/>
<input id="submit" type="submit" />
</form>
<p class="form-description">
We won't send you newsletters, just your booking.
</p>
</main>
<footer>
<a class="footer-link" href="terms.html">Terms of Use</a>
<a class="footer-link" href="privacy.html">Privacy Policy</a>
</footer>
</body>
</html>