Skip to content

Commit

Permalink
format documents
Browse files Browse the repository at this point in the history
  • Loading branch information
sk66641 committed Jun 3, 2024
1 parent ed54af3 commit 6d6d017
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 37 deletions.
66 changes: 39 additions & 27 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,62 +18,63 @@
<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>

background="##FFFFFF" speed="1" style="width: 300px; height: 300px" loop autoplay mode="normal">
</lottie-player>
</div>

</div>

<!-- Generate snowflakes dynamically with JavaScript -->
<div class="snowflakes">
<div id="particles-js"></div>
<!-- Generate snowflakes dynamically with JavaScript -->
</div>
<div class="unload">

<div class="unload">
<div class="container">

<div class="background">
<div class="shape"></div>
<div class="shape"></div>
</div>

<div class="box">

<h1 id="changingHeading" style="font-family: Arial, sans-serif; font-size: 39px; color: #ffffff;">
Random Disco
<span id="changing"
style="font-family: Arial, sans-serif; font-size: 39px; font-weight: bold; color: #ff7f50;">
Light Simulator
</span>
</h1>

<header>
<div class="header-content">
<nav>
<ul>
<li><a href="#about" onclick="showAboutPopup()">About</a></li>
<li>
<a href="#features" onclick="showFeaturesPopup()">Features</a>
</li>
<li>
<a href="#lightmode" onclick="lightMode()" id="lightbtn">LightMode</a>
</li>

<li>
<a href="#darkmode" onclick="darkMode()" id="darkbtn">Darkmode</a>
</li>
<li><a href="#features" onclick="showFeaturesPopup()">Features</a></li>
<li><a href="#lightmode" onclick="lightMode()" id="lightbtn">LightMode</a></li>
<li><a href="#darkmode" onclick="darkMode()" id="darkbtn">Darkmode</a></li>
</ul>
</nav>
</div>
</header>

<div>
<form action="#">
<label 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-->
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 />
Expand All @@ -85,25 +86,28 @@ <h1 id="changingHeading" style="font-family: Arial, sans-serif; font-size: 39px;
<option value="seconds">seconds</option>
</select>
</div>

<strong>[Without input, it 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="" 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. Sound Effect:</label>
<select id="sound" value="select" aria-label="Sound Effect">
Expand All @@ -117,21 +121,27 @@ <h1 id="changingHeading" style="font-family: Arial, sans-serif; font-size: 39px;
<option value="snare">Snare</option>
</select>
</div>

<button id="randomize" aria-label="Randomize">Randomize</button>

<div class="button">
<button id="submit" aria-label="Submit">Submit</button>

<a href="https://github.com/sk66641/Random-Disco-Light-Simulator" target="_blank"
aria-label="GitHub Repository">
<svg fill="#fff" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512">
<path
d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3 .3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5 .3-6.2 2.3zm44.2-1.7c-2.9 .7-4.9 2.6-4.6 4.9 .3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3 .7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3 .3 2.9 2.3 3.9 1.6 1 3.6 .7 4.3-.7 .7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3 .7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3 .7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z" />
</svg>
</a>

<button id="reset" aria-label="Reset">Reset</button>
</div>

<div id="error" aria-live="polite"></div>
</div>
</div>

<footer class="footer" style="width: 100%;height: 2px;">
<div class="footerContainer">
<div class="socialIcons">
Expand All @@ -144,6 +154,7 @@ <h1 id="changingHeading" style="font-family: Arial, sans-serif; font-size: 39px;
</div>
<div class="copyright">&copy;2024 Random-Disco-Light-Simulator. All rights reserved.</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>
Expand All @@ -167,6 +178,7 @@ <h1 id="changingHeading" style="font-family: Arial, sans-serif; font-size: 39px;
<option value="snare">Snare</option>
</select>
</div>

<div id="message" aria-live="polite">The timer has ended. The page will reload.</div>

<button id="fullscreenBtn" aria-label="Toggle Fullscreen">Fullscreen</button>
Expand Down Expand Up @@ -214,17 +226,17 @@ <h2>Warning: Sensitivity to Flashing Lights</h2>
<button id="proceed" aria-label="Proceed">Proceed</button>
</div>
</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 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>
<div id="aboutPopup" class="popup">
<div class="popup-content">
<span class="close" onclick="closeAboutPopup()" aria-label="Close">&times;</span>
Expand Down
17 changes: 7 additions & 10 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

document.addEventListener('DOMContentLoaded', () => {
const submitButton = document.getElementById('submit');
const resetButton = document.getElementById('reset');
Expand All @@ -8,7 +7,7 @@ document.addEventListener('DOMContentLoaded', () => {
let timerInterval;
let musicAudio;

submitButton.addEventListener('click', ()=>{
submitButton.addEventListener('click', () => {
alert("Double click on the screen to reload!");
run()
});
Expand Down Expand Up @@ -42,15 +41,15 @@ document.addEventListener('DOMContentLoaded', () => {
function stopSimulation() {
// const messageDiv = document.getElementById('message');
// messageDiv.style.display = 'block';
const replayModelEl=document.getElementById('replayModel')
replayModelEl.style.display='block'
const replayModelEl = document.getElementById('replayModel')
replayModelEl.style.display = 'block'
}
document.getElementById('replayModelBtn').addEventListener('click',function(){
const replayModelEl=document.getElementById('replayModel')
replayModelEl.style.display='none'
document.getElementById('replayModelBtn').addEventListener('click', function () {
const replayModelEl = document.getElementById('replayModel')
replayModelEl.style.display = 'none'
run()
})
document.getElementById('exitBtn').addEventListener('click',function(){
document.getElementById('exitBtn').addEventListener('click', function () {
window.location.reload()
run()
})
Expand Down Expand Up @@ -97,8 +96,6 @@ document.addEventListener('DOMContentLoaded', () => {
}
}



function startSimulation(n, set_time, unit, view, color1, color2) {
const rgbColor1 = hexToRgb(color1);
const rgbColor2 = hexToRgb(color2);
Expand Down

0 comments on commit 6d6d017

Please sign in to comment.