| Linux in-mum-web1499.main-hosting.eu 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64 Path : /home/u901718425/domains/kasturihillsidebaner.in/public_html/ |
| Current File : /home/u901718425/domains/kasturihillsidebaner.in/public_html/script.js |
$(document).ready(function () {
$('body').popupCreate({ logo: { url: '/Balmoral logo.png', alt: false, height: '30px', width: 'auto', }, banner: { url: '/popup.webp', alt: false, }, download: { url: '/4.5 hillside tower A.jpg', alt: false, }, title: 'The Balmoral Hillside', area: 'Pune', returns: '/thankyou.html', phone: 8600006723, whatsAppMessage: "Hi! I'm interested in The Balmoral Hillside Project. Please share the details of the project.", whatsIcon: true, phoneIcon: true, offerTag: true, offerTagName: 'EXCITING OFFERS!!' });
$(document).on('click', '.read-more', function () {
if ($(this).text() == 'Read More') {
$(this).text('Read Less');
} else {
$(this).text('Read More');
}
$("." + $(this).attr('data-expand')).toggleClass('show');
});
function animateNumber($el) {
var countTo = parseInt($el.text());
var extraText = $el.text().replace(/[0-9]/g, "");
$({ countNum: 0 }).animate(
{ countNum: countTo },
{
duration: 2500,
easing: "swing",
step: function () {
$el.text(Math.floor(this.countNum) + extraText);
},
complete: function () {
$el.text(this.countNum + extraText);
}
}
);
}
// Use Intersection Observer for viewport check
$(document).ready(function () {
const observer = new IntersectionObserver(function (entries, observer) {
entries.forEach(entry => {
if (entry.isIntersecting) {
let $el = $(entry.target);
if (!$el.hasClass("animated")) { // prevent re-trigger
$el.addClass("animated");
animateNumber($el);
}
observer.unobserve(entry.target); // stop observing after animation
}
});
}, { threshold: 0.5 }); // trigger when 50% visible
$(".running-number").each(function () {
observer.observe(this);
});
});
$(".tab-pane").hide();
$(".tab-pane:first").show();
// make first button active
$(".nav button").removeClass("active");
$(".nav button:first").addClass("active");
// on button click
$(".nav button").click(function () {
// remove active from all buttons
$(".nav button").removeClass("active");
// add active to clicked button
$(this).addClass("active");
// hide all tab panes
$(".tab-pane").hide();
// show the clicked tab pane
var target = $(this).attr("data-bs-target");
$(target).fadeIn();
});
// let _globle = {}
// fetch('/getNearByLocation.json')
// .then(response => response.json())
// .then(data => {
// _globle.nearby = data.nearby;
// let buttonsHtml = '';
// Object.keys(_globle.nearby).forEach(key => {
// if (['pump', 'landmark'].includes(key.toLocaleLowerCase())) return;
// buttonsHtml += `<div class="col-6 col-md text-center" style="max-width: 160px;"><button class="btn btn-outline-primary w-100 location" data-target="${key}">${key}</button></div>`;
// });
// $('#buttons').html(buttonsHtml);
// $(document).find('[data-target="Commute"]').click();
// })
// .catch(error => {
// console.error('Error fetching nearby locations:', error);
// });
// $(document).on('click', '.location', function (e) {
// $('.location').removeClass('active');
// $(this).addClass('active');
// e.preventDefault();
// let target = $(this).data('target');
// let locationsHtml = '<ul class="text-start py-3 text-white">';
// Object.entries(_globle.nearby[target]).forEach(([key, location]) => {
// locationsHtml += `<li class="py-2 border-0 bg-transparent">${location.name}</li>`;
// });
// locationsHtml += '</ul>';
// $('#locations').html(locationsHtml);
// });
});