From 6837a638d40b0ffeee4e28d9e76d56c72386654c Mon Sep 17 00:00:00 2001 From: "dhanush.s" Date: Tue, 30 Sep 2025 15:36:43 +0530 Subject: [PATCH] fix: infinity --- main.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/main.js b/main.js index 7779ea6..9ff8ffc 100644 --- a/main.js +++ b/main.js @@ -12,12 +12,12 @@ function getInTouch(vall) { } -function WhatsgetInTouch(){ +function WhatsgetInTouch() { window.open( "https://wa.me/919787466226?text=Hi%20KodePilot%20Team%2C%0A%0AI%20came%20across%20your%20website%20and%20would%20like%20to%20know%20more%20about%20your%20Career%20Guidance%20and%20Placement%20support%20services.%20Could%20you%20please%20share%20the%20details%3F%0A%0AThanks%21", "_blank" ); -} +} function getInZoho() { window.open("https://forms.zohopublic.in/krishnakode1/form/KodePilotRegistrationForm/formperma/A2L8xK6T13A9-s5Kxj8BqRTGsgmpKDHM0DDcZQWye5E"); @@ -580,17 +580,22 @@ document.addEventListener("DOMContentLoaded", () => { counters.forEach(counter => observer.observe(counter)); }); - +// i know it is a bad code but it works 😅 document.addEventListener("DOMContentLoaded", () => { const track = document.querySelector(".move-slider-animation-box"); const container = document.querySelector(".container"); - let speed = 1; let pos = 0; + const normalSpeed = 1; + let speed = 20; function animate() { pos -= speed; track.style.transform = `translateX(${pos}px)`; + if (pos <= -100 && speed !== normalSpeed) { + speed = normalSpeed; + } + const firstChild = track.firstElementChild; const firstRect = firstChild.getBoundingClientRect(); const containerRect = container.getBoundingClientRect(); @@ -605,4 +610,4 @@ document.addEventListener("DOMContentLoaded", () => { } animate(); -}); \ No newline at end of file +});