forked from sk66641/Random-Disco-Light-Simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
440 lines (383 loc) · 17.1 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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Random Disco Light Simulator</title>
<link rel="icon" href="assets/images/favicon/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css"
integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<div class="loader">
<div>
<lottie-player src="https://lottie.host/451aadfb-9af8-4298-98be-e9c583f8a72c/jPRsrfR2jf.json"
background="##FFFFFF" speed="1" style="width: 300px; height: 300px" loop autoplay mode="normal">
</lottie-player>
</div>
</div>
<button id="backToTopBtn" title="Back to Top" aria-label="Back to Top"><i class="fas fa-arrow-up"></i></button>
<!-- Generate snowflakes dynamically with JavaScript -->
<div class="snowflakes">
<div id="particles-js"></div>
</div>
<div class="navHeader">
<div class="header-content">
<nav>
<ul class="sidebarOne">
<li class="cross"><i style="cursor: pointer;" class="fa-solid fa-x"></i></li>
<li class="logo"><img src="assets/images/logo/logo..png" alt="Website Logo"></li>
<li><a href="#" id="reload" style="display: none;" aria-label="reload">Reload</a></li>
<li><a href="#" id="addTime" aria-label="Add Time" style="display: none;">Add Time</a></li>
<li><a href="#" id="pauseStartBtn" style="display: none;" aria-label="Pause/Start">Pause</a></li>
<li><a href="#" id="fullscreenBtn" aria-label="Toggle Fullscreen">Fullscreen</a></li>
<li><a href="#" onclick="showAboutPopup()">About</a></li>
<li><a href="#" onclick="showFeaturesPopup()">Features</a></li>
<li><a href="#" id="CommentBtn" aria-label="Toggle Comment Form">Feedback</a></li>
<li> <a href="#">
<select id="musicDropdown" style="display: none;">
<option value="select" disabled selected>Change Music</option>
<option value="none">None</option>
<option value="disco">Disco</option>
<option value="fairies">Fairies</option>
<option value="funky">Funky</option>
<option value="upbeatdisco">upbeatdisco</option>
<option value="vintage">Vintage</option>
<option value="whistle">Whistle</option>
<option value="snare">Snare</option>
</select>
</a>
</li>
</ul>
<ul class="navMain">
<li id="sidebarLines" onclick="toggleSidebar()"><i title="Menu" class="fa-solid fa-bars"></i></li>
</ul>
</nav>
</div>
</div>
<div class="unload">
<div class="container">
<!-- <div class="background">
<div class="shape"></div>
<div class="shape"></div>
</div> -->
<div class="box" id="box">
<h1 id="changingHeading" style="font-family: Arial, sans-serif; font-size: 30px; color: #ffffff;">
Random Disco
<span id="changing"
style="font-family: Arial, sans-serif; font-size: 30px; font-weight: bold; color: #ff7f50;">
Light Simulator
</span>
</h1>
<div>
<!-- <form action="#"> -->
<label id="n" for="color">1. Number of Colors:</label>
<input type="number" min="0" oninput="validity.valid||(value='');" id="color" placeholder="Enter"
aria-label="Number of Colors" required> <!--prevents user from entering value less than 1-->
</div>
<div>
<label for="color1">2. Select your desired start & end colors for the gradient:</label>
<input type="color" id="color1" aria-label="Start Color" />
<label for="color2"></label>
<input type="color" id="color2" aria-label="End Color" />
</div>
<strong>[For Random color spectrum, don't select different colors]</strong>
<div>
<label for="time">3. Time interval
<i>(with which the color changes randomly)</i>:</label><br />
<input type="number" min="0" id="time" placeholder="Enter" aria-label="Time Interval" required />
<!-- <input type="number" min="0" oninput="this.value = Math.abs(this.value) >= 0 ? Math.abs(this.value) : null"
id="time" placeholder="Enter" aria-label="Time Interval" required /> -->
<select id="unit" aria-label="Time Interval Unit">
<option value="unit" disabled selected>Select Unit</option>
<option value="milliseconds">Milliseconds</option>
<option value="seconds">Seconds</option>
</select>
</div>
<strong>[Negative interval or No input will be treated as 0 interval]</strong>
<div>
<label for="view">4. View:</label>
<select id="view" aria-label="Select View">
<option style="background-color: lightslategray; color: white" value="select" disabled selected>
Select
</option>
<option value="conic">Conic</option>
<option value="linear">Linear</option>
<option value="radial">Radial</option>
<option value="custom">Custom Pattern</option>
</select>
</div>
<div>
<label for="countdown">5. Countdown Timer (in seconds):</label>
<input type="number" min="0" oninput="validity.valid||(value='');" id="countdown" aria-label="Countdown Timer"
placeholder="Enter time in seconds" required />
</div>
<div>
<label for="sound">6. Select Music:</label>
<select id="sound" value="select" aria-label="Sound Effect">
<option value="none">None</option>
<option value="disco">Disco</option>
<option value="fairies">Fairies</option>
<option value="funky">Funky</option>
<option value="upbeatdisco">Upbeatdisco</option>
<option value="vintage">Vintage</option>
<option value="whistle">Whistle</option>
<option value="snare">Snare</option>
</select>
<span style="font-size: 24px; color: #f09819;">or</span>
<input type="url" id="music-url" placeholder="Paste link here" /><br>
<span style="font-size: 24px; color: #f09819;">or</span>
<input type="file" id="music-file" accept="audio/*" class="file-input" />
</div>
<div id="error" aria-live="polite"></div>
<div style="display: flex; justify-content: center; align-items: center;">
<div id="randomize" aria-label="Randomize">
<a href="#">
<span></span>
<span></span>
<span></span>
<span></span>
Randomize
</a>
</div>
</div>
<div class="button">
<div id="submit" aria-label="Submit"><a href="#">
<span></span>
<span></span>
<span></span>
<span></span>
Submit
</a></div>
<div id="reset" aria-label="Reset"><a href="#">
<span></span>
<span></span>
<span></span>
<span></span>
Reset
</a></div>
</div>
<div id="preset">
<button id="savePresetButton">Save Preset</button> <!-- new function for loading preset -->
<button id="loadPresetButton">Load Preset</button>
</div>
</div>
</div>
<footer class="footer" style="width: 100%;height: 2px;">
<div class="socialIcons">
<span class="icons">
<a href="" aria-label="Linkedin" title="linkedin"><i class="fab fa-linkedin ico"></i></a>
</span>
<span class="icons">
<a href="" aria-label="Instagram" title="instagram"><i class="fa-brands fa-instagram ico"></i></a>
</span>
<span class="icons">
<a href="https://github.com/sk66641/Random-Disco-Light-Simulator" title="github">
<i class="fab fa-github ico"></i>
</a>
</span>
<span class="icons">
<a href="" aria-label="X" title="Twitter"><i class="fa-brands fa-x-twitter ico"></i></a>
</span>
<span class="icons">
<a href="" aria-label="Discord" title="discord"><i class="fa-brands fa-discord ico"></i></a>
</span>
</div>
<div class="copyright">
<p class="copyright" style="text-align: center">
©
<script>document.write(new Date().getFullYear())</script> Random-Disco-Light-Simulator. All rights reserved.
</p>
</div>
</footer>
<div id="timerDisplay" aria-label="Timer Display" style="display: none"></div>
<audio id="disco" src="assets/audios/disco.mp3"></audio>
<audio id="fairies" src="assets/audios/fairies.mp3"></audio>
<audio id="funky" src="assets/audios/funkydisco.mp3"></audio>
<audio id="upbeatdisco" src="assets/audios/upbeatdisco.mp3"></audio>
<audio id="upbeatdisco" src="assets/audios/upbeatdisco.mp3"></audio>
<audio id="snare" src="assets/audios/Snare.mp3"></audio>
<audio id="vintage" src="assets/audios/vintage.mp3"></audio>
<audio id="whistle" src="assets/audios/whistle.mp3"></audio>
<!-- <div id="message" aria-live="polite">The timer has ended. The page will reload.</div> -->
<label id="themeChangeToggle" class="theme-toggle" for="themeToggle" style="position: fixed;
top: 30px;
right: 30px;
z-index: 100;
display: flex;
align-items: center;
border: none;
background-color: transparent;">
<input type="checkbox" id="themeToggle" onclick="toggleTheme()" checked aria-label="Switch theme mode">
<span class="slider" style="width: 40px; height: 20px;"></span>
</label>
<!-- Comment form -->
<!-- Modal background -->
<div id="modalBackground">
<!-- Comment form -->
<div id="commentForm">
<form id="feedback-form">
<label for="userComment" style="text-align: center; color:rgb(95, 104, 104)"> Feedback Form</label>
<div class="form-group">
<div class="icon">
<i class="fas fa-user" style="color: #7a7a73;"> n a m e</i>
</div>
<input type="text" id="name" onfocus="changeColor()" placeholder="Your Name" name="name" required>
</div>
<div class="form-group">
<div class="icon">
<i class="fas fa-envelope" style="color: #7a7a73;"> m a i l</i>
</div>
<input type="email" id="email" onfocus="changeColor()" placeholder="Email Id" required>
</div>
<div class="form-group">
<div class="icon">
<i class="fa-solid fa-comment" style="color:#7a7a73;"> f e e d b a c k</i>
</div>
<textarea cols="30" rows="5" placeholder="Your Feedback" required></textarea>
</div>
<div class="rating">
<input type="radio" id="star5" name="rating" value="5" />
<label for="star5">5 stars</label>
<input type="radio" id="star4" name="rating" value="4" />
<label for="star4">4 stars</label>
<input type="radio" id="star3" name="rating" value="3" />
<label for="star3">3 stars</label>
<input type="radio" id="star2" name="rating" value="2" />
<label for="star2">2 stars</label>
<input type="radio" id="star1" name="rating" value="1" />
<label for="star1">1 star</label>
</div>
<button id="ll">Submit</button>
</form>
<div id="successMessage" class="success-message">Your feedback is submitted successfully</div>
</div>
</div>
<script>
document.getElementById("CommentBtn").addEventListener("click", function () {
document.getElementById("modalBackground").style.display = "flex";
});
document.getElementById("modalBackground").addEventListener("click", function (event) {
if (event.target === this) {
this.style.display = "none";
}
});
document.getElementById("feedback-form").addEventListener("submit", function (event) {
event.preventDefault(); // Prevent form submission
// Show success message
document.getElementById("successMessage").style.display = "block";
// Hide success message after 3 seconds (3000 milliseconds)
setTimeout(function () {
document.getElementById("successMessage").style.display = "none";
}, 3000);
document.getElementById("feedback-form").reset();
});
</script>
<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<script src="background.js"></script>
<script src="script.js"></script>
<div id="warningModal" class="modal">
<div class="modal-content">
<span class="close" id="closeModal">×</span>
<h2>Warning: Sensitivity to Flashing Lights</h2>
<p>
This site contains flashing lights that may cause discomfort or
trigger seizures for people with photosensitive epilepsy. Viewer
discretion is advised.
</p>
<button id="proceed" aria-label="Proceed">Proceed</button>
</div>
</div>
</div>
<div id="infomodal" class="modal">
<div class="modal-content">
<span class="close" id="closeModal1">×</span>
<h2>Important!!</h2>
<p>
Click the menu icon to enable various functions:
</p>
<p>Reload:Refreshes the page.</p>
<p>Pause:Pauses the current activity.</p>
<p>Fullscreen:Toggles fullscreen mode.</p>
<p>Change Music:Allows you to change the background music.</p>
<button id="proceed1" aria-label="Proceed">Proceed</button>
</div>
</div>
<div id="replayModel" class="modal">
<div class="modal-content">
<h2>Wanna replay the disco..?</h2>
<p>
Press Yes to replay... Press No to Exit
</p>
<button id="replayModelBtn">Yes</button>
<button id="exitBtn">No</button>
</div>
</div>
<div id="aboutPopup" class="popup">
<div class="popup-content">
<span class="close" onclick="closeAboutPopup()" aria-label="Close">×</span>
<h2><strong class="nameAbout">About</strong></h2>
<p>
<strong>The Random Disco Light Simulator</strong> is a fun and interactive project that
brings the excitement of a disco dance floor to your screen whether
you're a developer, a party enthusiast, or just curious.
</p>
<p>
<strong>Inputs:</strong>
- How many random colors you want to be shown?
<br />
- With how much time interval (in milliseconds) you want to change the
colors randomly?
<br />
- What type of view you want to choose (conic, linear, or radial)?
<br />
- Countdown timer (in seconds)
<br />
- Sound Effect
</p>
<p>
<strong> Output:</strong>
On the basis of these inputs, it simulates the selected view.
</p>
<p>Try these inputs and have fun! 😄</p>
<p>1000 1 milliseconds conic 60</p>
<p>1000 1 milliseconds radial 60</p>
<p>1000 1 milliseconds linear 60</p>
</div>
</div>
<div id="featuresPopup" class="popup">
<div class="popup-content">
<span class="close" onclick="closeFeaturesPopup()" aria-label="Close">×</span>
<h2>Features</h2>
<h1>Conic Mode</h1>
<p>
Imagine a spotlight sweeping across the room, creating vibrant cones
of light. The colors change dynamically as the spotlight moves, adding
an electrifying effect.
</p>
<img src="assets/images/learn/Conic_1.jpg" alt="Conic Mode Example 1" style="width: 180px; height: 180px">
<img src="assets/images/learn/Conic_2.jpg" alt="Conic Mode Example 2" style="width: 180px; height: 180px;">
<h1>Radial Mode</h1>
<p>
Picture a pulsating ring of light expanding and contracting. The
radial pattern syncs perfectly with the beat, making you feel the
rhythm.
</p>
<img src="assets/images/learn/Radial_01.jpg" alt="Radial Mode Example 1" style="width:180px; height: 180px;">
<img src="assets/images/learn/Radial_02.jpg" alt="Radial Mode Example 2" style="width:180px; height: 180px;">
<h1>Linear Mode</h1>
<p>
Visualize colorful streaks of light moving in straight lines. These
streaks crisscross, intersect, and dance across the floor,
transforming your space into a dynamic disco.
</p>
<img src="assets/images/learn/Linear_01.jpg" alt="Linear Mode Example 1" style="width:180px; height: 180px;">
<img src="assets/images/learn/Linear_02.jpg" alt="Linear Mode Example 2" style="width:180px; height: 180px;">
</div>
</div>
<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
</body>
</html>