fix: infinity
This commit is contained in:
parent
1ee4878530
commit
6837a638d4
11
main.js
11
main.js
@ -12,7 +12,7 @@ function getInTouch(vall) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function WhatsgetInTouch(){
|
function WhatsgetInTouch() {
|
||||||
window.open(
|
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",
|
"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"
|
"_blank"
|
||||||
@ -580,17 +580,22 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||||||
counters.forEach(counter => observer.observe(counter));
|
counters.forEach(counter => observer.observe(counter));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// i know it is a bad code but it works 😅
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
const track = document.querySelector(".move-slider-animation-box");
|
const track = document.querySelector(".move-slider-animation-box");
|
||||||
const container = document.querySelector(".container");
|
const container = document.querySelector(".container");
|
||||||
let speed = 1;
|
|
||||||
let pos = 0;
|
let pos = 0;
|
||||||
|
const normalSpeed = 1;
|
||||||
|
let speed = 20;
|
||||||
|
|
||||||
function animate() {
|
function animate() {
|
||||||
pos -= speed;
|
pos -= speed;
|
||||||
track.style.transform = `translateX(${pos}px)`;
|
track.style.transform = `translateX(${pos}px)`;
|
||||||
|
|
||||||
|
if (pos <= -100 && speed !== normalSpeed) {
|
||||||
|
speed = normalSpeed;
|
||||||
|
}
|
||||||
|
|
||||||
const firstChild = track.firstElementChild;
|
const firstChild = track.firstElementChild;
|
||||||
const firstRect = firstChild.getBoundingClientRect();
|
const firstRect = firstChild.getBoundingClientRect();
|
||||||
const containerRect = container.getBoundingClientRect();
|
const containerRect = container.getBoundingClientRect();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user