-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
234 lines (216 loc) · 12 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
<!DOCTYPE html>
<html id="html" lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<link rel="stylesheet" href="styles/variables.css">
<link rel="stylesheet" href="styles/menu.css">
<link rel="stylesheet" href="styles/sections.css">
<link rel="stylesheet" href="styles/scrollTop.css">
<link rel="stylesheet" href="styles/keyboard.css">
<link rel="stylesheet" href="styles/filter.css">
<link rel="stylesheet" href="styles/slider.css">
<link rel="stylesheet" href="styles/contactForm.css">
<title>DOM exercises</title>
</head>
<body id="body" class="body" data-dark>
<header id="header">
<h1 id="h1">DOM exercises</h1>
<div id="iconsHeader">
<i class="fa-solid fa-signal">
<i class="fa-soild fa-times"></i>
</i>
<i class="darkmodeIcon fa-solid fa-moon"></i>
<i id="hamburgerBtn" class="fa-solid fa-bars"></i>
</div>
</header>
<i id="scrollTop" class="button fa-solid fa-chevron-up"></i>
<aside>
<nav id="mobileMenu">
<a href="#digitalClock" class="mobileItem" data-scrollSpy>Digital clock</a>
<a href="#keyboardEvents" class="mobileItem" data-scrollSpy>Keyboard events</a>
<a href="#countdown" class="mobileItem" data-scrollSpy>Countdown</a>
<a href="#loadResponsive" class="mobileItem" data-scrollSpy>Load responsive</a>
<a href="#windowTester" class="mobileItem" data-scrollSpy>Window tester</a>
<a href="#deviceDetection" class="mobileItem" data-scrollSpy>Device detection</a>
<a href="#geolocation" class="mobileItem" data-scrollSpy>Geolocation</a>
<a href="#filter" class="mobileItem" data-scrollSpy>Filter </a>
<a href="#slider" class="mobileItem" data-scrollSpy>Slider</a>
<a href="#visibilityChange" class="mobileItem" data-scrollSpy>Visibility change</a>
<a href="#contactForm" class="mobileItem" data-scrollSpy>Contact form</a>
</nav>
</aside>
<div id="desktopMenu">
<a href="#digitalClock" class="desktopItem" data-scrollSpyDesktop>Digital clock</a>
<a href="#keyboardEvents" class="desktopItem" data-scrollSpyDesktop>Keyboard events</a>
<a href="#countdown" class="desktopItem" data-scrollSpyDesktop>Countdown to new year</a>
<a href="#loadResponsive" class="desktopItem" data-scrollSpyDesktop>Load responsive</a>
<a href="#windowTester" class="desktopItem" data-scrollSpyDesktop>Window tester</a>
<a href="#deviceDetection" class="desktopItem" data-scrollSpyDesktop>Device detection</a>
<a href="#geolocation" class="desktopItem" data-scrollSpyDesktop>Geolocation</a>
<a href="#filter" class="desktopItem" data-scrollSpyDesktop>Filter </a>
<a href="#slider" class="desktopItem" data-scrollSpyDesktop>Slider</a>
<a href="#visibilityChange" class="desktopItem" data-scrollSpyDesktop>Visibility change</a>
<a href="#contactForm" class="desktopItem" data-scrollSpyDesktop>Contact form</a>
</div>
<main>
<!-- digital clock and alarm -->
<section id="digitalClock" class="section" data-scrollSpy>
<h2>Digital clock and alarm</h2>
<span class="span" >Stamps the current hour with a ticky sound</span>
<p id="clock">00:00:00</p>
<button id="clockBtn" class="button">Start clock</button>
</section>
<!-- keyboard events -->
<section id="keyboardEvents" class="section" data-scrollSpy>
<h2>Keyboard events</h2>
<span class="span">Press alt+a to send an alert<br>Move the dot with WASD</span>
<div id="box">
<div id="dot"></div>
</div>
</section>
<!-- countdown for new year -->
<section id="countdown" class="section" data-scrollSpy>
<h2>Countdown</h2>
<span class="span">Stamps the time to the new year</span>
<p id="countdownStamp"></p>
</section>
<!-- responsive elements -->
<section id="loadResponsive" class="section" data-scrollSpy>
<h2>Load responsive</h2>
<span class="span">Shows the media elements if you are in desktop else just show the links</span>
<div id="video"></div>
<div id="map"></div>
</section>
<!-- responsive tester with open() -->
<section id="windowTester" class="section" data-scrollSpy>
<h2>Window tester</h2>
<span class="span">Asks an url to open a window with the sizes you specify</span>
<div>
<form id="responsivetesterForm" class="windowTesterForm">
<input class="input" name="url" type="url" placeholder="Url" required>
<input class="input" name="width" type="text" placeholder="Width" required>
<input class="input" name="height" type="text" placeholder="Height" required>
<input class="button" name='test' type="submit" value="Open">
<input class="button" name='close' type="button" value="Close">
</form>
</div>
</section>
<!-- devices detection -->
<section id="deviceDetection" class="section" data-scrollSpy>
<h2>Device detection</h2>
<span class="span">Detects what browser you are using and some information about it</span>
<p id="userAgent"></p>
</section>
<!-- geolocation -->
<section id="geolocation" class="section" data-scrollSpy>
<h2>Geolocation</h2>
<span class="span">Sends you to google maps with your current geolocation, not so accurate</span>
<p id="position"></p>
</section>
<!-- filter -->
<section id="filter" class="section" data-scrollSpy>
<h2>Filter</h2>
<span class="span">Input a text to filter on the images</span>
<input class="input" id="searchFilter" type="search" placeholder="search...">
<div class="cards">
<figure class="card">
<img class="imgFilter" src="images/kimetsu-no-yaiba/Shinobu_Anime_Profile.webp" width="300px" height="100px" alt="Shinobu Kocho face">
<figcaption class="figcaption">Shinobu Kocho</figcaption>
</figure>
<figure class="card">
<img class="imgFilter" src="images/kimetsu-no-yaiba/Muichiro_Anime_Profile.webp" width="300px" height="100px" alt="Muichiro Tokito face">
<figcaption class="figcaption">Muichiro Tokito</figcaption>
</figure>
<figure class="card">
<img class="imgFilter" src="images/kimetsu-no-yaiba/Mitsuri_Anime_Profile.webp" width="300px" height="100px" alt="Mitsuri Kanroji face">
<figcaption class="figcaption">Mitsuri Kanroji</figcaption>
</figure>
<figure class="card">
<img class="imgFilter" src="images/kimetsu-no-yaiba/Obanai_Anime_Profile.webp" width="300px" height="100px" alt="Obanai Iguro face">
<figcaption class="figcaption">Obanai Iguro</figcaption>
</figure>
<figure class="card">
<img class="imgFilter" src="images/kimetsu-no-yaiba/Tengen_Anime_Profile.webp" width="300px" height="100px" alt="Tengen Uzui face">
<figcaption class="figcaption">Tengen Uzui</figcaption>
</figure>
<figure class="card">
<img class="imgFilter" src="images/kimetsu-no-yaiba/Kanae_Anime_Profile.webp" width="300px" height="100px" alt="Kanea Kocho face">
<figcaption class="figcaption">Kanae Kocho</figcaption>
</figure>
<figure class="card">
<img class="imgFilter" src="images/kimetsu-no-yaiba/Kyojuro_Anime_Profile.webp" width="300px" height="100px" alt="Kyojuro Rengoku face">
<figcaption class="figcaption">Kyojuro Rengoku</figcaption>
</figure>
<figure class="card">
<img class="imgFilter" src="images/kimetsu-no-yaiba/Gyomei_Anime_Profile.webp" width="300px" height="100px" alt="Gyomei Himejima face">
<figcaption class="figcaption">Gyomei Himejima</figcaption>
</figure>
<figure class="card">
<img class="imgFilter" src="images/kimetsu-no-yaiba/Sakonji_Anime_Profile.webp" width="300px" height="100px" alt="Sakonji Urokodaki face">
<figcaption class="figcaption">Sakonji Urokodaki</figcaption>
</figure>
<figure class="card">
<img class="imgFilter" src="images/kimetsu-no-yaiba/Jigoro_Anime_Profile.webp" width="300px" height="100px" alt="Jigoro Kuwajima face">
<figcaption class="figcaption">Jigoro Kuwajima</figcaption>
</figure>
<figure class="card">
<img class="imgFilter" src="images/kimetsu-no-yaiba/Giyu_Anime_Profile.webp" width="300px" height="100px" alt="Giyu Tomioka face">
<figcaption class="figcaption">Giyu Tomioka</figcaption>
</figure>
<figure class="card">
<img class="imgFilter" src="images/kimetsu-no-yaiba/Sanemi_Anime_Profile.webp" width="300px" height="100px" alt="Sanemi Shinazugawa face">
<figcaption class="figcaption">Sanemi Shinazugawa</figcaption>
</figure>
</div>
</section>
<!-- responsive slider -->
<section id="slider" class="section" data-scrollSpy>
<h2>Slider</h2>
<span class="span">A slider with responsive images</span>
<div class="wrapper">
<div id="wrap">
<img class="imgSlider" src="images/final-fantasy/final-fantasy-7.webp" width="800" height="500" alt="final fantasy 7 characters cartoon style">
<img class="imgSlider" src="images/final-fantasy/final-fantasy-8.webp" width="800" height="500" alt="final fantasy 8 characters cartoon style">
<img class="imgSlider" src="images/final-fantasy/final-fantasy-9.webp" width="800" height="500" alt="final fantasy 9 characters cartoon style">
<img class="imgSlider" src="images/final-fantasy/final-fantasy-10.webp" width="800" height="500" alt="final fantasy 10 character cartoon style">
<img class="imgSlider" src="images/final-fantasy/final-fantasy-12.webp" width="800" height="500" alt="final fantasy 12 characters cartoon style">
</div>
<span id="arrowLeft" class="button arrow left"><</span>
<span id="arrowRight" class="button arrow right">></span>
</div>
</section>
<!-- visibility change API -->
<section id="visibilityChange" class="section" data-scrollSpy>
<h2>Visibility Change</h2>
<span class="span">Loads the video if you are in this section and stops if you are in another</span>
<video id="videoVisibilityChange" data-scrollVisibilityChange src="videos/video-visibility-change-zoe-luna.mp4" width="800" controls muted></video>
</section>
<!-- contact form -->
<section id="contactForm" class="section" data-scrollSpy>
<h2>Contact form</h2>
<span class="span">A form with some regex validation, it actually sends me an email</span>
<form class="contactForm" action="https://formsubmit.co/domexercisesale@gmail.com" method="POST" target="_blank">
<span class="legend">Send your comments</span>
<input class="input inputForm name" name="name" type="text" placeholder="Name" pattern="^[A-Za-zÑñÁáÉéÍíÓóÚúÜü\s]+$"
title="Only letters and white spaces" required>
<input class="input inputForm email" name="email" type="email" placeholder="Email"
pattern="^[a-z0-9]+(\.[_a-z0-9]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$"
title="Enter a valid format: your@email.com" required>
<input class="input inputForm matter" name="matter" type="text" placeholder="Matter" pattern="^.{1,50}$"
title="Maximun 50 characters" required>
<textarea class="input inputForm textarea comments" name="comments" placeholder="Comments" cols="20" rows="10"
data-pattern="^.{1,255}$" title="Maximun 255 characters" required></textarea>
<input class="submitBtnForm button" type="submit" value="Sent">
</form>
</section>
</main>
<!-- scripts js -->
<script src="https://kit.fontawesome.com/7f3051e63a.js" crossorigin="anonymous"></script>
<script src="js/index.js" type="module"></script>
</body>
</html>