Update 1.js

This commit is contained in:
FURK4NGG
2024-10-05 19:27:42 +03:00
committed by GitHub
parent 0d7d5c2cc8
commit c904b2b71e
+18
View File
@@ -1,3 +1,21 @@
/*IMAGE CHANGER*/
let currentIndex = 0;
const images = document.querySelectorAll('#photo img');
function switchPhoto() {
// Hide the current image by removing 'visible'
images[currentIndex].classList.remove('visible');
// Increment the index and loop back to the first image after the last one
currentIndex = (currentIndex + 1) % images.length;
// Show the next image by adding 'visible'
images[currentIndex].classList.add('visible');
}
// Initially set the first image as visible
images[currentIndex].classList.add('visible');
/*SCROLL REVEALING*/ /*SCROLL REVEALING*/
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
const textContainer = document.getElementById('animatedTextContainer'); const textContainer = document.getElementById('animatedTextContainer');