From c5b4d5c3e08b6fb367ceaea04225dd94be312245 Mon Sep 17 00:00:00 2001 From: Swapnil Srivastava <142904704+Swapnilden@users.noreply.github.com> Date: Sun, 28 Jul 2024 23:24:12 +0530 Subject: [PATCH 01/12] Update script1.js --- Login/script1.js | 117 ++++++++++++++++++++++++++--------------------- 1 file changed, 64 insertions(+), 53 deletions(-) diff --git a/Login/script1.js b/Login/script1.js index 3c3983a..6ebf6a2 100644 --- a/Login/script1.js +++ b/Login/script1.js @@ -2,7 +2,7 @@ document.addEventListener('DOMContentLoaded', function() { const container = document.getElementById('container'); const registerBtn = document.getElementById('register'); const loginBtn = document.getElementById('login'); - + const createPasswordInput = document.getElementById('passwordSignUp'); const confirmPasswordInput = document.getElementById('confirmPasswordSignUp'); const createPasswordToggle = document.querySelector('.password-toggle[data-target="passwordSignUp"]'); @@ -11,73 +11,84 @@ document.addEventListener('DOMContentLoaded', function() { const signInPasswordInput = document.getElementById('passwordSignIn'); const signInPasswordToggle = document.getElementById('togglePasswordSignIn'); - registerBtn.addEventListener('click', () => { - container.classList.add("active"); - }); + if (registerBtn) { + registerBtn.addEventListener('click', () => { + container.classList.add("active"); + }); + } - loginBtn.addEventListener('click', () => { - container.classList.remove("active"); - }); + if (loginBtn) { + loginBtn.addEventListener('click', () => { + container.classList.remove("active"); + }); + } // Function to toggle password visibility for Create Account function togglePasswordVisibility(input, toggle) { - const type = input.getAttribute('type') === 'password' ? 'text' : 'password'; - input.setAttribute('type', type); + if (input && toggle) { + const type = input.getAttribute('type') === 'password' ? 'text' : 'password'; + input.setAttribute('type', type); - // Toggle eye icon class - if (type === 'password') { - toggle.querySelector('i').classList.remove('fa-eye-slash'); - toggle.querySelector('i').classList.add('fa-eye'); - } else { - toggle.querySelector('i').classList.remove('fa-eye'); - toggle.querySelector('i').classList.add('fa-eye-slash'); + const icon = toggle.querySelector('i'); + if (icon) { + icon.classList.toggle('fa-eye'); + icon.classList.toggle('fa-eye-slash'); + } } } - // Event listener for Create Account password toggle button - createPasswordToggle.addEventListener('click', function(event) { - event.preventDefault(); - togglePasswordVisibility(createPasswordInput, createPasswordToggle); - }); - - // Event listener for Confirm Password toggle button - confirmPasswordToggle.addEventListener('click', function(event) { - event.preventDefault(); - togglePasswordVisibility(confirmPasswordInput, confirmPasswordToggle); - }); + // Event listeners for password toggle buttons + if (createPasswordToggle) { + createPasswordToggle.addEventListener('click', function(event) { + event.preventDefault(); + togglePasswordVisibility(createPasswordInput, createPasswordToggle); + }); + } - // Event listener for Sign In password toggle button - signInPasswordToggle.addEventListener('click', function(event) { - event.preventDefault(); - togglePasswordVisibility(signInPasswordInput, signInPasswordToggle); - }); + if (confirmPasswordToggle) { + confirmPasswordToggle.addEventListener('click', function(event) { + event.preventDefault(); + togglePasswordVisibility(confirmPasswordInput, confirmPasswordToggle); + }); + } + if (signInPasswordToggle) { + signInPasswordToggle.addEventListener('click', function(event) { + event.preventDefault(); + togglePasswordVisibility(signInPasswordInput, signInPasswordToggle); + }); + } const signInForm = document.querySelector('.form-container.sign-in form'); - signInForm.addEventListener('submit', function(event) { - const email = signInForm.querySelector('input[type="email"]').value; - const password = signInForm.querySelector('input[type="password"]').value; + if (signInForm) { + signInForm.addEventListener('submit', function(event) { + const email = signInForm.querySelector('input[type="email"]').value; + const password = signInForm.querySelector('input[type="password"]').value; - if (!email || !password) { - event.preventDefault(); - alert('Required fields were not filled.'); - } - }); + if (!email || !password) { + event.preventDefault(); + alert('Required fields were not filled.'); + } + }); + } const signUpForm = document.querySelector('.form-container.sign-up form'); - signUpForm.addEventListener('submit', function(event) { - const name = signUpForm.querySelector('input[type="text"]').value; - const email = signUpForm.querySelector('input[type="email"]').value; - const password = signUpForm.querySelector('#passwordSignUp').value; - const confirmPassword = signUpForm.querySelector('#confirmPasswordSignUp').value; - if (password !== confirmPassword) { - event.preventDefault(); - alert('Passwords do not match!'); - } else if (!name || !email || !password || !confirmPassword) { - event.preventDefault(); - alert('Required fields were not filled.'); - } - }); + if (signUpForm) { + signUpForm.addEventListener('submit', function(event) { + const name = signUpForm.querySelector('input[type="text"]').value; + const email = signUpForm.querySelector('input[type="email"]').value; + const password = signUpForm.querySelector('#passwordSignUp').value; + const confirmPassword = signUpForm.querySelector('#confirmPasswordSignUp').value; + + if (password !== confirmPassword) { + event.preventDefault(); + alert('Passwords do not match!'); + } else if (!name || !email || !password || !confirmPassword) { + event.preventDefault(); + alert('Required fields were not filled.'); + } + }); + } }); From 6a97d87502ec01019695842e6c4f69f0c4aa3dbc Mon Sep 17 00:00:00 2001 From: Jasleen1210 <05kaur.j@gmail.com> Date: Mon, 29 Jul 2024 01:13:20 +0530 Subject: [PATCH 02/12] Issue #517 Applied conditions for values in fields for preset to be saved successfully --- js/script.js | 71 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 21 deletions(-) diff --git a/js/script.js b/js/script.js index be1e7d3..c58a5c6 100644 --- a/js/script.js +++ b/js/script.js @@ -703,7 +703,7 @@ window.onload = function () { const closeModal = document.getElementById("closeModal"); const proceedButton = document.getElementById("proceed"); - modal.style.display = "block"; + modal.style.display = "none"; closeModal.onclick = function () { modal.style.display = "none"; @@ -888,7 +888,7 @@ var loader = document.querySelector(".loader"); window.addEventListener('load', () => { var backToTopBtn = document.getElementById("backToTopBtn"); backToTopBtn.style.display = "none"; - setTimeout(effect, 4000); + setTimeout(effect, 100); }) function changeColor() { @@ -969,28 +969,57 @@ document.addEventListener('DOMContentLoaded', () => { // new functionality for saving and loading presets function savePreset() { - const presetName = prompt("Enter a name for your preset:"); - if (!presetName) { - alert('Please enter a valid name for your preset.'); + //get all field values in input during preset saving + let toggler = document.getElementById("sun-moon-mode-toggler") + let countdownValue = document.getElementById('countdown').value; + let n = document.getElementById("color").value; + let set_time = document.getElementById("time").value; + let unit = document.getElementById("unit").value; + let view = document.getElementById("view").value; + let soundEffect = document.getElementById("sound").value; + let color1 = document.getElementById('color1').value; + let color2 = document.getElementById('color2').value; + + // Get selected audio file or URL + let selectedFile = document.getElementById("music-file").files[0]; + let selectedUrl = document.getElementById("music-url").value; + let youtubeUrl = document.getElementById("youtubeUrlInput").value.trim(); + + + if (countdownValue && countdownValue > 0 && Number(n) > 0 && Number.isInteger(Number(n)) && n !== "" && unit !== "unit" && view !== "select" && !(soundEffect !== 'none' && selectedFile) && !(soundEffect !== 'none' && selectedUrl) && !(selectedFile && selectedUrl) && + !(selectedFile && youtubeUrl) && + !(selectedUrl && youtubeUrl) && + !(soundEffect !== 'none' && youtubeUrl)){ + //conditions for valid execution of simulation + const presetName = prompt("Enter a name for your preset:"); + if (!presetName) { + alert('Please enter a valid name for your preset.'); + return; + } + const presetData = { + color: document.getElementById('color').value, + color1: document.getElementById('color1').value, + color2: document.getElementById('color2').value, + time: document.getElementById('time').value, + unit: document.getElementById('unit').value, + view: document.getElementById('view').value, + countdown: document.getElementById('countdown').value, + sound: document.getElementById('sound').value, + youtubeUrlInput: document.getElementById('youtubeUrlInput').value, + + }; + + // Save to localStorage + localStorage.setItem(`preset-${presetName}`, JSON.stringify(presetData)); + alert('Preset saved!'); + } + else { + // after unsuccessful saving of preset + alert("Please fill all required fields properly"); return; } - const presetData = { - color: document.getElementById('color').value, - color1: document.getElementById('color1').value, - color2: document.getElementById('color2').value, - time: document.getElementById('time').value, - unit: document.getElementById('unit').value, - view: document.getElementById('view').value, - countdown: document.getElementById('countdown').value, - sound: document.getElementById('sound').value, - youtubeUrlInput: document.getElementById('youtubeUrlInput').value, - - }; - - // Save to localStorage - localStorage.setItem(`preset-${presetName}`, JSON.stringify(presetData)); - alert('Preset saved!'); + } From 2d6e45934a9753049acb7f83ba7f22c3a435cdbe Mon Sep 17 00:00:00 2001 From: Jasleen1210 <05kaur.j@gmail.com> Date: Mon, 29 Jul 2024 01:17:17 +0530 Subject: [PATCH 03/12] removing test changes removed some changes i made to the project for trial and forgot to remove --- js/script.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/js/script.js b/js/script.js index c58a5c6..098eb68 100644 --- a/js/script.js +++ b/js/script.js @@ -703,7 +703,7 @@ window.onload = function () { const closeModal = document.getElementById("closeModal"); const proceedButton = document.getElementById("proceed"); - modal.style.display = "none"; + modal.style.display = "block"; closeModal.onclick = function () { modal.style.display = "none"; @@ -888,7 +888,7 @@ var loader = document.querySelector(".loader"); window.addEventListener('load', () => { var backToTopBtn = document.getElementById("backToTopBtn"); backToTopBtn.style.display = "none"; - setTimeout(effect, 100); + setTimeout(effect, 4000); }) function changeColor() { @@ -970,15 +970,12 @@ document.addEventListener('DOMContentLoaded', () => { // new functionality for saving and loading presets function savePreset() { //get all field values in input during preset saving - let toggler = document.getElementById("sun-moon-mode-toggler") + let countdownValue = document.getElementById('countdown').value; let n = document.getElementById("color").value; - let set_time = document.getElementById("time").value; let unit = document.getElementById("unit").value; let view = document.getElementById("view").value; let soundEffect = document.getElementById("sound").value; - let color1 = document.getElementById('color1').value; - let color2 = document.getElementById('color2').value; // Get selected audio file or URL let selectedFile = document.getElementById("music-file").files[0]; From 9ac51d8c85c0e6be8111b8f5d86dcdbebf2760e2 Mon Sep 17 00:00:00 2001 From: meetarora Date: Mon, 29 Jul 2024 14:10:04 +0530 Subject: [PATCH 04/12] toggle-commit --- index.html | 2 +- pages/about.html | 105 ++++++++++++++++++++++++++++++++++++++++ pages/contributors.html | 101 ++++++++++++++++++++++++++++++++++++++ pages/faq.html | 105 ++++++++++++++++++++++++++++++++++++++++ pages/features.html | 101 ++++++++++++++++++++++++++++++++++++++ pages/feedback.html | 102 +++++++++++++++++++++++++++++++++++++- pages/privacy.html | 105 +++++++++++++++++++++++++++++++++++++++- pages/terms.html | 105 +++++++++++++++++++++++++++++++++++++++- 8 files changed, 720 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index decf4b3..29c6bee 100644 --- a/index.html +++ b/index.html @@ -437,7 +437,7 @@

Random Disco Light Simulator - + @@ -130,7 +103,7 @@ const circles = document.querySelectorAll(".circle"); circles.forEach(function (circle) { - circle.x = 0; + circle.x = 0; circle.y = 0; }); @@ -163,8 +136,8 @@ });
- -
+ +
diff --git a/pages/contributors.html b/pages/contributors.html index 25540e9..3b8ad23 100644 --- a/pages/contributors.html +++ b/pages/contributors.html @@ -60,33 +60,6 @@ } } - #backToTopBtn { - position: fixed; - bottom: 50px; - right: 31px; - height: 50px; - width: 50px; - padding: 10px 15px; - font-size: 20px; - cursor: pointer; - border: none; - background: linear-gradient(#1845ad, #23a2f6); - color: white; - border-radius: 50%; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); - transition: 500ms; - display: none; /* Initially hide the button */ - justify-content: center; - align-items: center; - z-index: 9999; -} - -#backToTopBtn:hover { - background: linear-gradient(to right, #ff512f, #f09819); - opacity: 1; - transform: scale(1.05); - box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2); -} @@ -164,8 +137,8 @@ });
- -
+ +
diff --git a/pages/faq.html b/pages/faq.html index 9c852c7..d7d517a 100644 --- a/pages/faq.html +++ b/pages/faq.html @@ -92,33 +92,6 @@ } } - #backToTopBtn { - position: fixed; - bottom: 50px; - right: 31px; - height: 50px; - width: 50px; - padding: 10px 15px; - font-size: 20px; - cursor: pointer; - border: none; - background: linear-gradient(#1845ad, #23a2f6); - color: white; - border-radius: 50%; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); - transition: 500ms; - display: none; /* Initially hide the button */ - justify-content: center; - align-items: center; - z-index: 9999; -} - -#backToTopBtn:hover { - background: linear-gradient(to right, #ff512f, #f09819); - opacity: 1; - transform: scale(1.05); - box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2); -} @@ -196,8 +169,8 @@ });
- -
+ +
diff --git a/pages/features.html b/pages/features.html index 1b240c2..c2885f7 100644 --- a/pages/features.html +++ b/pages/features.html @@ -58,33 +58,6 @@ } } - #backToTopBtn { - position: fixed; - bottom: 50px; - right: 31px; - height: 50px; - width: 50px; - padding: 10px 15px; - font-size: 20px; - cursor: pointer; - border: none; - background: linear-gradient(#1845ad, #23a2f6); - color: white; - border-radius: 50%; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); - transition: 500ms; - display: none; /* Initially hide the button */ - justify-content: center; - align-items: center; - z-index: 9999; -} - -#backToTopBtn:hover { - background: linear-gradient(to right, #ff512f, #f09819); - opacity: 1; - transform: scale(1.05); - box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2); -} @@ -161,7 +134,7 @@ animateCircles(); }); - +
diff --git a/pages/feedback.html b/pages/feedback.html index 94f05e6..7e64c9e 100644 --- a/pages/feedback.html +++ b/pages/feedback.html @@ -60,33 +60,6 @@ } } - #backToTopBtn { - position: fixed; - bottom: 50px; - right: 31px; - height: 50px; - width: 50px; - padding: 10px 15px; - font-size: 20px; - cursor: pointer; - border: none; - background: linear-gradient(#1845ad, #23a2f6); - color: white; - border-radius: 50%; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); - transition: 500ms; - display: none; /* Initially hide the button */ - justify-content: center; - align-items: center; - z-index: 9999; -} - -#backToTopBtn:hover { - background: linear-gradient(to right, #ff512f, #f09819); - opacity: 1; - transform: scale(1.05); - box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2); -} @@ -125,8 +98,8 @@
- -
+ +
- -
+ +
diff --git a/pages/terms.html b/pages/terms.html index 1bad001..40d085d 100644 --- a/pages/terms.html +++ b/pages/terms.html @@ -47,33 +47,6 @@ display: none; } } - #backToTopBtn { - position: fixed; - bottom: 50px; - right: 31px; - height: 50px; - width: 50px; - padding: 10px 15px; - font-size: 20px; - cursor: pointer; - border: none; - background: linear-gradient(#1845ad, #23a2f6); - color: white; - border-radius: 50%; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); - transition: 500ms; - display: none; /* Initially hide the button */ - justify-content: center; - align-items: center; - z-index: 9999; -} - -#backToTopBtn:hover { - background: linear-gradient(to right, #ff512f, #f09819); - opacity: 1; - transform: scale(1.05); - box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2); -} @@ -159,8 +132,8 @@
- -
+ +