Skip to content

Commit

Permalink
Merge pull request #88 from riyarane46/main
Browse files Browse the repository at this point in the history
Updated the annimation of about me section
  • Loading branch information
dohinafs authored Oct 2, 2024
2 parents ab8bfad + 45b863a commit cca1251
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 3 deletions.
18 changes: 18 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,21 @@ function editOrder() {
}
displayOrder();


//function for annimation on about us
document.addEventListener('DOMContentLoaded', function() {
const aboutSection = document.querySelector('.about');

function checkScroll() {
const triggerBottom = window.innerHeight / 5 * 4;
const aboutTop = aboutSection.getBoundingClientRect().top;

if (aboutTop < triggerBottom) {
aboutSection.classList.add('animate');
}
}

window.addEventListener('scroll', checkScroll);
checkScroll();
});

30 changes: 27 additions & 3 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ section {
color: #fff;
background: var(--main-color);
cursor: pointer;
border-radius: 0.5rem;
transition: transform 0.3s ease;
}

button {
Expand All @@ -63,14 +65,16 @@ button {
color: #fff;
background: var(--main-color);
cursor: pointer;
border-radius: 0.5rem;
transition: transform 0.3s ease;
}

.btn:hover {
letter-spacing: .2rem;
transform: scale(1.05);
}

button:hover {
letter-spacing: .2rem;
transform: scale(1.05);
}

.animated-button {
Expand Down Expand Up @@ -778,4 +782,24 @@ button:hover,
letter-spacing: .2rem;
}

/* ... rest of the existing code ... */
/* ... rest of the existing code ... */

/* Animation for about us */
.about .row .image {
opacity: 0;
transform: translateX(-100px);
transition: opacity 0.8s ease, transform 0.8s ease;
}

.about .row .content {
opacity: 0;
transform: translateX(-100px);
transition: opacity 0.8s ease, transform 0.8s ease;
transition-delay: 0.4s;
}

.about.animate .row .image,
.about.animate .row .content {
opacity: 1;
transform: translateX(0);
}

0 comments on commit cca1251

Please sign in to comment.