File manager - Edit - /home/asiatechinc/public_html/asiatech-websites/havelockexoticbeachresort.com/testimonial.js
Back
const reviewWrap = document.getElementById("reviewWrap"); const leftArrow = document.getElementById("leftArrow"); const rightArrow = document.getElementById("rightArrow"); const imgDiv = document.getElementById("imgDiv"); const personName = document.getElementById("personName"); const profession = document.getElementById("profession"); const description = document.getElementById("description"); const surpriseMeBtn = document.getElementById("surpriseMeBtn"); const chicken = document.querySelector(".chicken"); let isChickenVisible; let people = [ { photo: 'url("images/testi.png")', name: "Devanshi Goradia", description: "We had to cancel a booking 1 day prior to the trip due to the ongoing war in India. The hotel didn’t not hesitate to give a full refund without any hassle. This kind of ethics means a lot more. This brings in a sense of trust and loyalty. Kudos to the team !" }, { photo: "url('images/testi.png')", name: "Pallavi jadhav", description: "I had an memorable 2-night stay at Havelock Exotic Beach Resort! The resort is ideally located with a stunning beach just a few steps away. The beach was pristine, with crystal-clear waters that were perfect for a peaceful walk along the shore, experiencing sunrise 🌅, Waking up to the sound of the waves and enjoying the gorgeous beach side views from the room made the experience even more special." }, { photo: "url('images/testi.png')", name: "Dr. Lokesh Arora", description: "I recently stayed at Havelock Exotic Beach Resorts, and it was an exceptional experience! The resort is perfectly situated right next to a stunning private beach, making it an ideal getaway for those seeking tranquility and natural beauty.The rooms were spacious, impeccably clean, and equipped with all the modern amenities one could need for a comfortable stay.!" }, { photo: "url('images/testi.png')", name: "Jignesh Pandya", description: "The resort is located at a very nice location, just on the beach. You can step out of your rooms and see the beautiful sea right in front of you. The staff of this resort is also very helpful. They try to manage everything for you. Badal deserves a special mention as he always tries to be there and help out in any way possible." } ]; imgDiv.style.backgroundImage = people[0].photo; personName.innerText = people[0].name; profession.innerText = people[0].profession; description.innerText = people[0].description; let currentPerson = 0; //Select the side where you want to slide function slide(whichSide, personNumber) { let reviewWrapWidth = reviewWrap.offsetWidth + "px"; let descriptionHeight = description.offsetHeight + "px"; //(+ or -) let side1symbol = whichSide === "left" ? "" : "-"; let side2symbol = whichSide === "left" ? "-" : ""; let tl = gsap.timeline(); if (isChickenVisible) { tl.to(chicken, { duration: 0.4, opacity: 0 }); } tl.to(reviewWrap, { duration: 0.4, opacity: 0, translateX: `${side1symbol + reviewWrapWidth}` }); tl.to(reviewWrap, { duration: 0, translateX: `${side2symbol + reviewWrapWidth}` }); setTimeout(() => { imgDiv.style.backgroundImage = people[personNumber].photo; }, 400); setTimeout(() => { description.style.height = descriptionHeight; }, 400); setTimeout(() => { personName.innerText = people[personNumber].name; }, 400); setTimeout(() => { profession.innerText = people[personNumber].profession; }, 400); setTimeout(() => { description.innerText = people[personNumber].description; }, 400); tl.to(reviewWrap, { duration: 0.4, opacity: 1, translateX: 0 }); if (isChickenVisible) { tl.to(chicken, { duration: 0.4, opacity: 1 }); } } function setNextCardLeft() { if (currentPerson === 3) { currentPerson = 0; slide("left", currentPerson); } else { currentPerson++; } slide("left", currentPerson); } function setNextCardRight() { if (currentPerson === 0) { currentPerson = 3; slide("right", currentPerson); } else { currentPerson--; } slide("right", currentPerson); } leftArrow.addEventListener("click", setNextCardLeft); rightArrow.addEventListener("click", setNextCardRight); surpriseMeBtn.addEventListener("click", () => { if (chicken.style.opacity === "0") { chicken.style.opacity = "1"; imgDiv.classList.add("move-head"); surpriseMeBtn.innerText = "Remove "; surpriseMeBtn.classList.remove("surprise-me-btn"); surpriseMeBtn.classList.add("hide-chicken-btn"); isChickenVisible = false; } else if (chicken.style.opacity === "1") { chicken.style.opacity = "0"; imgDiv.classList.remove("move-head"); surpriseMeBtn.innerText = "Surprise me"; surpriseMeBtn.classList.add("surprise-me-btn"); surpriseMeBtn.classList.remove("hide-chicken-btn"); isChickenVisible = false; } }); window.addEventListener("resize", () => { description.style.height = "100%"; });
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings