diff --git a/en/index.html b/en/index.html index bd2d584..69941fc 100644 --- a/en/index.html +++ b/en/index.html @@ -23,7 +23,7 @@ Rabbit Network - + diff --git a/script.js b/script.js deleted file mode 100644 index bad5dd2..0000000 --- a/script.js +++ /dev/null @@ -1,76 +0,0 @@ -// JavaScript for slideshow/carousel -let slideIndex = 0; -const slides = document.querySelectorAll('.slideshow-slide'); -const totalSlides = slides.length; - -function showSlides() { - slides.forEach(slide => { - slide.style.display = 'none'; - }); - - slideIndex++; - - if (slideIndex > totalSlides) { - slideIndex = 1; - } - - slides[slideIndex - 1].style.display = 'block'; - setTimeout(showSlides, 5000); // Change slide every 5 seconds -} - -showSlides(); - -// JavaScript for form validation -const form = document.querySelector('form'); - -form.addEventListener('submit', function(event) { - const emailInput = document.querySelector('#email'); - const emailValue = emailInput.value.trim(); - - if (!isValidEmail(emailValue)) { - event.preventDefault(); - alert('Please enter a valid email address.'); - } -}); - -function isValidEmail(email) { - const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; - return emailRegex.test(email); -} - -// JavaScript for toggling light/dark mode -const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]'); -const currentTheme = localStorage.getItem('theme'); - -if (currentTheme) { - document.documentElement.setAttribute('data-theme', currentTheme); - - if (currentTheme === 'dark') { - toggleSwitch.checked = true; - } -} - -toggleSwitch.addEventListener('change', function(event) { - if (event.target.checked) { - document.documentElement.setAttribute('data-theme', 'dark'); - localStorage.setItem('theme', 'dark'); - } else { - document.documentElement.setAttribute('data-theme', 'light'); - localStorage.setItem('theme', 'light'); - } -}); - -function copyToClipboard(text) { - navigator.clipboard.writeText(text).then(function() { - /* Show the alert box */ - showAlert(); - }, function(err) { - console.error('Async: Could not copy text: ', err); - }); -} - -function showAlert() { - var alertBox = document.getElementById("alertBox"); - alertBox.className = "show"; - setTimeout(function(){ alertBox.className = alertBox.className.replace("show", ""); }, 3000); -}