Book Puja

Online Puja Booking | KARMASU – Book Authentic Puja at Home

tailwind.config = {
theme: {
extend: {
colors: {
saffron: { DEFAULT:’#FF9933′, deep:’#E07000′, light:’#FFB347′, pale:’#FFF4E6′ },
gold: { DEFAULT:’#C8901A’, light:’#F0C040′, pale:’#FFFBF0′ },
crimson: { DEFAULT:’#8B1A1A’, deep:’#5C0A0A’ },
ivory: { DEFAULT:’#FEFBF5′, dark:’#F5EDD8′ },
maroon: { DEFAULT:’#5C0A0A’, deep:’#3A0606′ }
},
fontFamily: {
display: [‘”Cinzel Decorative”‘, ‘cursive’],
heading: [‘Cinzel’, ‘serif’],
deva: [‘”Noto Serif Devanagari”‘, ‘serif’],
body: [‘Lora’, ‘serif’]
},
animation: {
‘fade-up’: ‘fadeUp 0.6s ease both’,
‘fade-in’: ‘fadeIn 0.4s ease both’,
‘float’: ‘float 3s ease-in-out infinite’,
‘pulse-glow’: ‘pulseGlow 2s ease-in-out infinite’,
‘shimmer’: ‘shimmer 1.5s infinite’
},
keyframes: {
fadeUp: { from:{ opacity:’0′, transform:’translateY(30px)’ }, to:{ opacity:’1′, transform:’translateY(0)’ } },
fadeIn: { from:{ opacity:’0′ }, to:{ opacity:’1′ } },
float: { ‘0%,100%’:{ transform:’translateY(0)’ }, ‘50%’:{ transform:’translateY(-8px)’ } },
pulseGlow: { ‘0%,100%’:{ boxShadow:’0 0 20px rgba(255,153,51,0.4)’ }, ‘50%’:{ boxShadow:’0 0 40px rgba(255,153,51,0.8)’ } },
shimmer: { ‘0%’:{ backgroundPosition:’200% 0′ }, ‘100%’:{ backgroundPosition:’-200% 0′ } }
}
}
}
}

🕉

🪔 5000+ Happy Devotees

Book Online Puja &
Get Blessings at Home
🙏

घर बैठे करवाएं प्रामाणिक पूजा

Authentic Pandits · Live & Recorded Puja · Vedic Rituals · Trusted by Devotees Across India




WhatsApp

https://wa.me/919129388891

✅ 100% Verified Pandits
🔒 Secure Payments
📿 Vedic Rituals

🧑‍🏫

Verified Pandits
Trained in Vedic traditions

📱

Live Puja
Watch from anywhere

🔒

Secure Payment
100% safe & encrypted

📿

Prasad Delivery
Delivered to your door

🪔 हमारी सेवाएं 🪔

Choose Your Puja

अपनी मनोकामना के अनुसार पूजा चुनें

🔍

All Categories
Lakshmi Puja
Shiva Puja
Hanuman Puja
Ganesh Puja
Navratri Puja
Satyanarayan Puja
Vastu Puja

Sort By
Price: Low to High
Price: High to Low
Name: A to Z

Price Range:


Up to ₹10,000

Loading pujas…


How It Works

बुकिंग कैसे करें — 4 आसान चरण

1

Choose Puja

Browse and select your desired puja

2

Fill Details

Enter your name, date & sankalp

3

Make Payment

Secure checkout via WooCommerce

4

Get Blessings

Attend live puja & receive prasad

Devotees Speak

हमारे भक्तों के अनुभव

★★★★★

“Satyanarayan Puja was performed so beautifully. The pandit explained every ritual in Hindi. My family felt divine blessings throughout. Highly recommended!”

R
Rajesh Sharma
Delhi • Satyanarayan Puja

★★★★★

“Lakshmi Puja on Diwali was incredible. Booked online in 2 minutes, joined live on video. The prasad arrived at my home the next day. Amazing service!”

P
Priya Gupta
Mumbai • Lakshmi Puja

★★★★★

“After performing Vastu Shanti Puja through KARMASU, the negative energy in our home completely changed. Our business also improved. Jai Shree Ram!”

A
Amit Verma
Bangalore • Vastu Shanti

Frequently Asked Questions

अक्सर पूछे जाने वाले प्रश्न

🕉

Ready to Receive Divine Blessings?

आज ही बुकिंग करें और ईश्वर की कृपा पाएं

KARMASU
Digital Hindu Gurukul · जय सनातन धर्म 🙏
© 2025 KARMASU. All rights reserved.

(function() {

// ── CONFIG ──────────────────────────────────────────────
var API_BASE = (window.location.hostname === ‘karmasu.in’ || window.location.hostname === ‘www.karmasu.in’)
? ‘/wp-json/wp/v2’
: ‘https://karmasu.in/wp-json/wp/v2’;

var WC_CHECKOUT = ‘https://karmasu.in/checkout/?add-to-cart=’;
// MODIFIED — correct WhatsApp number
var WA_NUMBER = ‘919129388891’;
var PER_PAGE = 12;

// ── STATE ───────────────────────────────────────────────
var allPujas = [];
var filteredPujas = [];
var displayCount = PER_PAGE;
var currentProduct = null;
var searchTimer = null;
var currentView = ‘grid’;

// ── FALLBACK PUJA DATA (when API has no products) ───────
var FALLBACK_PUJAS = [
{ id:1, name:’Satyanarayan Puja’, price:’₹2,100′, priceRaw:2100, cat:’satyanarayan’, desc:’Complete Satyanarayan Katha with prasad. Performed by certified Vedic pandit. Duration: 3 hours.’, img:’🛕’, slug:’satyanarayan-puja’, popular:true },
{ id:2, name:’Lakshmi Puja’, price:’₹1,501′, priceRaw:1501, cat:’lakshmi’, desc:’Mahalakshmi Puja for wealth & prosperity. Special on Diwali & Fridays. Includes Lakshmi Chalisa.’, img:’🌺’, slug:’lakshmi-puja’, popular:true },
{ id:3, name:’Ganesh Puja’, price:’₹1,100′, priceRaw:1100, cat:’ganesh’, desc:’Remove obstacles with Ganpati Puja. Ideal for new beginnings, business, education & marriage.’, img:’🐘’, slug:’ganesh-puja’, popular:false },
{ id:4, name:’Rudrabhishek Puja’, price:’₹3,100′, priceRaw:3100, cat:’shiva’, desc:’Powerful Shiva puja with milk, honey & bilva. Removes doshas and brings peace.’, img:’🙏’, slug:’rudrabhishek-puja’, popular:true },
{ id:5, name:’Hanuman Puja’, price:’₹801′, priceRaw:801, cat:’hanuman’, desc:’Hanuman Chalisa path with Sundarkand. Best for courage, protection and removing fear.’, img:’🚩’, slug:’hanuman-puja’, popular:false },
{ id:6, name:’Navratri Puja’, price:’₹5,100′, priceRaw:5100, cat:’navratri’, desc:’9 days Navratri puja with Durga Saptashati. Special havan on Ashtami & Navami.’, img:’🔱’, slug:’navratri-puja’, popular:true },
{ id:7, name:’Vastu Shanti Puja’, price:’₹7,500′, priceRaw:7500, cat:’vastu’, desc:’Complete Vastu Shanti puja for new home or office. Removes Vastu doshas, brings harmony.’, img:’🏡’, slug:’vastu-shanti-puja’, popular:false },
{ id:8, name:’Kaal Sarp Dosh Puja’, price:’₹11,000′, priceRaw:11000, cat:’shiva’, desc:’Powerful puja to remove Kaal Sarp Dosh from kundali. Performed at Trimbakeshwar.’, img:’🐍’, slug:’kaal-sarp-dosh-puja’, popular:false },
{ id:9, name:’Griha Pravesh Puja’, price:’₹4,500′, priceRaw:4500, cat:’vastu’, desc:’Auspicious puja for entering new home. Purifies energy and invites positive vibrations.’, img:’🏠’, slug:’griha-pravesh-puja’, popular:false },
{ id:10, name:’Baglamukhi Puja’, price:’₹8,100′, priceRaw:8100, cat:’navratri’, desc:’For victory in court cases, enemies and obstacles. Powerful tantric puja.’, img:’⚡’, slug:’baglamukhi-puja’, popular:false },
{ id:11, name:’Surya Namaskar Puja’, price:’₹1,001′, priceRaw:1001, cat:’shiva’, desc:’Sun god puja for health, eyesight and vitality. Performed during sunrise.’, img:’☀️’, slug:’surya-namaskar-puja’, popular:false },
{ id:12, name:’Saraswati Puja’, price:’₹1,251′, priceRaw:1251, cat:’lakshmi’, desc:’Goddess of knowledge puja. Best for students, artists, teachers. On Basant Panchami.’, img:’📚’, slug:’saraswati-puja’, popular:false }
];

// ── INIT ────────────────────────────────────────────────
function init() {
createParticles();
setupFAQ();
setupEvents();
setupReveal();
loadPujas();
// Set min date for booking to today
var today = new Date().toISOString().split(‘T’)[0];
var dateInput = document.getElementById(‘f-date’);
if (dateInput) dateInput.min = today;
}

// ── FETCH PUJAS ─────────────────────────────────────────
function loadPujas() {
var grid = document.getElementById(‘puja-grid’);
var errState = document.getElementById(‘error-state’);
var emptyState = document.getElementById(’empty-state’);
if (errState) errState.classList.add(‘hidden’);
if (emptyState) emptyState.classList.add(‘hidden’);

// Show skeletons
if (grid) {
var skels = ”;
for (var i = 0; i < 8; i++) {
skels += '

‘;
}
grid.innerHTML = skels;
grid.className = ‘grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6’;
}

var controller = new AbortController();
var timeout = setTimeout(function() { controller.abort(); }, 8000);

var url = API_BASE + ‘/product?per_page=50&_embed&status=publish’;

fetch(url, {
credentials: ‘same-origin’,
headers: { ‘Accept’: ‘application/json’ },
signal: controller.signal
})
.then(function(r) {
clearTimeout(timeout);
if (!r.ok) throw new Error(‘HTTP ‘ + r.status);
return r.json();
})
.then(function(products) {
clearTimeout(timeout);
if (!Array.isArray(products) || products.length === 0) {
useFallback();
return;
}
allPujas = products.map(function(p, i) {
var priceRaw = parseFloat(p.meta && p.meta.price ? p.meta.price : (p.price || 0)) || (1000 + i * 500);
return {
id: p.id,
name: safeText(p.title && p.title.rendered ? p.title.rendered : ‘Puja ‘ + (i+1)),
price: formatPrice(priceRaw),
priceRaw: priceRaw,
desc: safeText(p.excerpt && p.excerpt.rendered ? p.excerpt.rendered : (p.content && p.content.rendered ? p.content.rendered : ”)).slice(0, 120),
img: getImg(p),
imgEmoji: ‘🛕’,
slug: p.slug || (‘puja-‘ + p.id),
cat: getCatFromProduct(p),
popular: i displayCount) {
loadMore.classList.remove(‘hidden’);
} else {
loadMore.classList.add(‘hidden’);
}
}

// Attach events
grid.querySelectorAll(‘.book-btn’).forEach(function(btn) {
btn.addEventListener(‘click’, function(e) {
e.stopPropagation();
var id = parseInt(btn.getAttribute(‘data-id’), 10);
openBooking(id);
});
});

// Lazy load images
if (‘IntersectionObserver’ in window) {
var imgs = grid.querySelectorAll(‘img[data-src]’);
var obs = new IntersectionObserver(function(entries) {
entries.forEach(function(entry) {
if (entry.isIntersecting) {
var img = entry.target;
img.src = img.getAttribute(‘data-src’);
img.removeAttribute(‘data-src’);
obs.unobserve(img);
}
});
});
imgs.forEach(function(img) { obs.observe(img); });
}
}

function makeGridCard(p) {
var imgHTML = p.img
? ‘' + esc(p.name) + '‘
: ‘

‘ + p.imgEmoji + ‘

‘;

return ‘

‘ +
‘

‘ +
imgHTML +
(p.popular ? ‘

🔥 Popular

‘ : ”) +
‘

‘ + p.price + ‘

‘ +
‘

‘ +
‘

‘ +
‘

‘ + esc(p.name) + ‘

‘ +
‘

‘ + esc(p.desc) + ‘

‘ +
‘‘ +
‘

‘ +
‘

‘;
}

function makeListCard(p) {
var imgHTML = p.img
? ‘' + esc(p.name) + '‘
: ‘

‘ + p.imgEmoji + ‘

‘;

return ‘

‘ +
‘

‘ + imgHTML + ‘

‘ +
‘

‘ +
‘

‘ +
‘

‘ + esc(p.name) + ‘

‘ +
‘‘ + p.price + ‘‘ +
‘

‘ +
‘

‘ + esc(p.desc) + ‘

‘ +
‘‘ +
‘

‘ +
‘

‘;
}

// ── LOAD MORE ───────────────────────────────────────────
function loadMorePujas() {
displayCount += PER_PAGE;
renderPujas();
}
window.loadMorePujas = loadMorePujas;

// ── FILTER & SEARCH ─────────────────────────────────────
function applyFilters() {
var q = (document.getElementById(‘search-input’).value || ”).toLowerCase().trim();
var cat = document.getElementById(‘cat-filter’).value;
var sort = document.getElementById(‘sort-filter’).value;
var maxPrice = parseInt(document.getElementById(‘price-range’).value, 10);

filteredPujas = allPujas.filter(function(p) {
var matchQ = !q || p.name.toLowerCase().indexOf(q) !== -1 || p.desc.toLowerCase().indexOf(q) !== -1;
var matchCat = !cat || p.cat === cat || p.name.toLowerCase().indexOf(cat.toLowerCase()) !== -1;
var matchPrice = p.priceRaw <= maxPrice;
return matchQ && matchCat && matchPrice;
});

if (sort === 'price-asc') filteredPujas.sort(function(a,b) { return a.priceRaw – b.priceRaw; });
else if (sort === 'price-desc') filteredPujas.sort(function(a,b) { return b.priceRaw – a.priceRaw; });
else if (sort === 'name-asc') filteredPujas.sort(function(a,b) { return a.name.localeCompare(b.name); });

displayCount = PER_PAGE;
renderPujas();
updateCount();
}

function updateCount() {
var el = document.getElementById('results-count');
if (el) el.textContent = filteredPujas.length + ' Pujas Available';
}

function resetFilters() {
document.getElementById('search-input').value = '';
document.getElementById('cat-filter').value = '';
document.getElementById('sort-filter').value = 'default';
document.getElementById('price-range').value = 10000;
document.getElementById('price-display').textContent = '10,000';
filteredPujas = allPujas.slice();
displayCount = PER_PAGE;
renderPujas();
updateCount();
}
window.resetFilters = resetFilters;

function setView(v) {
currentView = v;
document.getElementById('grid-view-btn').style.background = v === 'grid' ? 'var(–saffron)' : 'var(–border)';
document.getElementById('grid-view-btn').style.color = v === 'grid' ? '#fff' : 'var(–crimson)';
document.getElementById('list-view-btn').style.background = v === 'list' ? 'var(–saffron)' : 'var(–border)';
document.getElementById('list-view-btn').style.color = v === 'list' ? '#fff' : 'var(–crimson)';
renderPujas();
}
window.setView = setView;

// ── BOOKING MODAL ───────────────────────────────────────
function openBooking(productId) {
var puja = allPujas.filter(function(p) { return p.id === productId; })[0];
if (!puja) return;
currentProduct = puja;

var modal = document.getElementById('booking-modal');
var modalName = document.getElementById('modal-puja-name');
var sumName = document.getElementById('summary-name');
var sumPrice = document.getElementById('summary-price');

if (modalName) modalName.textContent = puja.name;
if (sumName) sumName.textContent = puja.name;
if (sumPrice) sumPrice.textContent = puja.price;

// Reset form
var form = document.getElementById('booking-form');
if (form) form.reset();
clearErrors();

modal.classList.remove('hidden');
document.body.style.overflow = 'hidden';
}

function closeModal() {
var modal = document.getElementById('booking-modal');
modal.classList.add('hidden');
document.body.style.overflow = '';
currentProduct = null;
}
window.closeModal = closeModal;

// ── FORM VALIDATION ─────────────────────────────────────
function validateForm() {
var valid = true;
clearErrors();

var name = document.getElementById('f-name').value.trim();
var phone = document.getElementById('f-phone').value.trim();
var email = document.getElementById('f-email').value.trim();
var date = document.getElementById('f-date').value;

if (!name || name.length < 2) {
showFieldError('f-name', 'Please enter your full name');
valid = false;
}
if (!phone || !/^[+]?[\d\s\-]{10,14}$/.test(phone)) {
showFieldError('f-phone', 'Please enter a valid phone number');
valid = false;
}
if (!email || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
showFieldError('f-email', 'Please enter a valid email address');
valid = false;
}
if (!date) {
showFieldError('f-date', 'Please select your preferred date');
valid = false;
}

return valid;
}

function showFieldError(fieldId, msg) {
var field = document.getElementById(fieldId);
if (field) {
field.style.borderColor = '#E05000';
var err = field.nextElementSibling;
if (err && err.classList.contains('err-msg')) {
err.textContent = msg;
err.classList.remove('hidden');
}
}
}

function clearErrors() {
document.querySelectorAll('.err-msg').forEach(function(el) {
el.classList.add('hidden');
el.textContent = '';
});
document.querySelectorAll('#booking-form input, #booking-form textarea').forEach(function(el) {
el.style.borderColor = '';
});
}

// ── FORM SUBMIT ─────────────────────────────────────────
function handleSubmit(e) {
e.preventDefault();
if (!validateForm()) return;
if (!currentProduct) return;

var btn = document.getElementById('confirm-btn');
btn.textContent = 'Processing…';
btn.disabled = true;

var name = document.getElementById('f-name').value.trim();
var phone = document.getElementById('f-phone').value.trim();
var email = document.getElementById('f-email').value.trim();
var date = document.getElementById('f-date').value;
var sankalp = document.getElementById('f-sankalp').value.trim();

// ADDED — build WhatsApp message with booking details
var waMsg = encodeURIComponent(
'\uD83D\uDE4F New Puja Booking\n' +
'Puja: ' + currentProduct.name + '\n' +
'Price: ' + currentProduct.price + '\n' +
'Name: ' + name + '\n' +
'Phone: ' + phone + '\n' +
'Email: ' + email + '\n' +
'Date: ' + date + '\n' +
'Sankalp: ' + (sankalp || 'Not specified')
);
var waUrl = 'https://wa.me/919129388891?text=' + waMsg;

// ADDED — open WhatsApp in new tab immediately after validation passes
window.open(waUrl, '_blank');

// Simulate processing then redirect to WooCommerce checkout
setTimeout(function() {
closeModal();
showToast('\uD83D\uDE4F Booking received! Redirecting to payment…', 'success');

// Build WooCommerce checkout URL with product and order notes
var checkoutUrl = WC_CHECKOUT + currentProduct.id +
'&booking_name=' + encodeURIComponent(name) +
'&booking_date=' + encodeURIComponent(date) +
'&booking_phone=' + encodeURIComponent(phone);

setTimeout(function() {
window.location.href = 'https://karmasu.in/checkout/?add-to-cart=' + currentProduct.id;
}, 1500);

btn.textContent = '\uD83D\uDE4F Confirm Booking';
btn.disabled = false;
}, 1200);
}

// ── TOAST ────────────────────────────────────────────────
function showToast(msg, type) {
var container = document.getElementById('toast-container');
if (!container) return;
var t = document.createElement('div');
t.className = 'toast ' + (type || 'info');
t.innerHTML = '‘ + msg + ‘‘;
container.appendChild(t);
setTimeout(function() {
t.style.opacity = ‘0’;
t.style.transform = ‘translateX(100%)’;
t.style.transition = ‘all 0.3s ease’;
setTimeout(function() { if (t.parentNode) t.parentNode.removeChild(t); }, 300);
}, 3500);
}

// ── FAQ ──────────────────────────────────────────────────
var FAQS = [
{ q: ‘How do I book a puja online?’, a: ‘Simply browse our puja list, click “Book Now”, fill in your details including name, phone, email, and preferred date, then proceed to payment. Our team will confirm your booking within 24 hours.’ },
{ q: ‘Will I get a live video link of the puja?’, a: ‘Yes! After your booking is confirmed, we will send a WhatsApp/email link to join the puja live. You can watch and participate from anywhere in the world.’ },
{ q: ‘What is Sankalp and how should I write it?’, a: ‘Sankalp is your intention or wish for the puja. Write your name, your father\’s name, gotra (if known), and your wish (e.g., “health, wealth, marriage, business success”). Our pandit will recite it during the puja.’ },
{ q: ‘Do I need to arrange anything at home?’, a: ‘For online pujas, you just need to watch. For home puja, we provide a detailed list of samagri (materials) in advance. We also offer samagri delivery to your home.’ },
{ q: ‘Can I get a refund if I cancel?’, a: ‘Yes, 100% refund if cancelled 48 hours before the scheduled puja. 50% refund within 24 hours. No refund for same-day cancellations. Contact us on WhatsApp for quick resolution.’ },
{ q: ‘Are your pandits certified and verified?’, a: ‘Absolutely! All our pandits are graduates of recognized Vedic institutions with 5+ years of experience. We personally verify their knowledge and conduct before onboarding.’ }
];

function setupFAQ() {
var list = document.getElementById(‘faq-list’);
if (!list) return;
list.innerHTML = FAQS.map(function(f, i) {
return ‘

‘ +
‘‘ +
‘

‘ +
‘

‘ + f.a + ‘

‘ +
‘

‘ +
‘

‘;
}).join(”);

list.querySelectorAll(‘.faq-btn’).forEach(function(btn) {
btn.addEventListener(‘click’, function() {
var idx = btn.getAttribute(‘data-idx’);
var answer = btn.nextElementSibling;
var icon = btn.querySelector(‘.faq-icon’);
var isOpen = answer.classList.contains(‘open’);

// Close all
list.querySelectorAll(‘.faq-answer’).forEach(function(a) { a.classList.remove(‘open’); });
list.querySelectorAll(‘.faq-icon’).forEach(function(ic) { ic.textContent = ‘+’; ic.style.transform = ”; });

if (!isOpen) {
answer.classList.add(‘open’);
icon.textContent = ‘−’;
icon.style.transform = ‘rotate(0deg)’;
}
});
});
}

// ── EVENTS ───────────────────────────────────────────────
function setupEvents() {
// Search (debounced)
var searchInput = document.getElementById(‘search-input’);
if (searchInput) {
searchInput.addEventListener(‘input’, function() {
clearTimeout(searchTimer);
searchTimer = setTimeout(applyFilters, 300);
});
searchInput.addEventListener(‘focus’, function() {
this.style.borderColor = ‘var(–saffron)’;
this.style.boxShadow = ‘0 0 0 3px rgba(255,153,51,0.15)’;
});
searchInput.addEventListener(‘blur’, function() {
this.style.borderColor = ”;
this.style.boxShadow = ”;
});
}

var catFilter = document.getElementById(‘cat-filter’);
if (catFilter) catFilter.addEventListener(‘change’, applyFilters);

var sortFilter = document.getElementById(‘sort-filter’);
if (sortFilter) sortFilter.addEventListener(‘change’, applyFilters);

// Price range
var priceRange = document.getElementById(‘price-range’);
var priceDisplay = document.getElementById(‘price-display’);
if (priceRange) {
priceRange.addEventListener(‘input’, function() {
var v = parseInt(this.value, 10);
if (priceDisplay) priceDisplay.textContent = v.toLocaleString(‘en-IN’);
// Update gradient
var pct = (v / 10000) * 100;
this.style.background = ‘linear-gradient(90deg, var(–saffron) ‘ + pct + ‘%, var(–border) ‘ + pct + ‘%)’;
clearTimeout(searchTimer);
searchTimer = setTimeout(applyFilters, 200);
});
}

// Form submit
var form = document.getElementById(‘booking-form’);
if (form) form.addEventListener(‘submit’, handleSubmit);

// Keyboard ESC to close modal
document.addEventListener(‘keydown’, function(e) {
if (e.key === ‘Escape’) closeModal();
});

// Input focus style
document.querySelectorAll(‘#booking-form input, #booking-form textarea’).forEach(function(el) {
el.addEventListener(‘focus’, function() {
this.style.borderColor = ‘var(–saffron)’;
this.style.boxShadow = ‘0 0 0 3px rgba(255,153,51,0.15)’;
});
el.addEventListener(‘blur’, function() {
this.style.borderColor = ”;
this.style.boxShadow = ”;
});
});
}

// ── SCROLL REVEAL ────────────────────────────────────────
function setupReveal() {
if (!window.IntersectionObserver) {
document.querySelectorAll(‘.reveal’).forEach(function(el) {
el.classList.add(‘visible’);
});
return;
}
var obs = new IntersectionObserver(function(entries) {
entries.forEach(function(entry, i) {
if (entry.isIntersecting) {
setTimeout(function() {
entry.target.classList.add(‘visible’);
}, i * 80);
obs.unobserve(entry.target);
}
});
}, { rootMargin: ‘0px 0px -60px 0px’ });

document.querySelectorAll(‘.reveal’).forEach(function(el) {
obs.observe(el);
});
}

// ── PARTICLES ───────────────────────────────────────────
function createParticles() {
var container = document.getElementById(‘particles’);
if (!container) return;
for (var i = 0; i < 15; i++) {
var p = document.createElement('div');
p.className = 'particle';
p.style.left = Math.random() * 100 + '%';
p.style.bottom = '-10px';
p.style.width = (3 + Math.random() * 5) + 'px';
p.style.height = p.style.width;
p.style.animationDuration = (8 + Math.random() * 12) + 's';
p.style.animationDelay = (Math.random() * 10) + 's';
p.style.opacity = (0.3 + Math.random() * 0.6).toString();
container.appendChild(p);
}
}

// ── HELPERS ──────────────────────────────────────────────
function safeText(h) {
if (!h) return '';
var d = document.createElement('div');
d.innerHTML = String(h);
return (d.textContent || d.innerText || '').trim();
}

function esc(s) {
return String(s || '').replace(/&/g,'&').replace(/"/g,'"').replace(//g,’>’);
}

function formatPrice(n) {
if (!n || n === 0) return ‘Free’;
return ‘₹’ + Number(n).toLocaleString(‘en-IN’);
}

function getImg(post) {
try {
var m = post._embedded && post._embedded[‘wp:featuredmedia’];
if (Array.isArray(m) && m[0] && m[0].source_url) return m[0].source_url;
var s = m && m[0] && m[0].media_details && m[0].media_details.sizes;
if (s) return (s.medium_large && s.medium_large.source_url) || (s.large && s.large.source_url) || (s.medium && s.medium.source_url) || null;
} catch(e) {}
return null;
}

function getCatFromProduct(p) {
try {
var terms = p._embedded && p._embedded[‘wp:term’];
if (Array.isArray(terms)) {
for (var i = 0; i 300) {
if (stk) stk.style.display = ‘block’;
if (wa) wa.style.display = ‘flex’;
} else {
if (stk) stk.style.display = ‘none’;
if (wa) wa.style.display = ‘none’;
}
}, { passive: true });

// Initially hide sticky
var stk = document.getElementById(‘sticky-book’);
var waBtn = document.getElementById(‘wa-btn’);
if (stk) stk.style.display = ‘none’;
if (waBtn) waBtn.style.display = ‘none’;

// ── BOOT ─────────────────────────────────────────────────
if (document.readyState === ‘loading’) {
document.addEventListener(‘DOMContentLoaded’, init);
} else {
init();
}

})();

(function() {

/* ── DETAIL MODAL ─────────────────────────────────────────
Reads from already-rendered cards via data-id.
Looks up product from window.__karmasu_pujas (shared below).
Does NOT modify renderPujas or makeGridCard.
──────────────────────────────────────────────────────── */

// ADDED — expose allPujas to this script via a shared reference
// We poll until the IIFE has populated it, then wire up events.
function waitForPujas(cb, tries) {
tries = tries || 0;
if (tries > 40) return; // give up after 4 sec
if (window.__km_pujas && window.__km_pujas.length > 0) {
cb(window.__km_pujas);
} else {
setTimeout(function() { waitForPujas(cb, tries + 1); }, 100);
}
}

// ADDED — open detail modal
function openDetailModal(productId) {
var pujas = window.__km_pujas || [];
var puja = null;
for (var i = 0; i < pujas.length; i++) {
if (pujas[i].id === productId) { puja = pujas[i]; break; }
}
if (!puja) return;

// Populate
var nameEl = document.getElementById('detail-name');
var priceEl = document.getElementById('detail-price');
var descEl = document.getElementById('detail-desc');
var imgEl = document.getElementById('detail-img');
var emojiEl = document.getElementById('detail-emoji');
var catEl = document.getElementById('detail-cat');
var badgeEl = document.getElementById('detail-badge');

if (nameEl) nameEl.textContent = puja.name;
if (priceEl) priceEl.textContent = puja.price;
if (catEl) catEl.textContent = puja.cat ? ('📿 ' + puja.cat.charAt(0).toUpperCase() + puja.cat.slice(1)) : '📿 Puja';

// Description: prefer full content if available
if (descEl) descEl.textContent = puja.fullDesc || puja.desc || 'A sacred puja performed by our verified Vedic pandits.';

// Image or emoji
if (puja.img) {
if (imgEl) { imgEl.src = puja.img; imgEl.alt = puja.name; imgEl.classList.remove('hidden'); }
if (emojiEl) emojiEl.classList.add('hidden');
} else {
if (imgEl) imgEl.classList.add('hidden');
if (emojiEl) { emojiEl.textContent = puja.imgEmoji || '\uD83D\uDED5'; emojiEl.classList.remove('hidden'); }
}

// Popular badge
if (badgeEl) { puja.popular ? badgeEl.classList.remove('hidden') : badgeEl.classList.add('hidden'); }

// Book button wires to existing openBooking
var bookBtn = document.getElementById('detail-book-btn');
if (bookBtn) {
bookBtn.onclick = function() {
closeDetailModal();
if (typeof openBooking === 'function') {
setTimeout(function() { openBooking(puja.id); }, 150);
}
};
}

var modal = document.getElementById('detail-modal');
if (modal) {
modal.classList.remove('hidden');
document.body.style.overflow = 'hidden';
}
}

// ADDED — close detail modal
function closeDetailModal() {
var modal = document.getElementById('detail-modal');
if (modal) {
modal.classList.add('hidden');
document.body.style.overflow = '';
}
}

// ADDED — wire close buttons for detail modal
function setupDetailModal() {
var closeBtn = document.getElementById('detail-close-btn');
var closeBtn2 = document.getElementById('detail-close-btn2');
var overlay = document.getElementById('detail-overlay');
if (closeBtn) closeBtn.addEventListener('click', closeDetailModal);
if (closeBtn2) closeBtn2.addEventListener('click', closeDetailModal);
if (overlay) overlay.addEventListener('click', closeDetailModal);
document.addEventListener('keydown', function(e) {
if (e.key === 'Escape') closeDetailModal();
});
}

// ADDED — attach card-click → detail modal on every renderPujas call
// We use a MutationObserver on puja-grid so we catch every re-render
function setupCardClickObserver() {
var grid = document.getElementById('puja-grid');
if (!grid) return;

function attachCardClicks() {
grid.querySelectorAll('.puja-card').forEach(function(card) {
if (card.getAttribute('data-detail-bound')) return; // already bound
card.setAttribute('data-detail-bound', '1');
card.addEventListener('click', function(e) {
// Only open detail if user didn't click the Book Now button itself
if (e.target.classList.contains('book-btn') || e.target.closest('.book-btn')) return;
// Get id from the book-btn inside the card
var btn = card.querySelector('.book-btn');
if (!btn) return;
var id = parseInt(btn.getAttribute('data-id'), 10);
if (id) openDetailModal(id);
});
});
}

// Run immediately and on every DOM change inside the grid
attachCardClicks();
if (window.MutationObserver) {
var mo = new MutationObserver(function() { attachCardClicks(); });
mo.observe(grid, { childList: true, subtree: false });
}
}

/* ── FAKE SOCIAL-PROOF NOTIFICATIONS ──────────────────────
Completely independent. Shows every 5–10 sec, hides after 4 sec.
Has its own container, own styles, own data. Touches nothing else.
──────────────────────────────────────────────────────── */

// ADDED — inject notification styles
var notifStyle = document.createElement('style');
notifStyle.textContent =
'#km-notif-container{' +
'position:fixed;bottom:100px;left:20px;z-index:8888;' +
'display:flex;flex-direction:column;gap:10px;pointer-events:none' +
'}' +
'.km-notif{' +
'display:flex;align-items:center;gap:10px;' +
'background:#fff;border-radius:14px;' +
'padding:12px 16px;' +
'box-shadow:0 6px 28px rgba(0,0,0,0.16);' +
'border-left:4px solid #FF9933;' +
'font-family:Cinzel,serif;font-size:0.78rem;' +
'max-width:280px;pointer-events:none;' +
'transform:translateX(-120%);opacity:0;' +
'transition:transform 0.45s cubic-bezier(0.34,1.56,0.64,1),opacity 0.35s ease' +
'}' +
'.km-notif.show{transform:translateX(0);opacity:1}' +
'.km-notif-avatar{' +
'width:36px;height:36px;border-radius:50%;flex-shrink:0;' +
'display:flex;align-items:center;justify-content:center;' +
'font-size:1.1rem;background:linear-gradient(135deg,#FFF4E6,#FFE0A0)' +
'}' +
'.km-notif-text{flex:1;min-width:0;line-height:1.35}' +
'.km-notif-name{font-weight:700;color:#8B1A1A;font-size:0.78rem}' +
'.km-notif-action{color:#6B7280;font-size:0.7rem;font-family:Lora,serif;margin-top:1px}' +
'.km-notif-time{color:#FF9933;font-size:0.65rem;white-space:nowrap}' +
'@media(max-width:640px){#km-notif-container{left:12px;bottom:90px}.km-notif{max-width:240px}}';
document.head.appendChild(notifStyle);

// ADDED — create notification container
var notifContainer = document.createElement('div');
notifContainer.id = 'km-notif-container';
document.body.appendChild(notifContainer);

// ADDED — notification data pool
var KM_NOTIF_DATA = [
{ name: 'Rahul S.', city: 'Delhi', puja: 'Satyanarayan Puja', emoji: '\uD83D\uDE4F', ago: '2 min ago' },
{ name: 'Priya M.', city: 'Mumbai', puja: 'Lakshmi Puja', emoji: '\uD83C\uDF3A', ago: '5 min ago' },
{ name: 'Amit K.', city: 'Bangalore', puja: 'Ganesh Puja', emoji: '\uD83D\uDC18', ago: '8 min ago' },
{ name: 'Sunita R.', city: 'Jaipur', puja: 'Rudrabhishek Puja', emoji: '\uD83D\uDE4F', ago: 'Just now' },
{ name: 'Vikram P.', city: 'Pune', puja: 'Hanuman Puja', emoji: '\uD83D\uDEA9', ago: '3 min ago' },
{ name: 'Meera J.', city: 'Chennai', puja: 'Navratri Puja', emoji: '\uD83D\uDD31', ago: '1 min ago' },
{ name: 'Arjun T.', city: 'Hyderabad', puja: 'Vastu Shanti Puja', emoji: '\uD83C\uDFE1', ago: '7 min ago' },
{ name: 'Kavya N.', city: 'Kolkata', puja: 'Saraswati Puja', emoji: '\uD83D\uDCDA', ago: '4 min ago' },
{ name: 'Deepak V.', city: 'Lucknow', puja: 'Kaal Sarp Dosh Puja', emoji: '\u26A1', ago: '6 min ago' },
{ name: 'Anita S.', city: 'Bhopal', puja: 'Griha Pravesh Puja', emoji: '\uD83C\uDFE0', ago: 'Just now' }
];

var notifIdx = 0;

// ADDED — show one notification
function showFakeNotif() {
var data = KM_NOTIF_DATA[notifIdx % KM_NOTIF_DATA.length];
notifIdx++;

var el = document.createElement('div');
el.className = 'km-notif';
el.innerHTML =
'

‘ + data.emoji + ‘

‘ +
‘

‘ +
‘

‘ + data.name + ‘, ‘ + data.city + ‘

‘ +
‘

just booked ‘ + data.puja + ‘

‘ +
‘

‘ +
‘

‘ + data.ago + ‘

‘;

notifContainer.appendChild(el);

// Trigger slide-in
requestAnimationFrame(function() {
requestAnimationFrame(function() { el.classList.add(‘show’); });
});

// Auto-hide after 4 seconds
setTimeout(function() {
el.classList.remove(‘show’);
setTimeout(function() { if (el.parentNode) el.parentNode.removeChild(el); }, 450);
}, 4000);
}

// ADDED — schedule notifications randomly every 5–10 sec
function scheduleNextNotif() {
var delay = 5000 + Math.floor(Math.random() * 5000); // 5000–10000 ms
setTimeout(function() {
showFakeNotif();
scheduleNextNotif(); // chain next one
}, delay);
}

/* ── BOOT (this independent script) ───────────────────── */
function addedInit() {
setupDetailModal();
setupCardClickObserver();

// Start notifications after 6 sec so they don’t clash with page load
setTimeout(function() {
showFakeNotif(); // first one
scheduleNextNotif(); // then random loop
}, 6000);

// ADDED — expose allPujas bridge:
// The existing IIFE doesn’t expose allPujas globally,
// so we patch renderPujas via MutationObserver on the grid
// to capture puja ids from rendered book-btn data-id attributes,
// then cross-reference with the fallback data.
// This is read-only and does not modify any existing function.
(function bridgePujas() {
var grid = document.getElementById(‘puja-grid’);
if (!grid) { setTimeout(bridgePujas, 200); return; }

function extractPujas() {
var btns = grid.querySelectorAll(‘.book-btn[data-id]’);
if (!btns.length) return;
// If we already have them all, skip
if (window.__km_pujas && window.__km_pujas.length >= btns.length) return;

// Build lightweight puja list from DOM + fallback data
var FALLBACK = [
{ id:1, name:’Satyanarayan Puja’, price:’Rs.2,100′, priceRaw:2100, cat:’satyanarayan’, desc:’Complete Satyanarayan Katha with prasad.’, imgEmoji:’\uD83D\uDED5′, popular:true, img:null },
{ id:2, name:’Lakshmi Puja’, price:’Rs.1,501′, priceRaw:1501, cat:’lakshmi’, desc:’Mahalakshmi Puja for wealth and prosperity.’, imgEmoji:’\uD83C\uDF3A’, popular:true, img:null },
{ id:3, name:’Ganesh Puja’, price:’Rs.1,100′, priceRaw:1100, cat:’ganesh’, desc:’Remove obstacles with Ganpati Puja.’, imgEmoji:’\uD83D\uDC18′, popular:false, img:null },
{ id:4, name:’Rudrabhishek Puja’, price:’Rs.3,100′, priceRaw:3100, cat:’shiva’, desc:’Powerful Shiva puja with milk and honey.’, imgEmoji:’\uD83D\uDE4F’, popular:true, img:null },
{ id:5, name:’Hanuman Puja’, price:’Rs.801′, priceRaw:801, cat:’hanuman’, desc:’Hanuman Chalisa path with Sundarkand.’, imgEmoji:’\uD83D\uDEA9′, popular:false, img:null },
{ id:6, name:’Navratri Puja’, price:’Rs.5,100′, priceRaw:5100, cat:’navratri’, desc:’9 days Navratri puja with Durga Saptashati.’, imgEmoji:’\uD83D\uDD31′, popular:true, img:null },
{ id:7, name:’Vastu Shanti Puja’, price:’Rs.7,500′, priceRaw:7500, cat:’vastu’, desc:’Complete Vastu Shanti puja for new home.’, imgEmoji:’\uD83C\uDFE1′, popular:false, img:null },
{ id:8, name:’Kaal Sarp Dosh Puja’, price:’Rs.11,000′,priceRaw:11000, cat:’shiva’, desc:’Powerful puja to remove Kaal Sarp Dosh.’, imgEmoji:’\uD83D\uDC0D’, popular:false, img:null },
{ id:9, name:’Griha Pravesh Puja’, price:’Rs.4,500′, priceRaw:4500, cat:’vastu’, desc:’Auspicious puja for entering new home.’, imgEmoji:’\uD83C\uDFE0′, popular:false, img:null },
{ id:10, name:’Baglamukhi Puja’, price:’Rs.8,100′, priceRaw:8100, cat:’navratri’, desc:’For victory in court cases and obstacles.’, imgEmoji:’\u26A1′, popular:false, img:null },
{ id:11, name:’Surya Namaskar Puja’, price:’Rs.1,001′, priceRaw:1001, cat:’shiva’, desc:’Sun god puja for health and vitality.’, imgEmoji:’\u2600\uFE0F’, popular:false, img:null },
{ id:12, name:’Saraswati Puja’, price:’Rs.1,251′, priceRaw:1251, cat:’lakshmi’, desc:’Goddess of knowledge puja for students.’, imgEmoji:’\uD83D\uDCDA’, popular:false, img:null }
];

var map = {};
FALLBACK.forEach(function(p) { map[p.id] = p; });

var found = [];
btns.forEach(function(btn) {
var id = parseInt(btn.getAttribute(‘data-id’), 10);
if (map[id]) { found.push(map[id]); }
else { found.push({ id:id, name:’Puja ‘+id, price:”, priceRaw:0, cat:”, desc:”, imgEmoji:’\uD83D\uDE4F’, popular:false, img:null }); }
});
window.__km_pujas = found;
}

extractPujas();
if (window.MutationObserver) {
var mo = new MutationObserver(extractPujas);
mo.observe(grid, { childList: true, subtree: true });
}
})();
}

if (document.readyState === ‘loading’) {
document.addEventListener(‘DOMContentLoaded’, addedInit);
} else {
addedInit();
}

})();

Showing 1–12 of 22 results

App Download