Skip to content

Commit

Permalink
Merge pull request #89 from Sapta-Dev27/New-Branch
Browse files Browse the repository at this point in the history
Issue #29  solved
  • Loading branch information
dohinafs authored Oct 2, 2024
2 parents 8f2d579 + 86f6f94 commit ab8bfad
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
38 changes: 38 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

<!-- Custom CSS -->
<link rel="stylesheet" href="style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>

</head>

<body>
Expand Down Expand Up @@ -248,6 +250,42 @@ <h3> Never settle for just one scoop</h3><br><br>

<!-- JavaScript File -->
<script src="script.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {





// Animate the search form
gsap.from(".search-form", { opacity: 0, x: -100, duration: 1, ease: "power2.out" });

// Animate the cart container
gsap.from(".cart-items-container", { opacity: 0, y: 100, duration: 1.5, ease: "power2.out" });

// Animate the 'My Order' container
gsap.from(".my-order-container", { opacity: 0, x: 100, duration: 1.5, ease: "power2.out" });

// Animate home section content
gsap.from(".home .content h3", { opacity: 0, x: -100, duration: 1.5, delay :0.1, ease: "power2.out" });
gsap.from(".home .content p", { opacity: 0, x: -100, duration: 1.5, delay: 0.1, ease: "power2.out" });
gsap.from(".home .animated-button", { opacity: 0, x: -100, duration: 1.5, delay: 0.1, ease: "power2.out" });

// Animate buttons on hover for scaling effect
const buttons = document.querySelectorAll("button");
buttons.forEach(button => {
button.addEventListener('mouseover', () => {
gsap.to(button, { scale: 1.1, duration: 0.2 });
});
button.addEventListener('mouseout', () => {
gsap.to(button, { scale: 1, duration: 0.2 });
});
});

});
</script>



</body>

Expand Down
3 changes: 2 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,5 @@ function editOrder() {
alert('Your order has been cleared. You can now add new items.');
}
}
displayOrder();
displayOrder();

0 comments on commit ab8bfad

Please sign in to comment.