Skip to content

Commit

Permalink
Merge pull request #297 from wouffle/Patch-1
Browse files Browse the repository at this point in the history
Improving visual appeal
  • Loading branch information
tushargupta1504 authored Oct 16, 2024
2 parents be91955 + b03a4fe commit bbec37b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
18 changes: 17 additions & 1 deletion script3.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,20 @@ function validateInputs1(){
}else{
alert("Registered successfully");
}
}
}
function triggerSlidingEffect() {
// On image click
document.querySelectorAll('#gallery .image-container img').forEach(img => {
img.addEventListener('click', function() {
this.classList.toggle('sliding'); // Add or remove sliding effect
});
});

// On scroll
window.addEventListener('scroll', () => {
document.querySelectorAll('#gallery .image-container img').forEach(img => {
img.classList.add('sliding'); // Add sliding effect on scroll
});
});

}
10 changes: 7 additions & 3 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,10 @@ textarea {
border: none;
}

#gallery .image-container:hover img {
transform: scale(1.5);
}
#gallery .image-container img {
transition: transform 0.5s ease; /* Smooth transition for the sliding effect */
}

#gallery .image-container img.sliding {
transform: translateX(200px); /* Adjust the value based on how much you want to slide the image */
}

0 comments on commit bbec37b

Please sign in to comment.