Skip to content

Commit

Permalink
Merge pull request #374 from Ridhima10/animation-responsiveness
Browse files Browse the repository at this point in the history
fixed
  • Loading branch information
Manaregr8 committed Jul 20, 2024
2 parents a458922 + 6336442 commit 9942610
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
35 changes: 35 additions & 0 deletions server/views/about.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,15 @@
Made with ❤️ of <b>Chrome Gaming</b>
</footer>
</body>

<script>
document.querySelector('.toggler').addEventListener('click', function () {
document.querySelector('.social-icons').classList.toggle('show-icons');
});
</script>
<script>
//Custom Cursor
const coords = { x: 0, y: 0 };
Expand Down Expand Up @@ -380,6 +383,38 @@
circle.style.backgroundColor = colors[index % colors.length];
});
window.addEventListener("mousemove", function (e) {
coords.x = e.clientX;
coords.y = e.clientY;
});
function animateCircles() {
let x = coords.x;
let y = coords.y;
circles.forEach(function (circle, index) {
circle.style.left = x - 12 + "px";
circle.style.top = y - 12 + "px";
circle.style.scale = (circles.length - index) / circles.length;
circle.x = x;
circle.y = y;
const nextCircle = circles[index + 1] || circles[0];
x += (nextCircle.x - x) * 0.3;
y += (nextCircle.y - y) * 0.3;
});
requestAnimationFrame(animateCircles);
}
animateCircles();
window.addEventListener("mousemove", function (e) {
coords.x = e.clientX;
coords.y = e.clientY;
Expand Down
1 change: 1 addition & 0 deletions server/views/products.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
<i class="bi bi-toggle-off" id="theme-toggle"></i>
</div>
</nav>

<%- include('partials/rateus') %>
<script src="/js/script.js"></script>

Expand Down

0 comments on commit 9942610

Please sign in to comment.