// ══ EDIT YOUR PLANS HERE ═══════════════════════════════════════════════ // Everything the page shows about plans comes from this block. // `monthly` is the price for one month in rupees; longer periods apply the discount in PERIODS. var PERIODS = [ { id: 'monthly', label: 'Monthly', months: 1, off: 0 }, { id: 'quarterly', label: 'Quarterly', months: 3, off: 0.10 }, { id: 'yearly', label: 'Yearly', months: 12, off: 0.20 } ]; var DEFAULT_PERIOD = 'yearly'; var PLANS = [ { id: 'trial', name: 'Trial', blurb: 'Try it on one real event.', monthly: 0, trialDays: 7, points: ['1 event', 'Up to 500 photos', 'Selfie photo search'], cta: 'Start free trial' }, { id: 'starter', name: 'Starter', blurb: 'For a studio shooting a few events a month.', monthly: 899, points: ['Up to 10 events', '100 GB photo storage', 'Selfie photo search'], cta: 'Get a quote' }, { id: 'growth', name: 'Growth', blurb: 'For busy studios in wedding season.', monthly: 1499, featured: true, points: ['Up to 50 events', '500 GB photo storage', 'Selfie photo search'], cta: 'Get a quote' }, { id: 'pro', name: 'Pro', blurb: 'For teams with several shooters.', monthly: 2499, points: ['Unlimited events', '1 TB photo storage', 'Selfie photo search'], cta: 'Get a quote' } ]; var FEATURED_LABEL = 'Recommended'; var TAX_NOTE = 'Prices are in Indian rupees. Taxes extra where applicable.'; var SIGNUP_URL = '/index.html#signup'; // ════════════════════════════════════════════════════════════════════════ // Refuse to run inside another site's frame if (window.top !== window.self) { document.documentElement.style.display = 'none'; try { window.top.location = window.self.location.href; } catch (e) {} throw new Error('PicSpot AI cannot be shown inside another site.'); } var CHECK = ''; function el(tag, className, text) { var node = document.createElement(tag); if (className) node.className = className; if (text != null) node.textContent = text; return node; } function rupees(n) { return '₹' + Math.round(n).toLocaleString('en-IN'); } var current = DEFAULT_PERIOD; function renderPeriods() { var box = document.getElementById('periods'); box.innerHTML = ''; PERIODS.forEach(function (p) { var btn = el('button', 'period', p.label); btn.type = 'button'; btn.setAttribute('aria-pressed', String(p.id === current)); if (p.off) btn.appendChild(el('span', 'save', t('Save {n}%', { n: Math.round(p.off * 100) }))); btn.addEventListener('click', function () { current = p.id; renderPeriods(); renderPlans(); }); box.appendChild(btn); }); } function renderPlans() { var period = PERIODS.filter(function (p) { return p.id === current; })[0] || PERIODS[0]; var box = document.getElementById('plans'); box.innerHTML = ''; PLANS.forEach(function (plan) { var card = el('article', 'plan' + (plan.featured ? ' featured' : '')); if (plan.featured) card.appendChild(el('div', 'flag', FEATURED_LABEL)); card.appendChild(el('h2', '', plan.name)); card.appendChild(el('p', 'for', plan.blurb)); var price = el('div', 'price'); var billed = el('p', 'billed'); if (!plan.monthly) { price.appendChild(el('strong', '', 'Free')); price.appendChild(el('span', '', t('for {n} days', { n: plan.trialDays }))); billed.textContent = 'No card needed'; } else { var perMonth = Math.round(plan.monthly * (1 - period.off)); price.appendChild(el('strong', '', rupees(perMonth))); price.appendChild(el('span', '', 'a month')); billed.textContent = period.months === 1 ? 'Billed every month' : period.months === 12 ? t('Billed {amount} once a year', { amount: rupees(perMonth * 12) }) : t('Billed {amount} every {n} months', { amount: rupees(perMonth * period.months), n: period.months }); } card.appendChild(price); card.appendChild(billed); var list = el('ul'); plan.points.forEach(function (text) { var li = el('li'); li.innerHTML = CHECK; li.appendChild(el('span', '', text)); list.appendChild(li); }); card.appendChild(list); var cta = el('a', 'btn ' + (plan.featured ? 'btn-primary' : 'btn-quiet'), plan.cta); // The free trial goes to sign-up. Paid plans open the quote form with that plan chosen; there is no online payment. if (plan.monthly) { cta.href = '#quote'; cta.addEventListener('click', function (e) { e.preventDefault(); chooseQuotePlan(plan.id, true); }); } else { cta.href = SIGNUP_URL; } card.appendChild(cta); box.appendChild(card); }); } document.getElementById('tax-note').textContent = TAX_NOTE; document.querySelectorAll('.year').forEach(function (n) { n.textContent = new Date().getFullYear(); }); renderPeriods(); renderPlans(); // ==================== PLAN SLIDER (phones) ==================== var plansBox = document.getElementById('plans'); function cards() { return Array.prototype.slice.call(plansBox.querySelectorAll('.plan')); } function currentCard() { var mid = plansBox.scrollLeft + plansBox.clientWidth / 2, best = 0, bestGap = Infinity; cards().forEach(function (c, i) { var gap = Math.abs(c.offsetLeft + c.offsetWidth / 2 - mid); if (gap < bestGap) { bestGap = gap; best = i; } }); return best; } function showPos() { document.getElementById('plan-pos').textContent = (currentCard() + 1) + ' / ' + cards().length; } function slideTo(i) { var list = cards(); i = Math.max(0, Math.min(list.length - 1, i)); plansBox.scrollTo({ left: list[i].offsetLeft - (plansBox.clientWidth - list[i].offsetWidth) / 2, behavior: 'smooth' }); } document.getElementById('plan-prev').addEventListener('click', function () { slideTo(currentCard() - 1); }); document.getElementById('plan-next').addEventListener('click', function () { slideTo(currentCard() + 1); }); plansBox.addEventListener('scroll', function () { window.requestAnimationFrame(showPos); }, { passive: true }); // Open on the recommended plan setTimeout(function () { var featured = PLANS.findIndex(function (p) { return p.featured; }); if (featured > 0 && plansBox.scrollWidth > plansBox.clientWidth) { plansBox.scrollLeft = cards()[featured].offsetLeft - (plansBox.clientWidth - cards()[featured].offsetWidth) / 2; } showPos(); }, 0); // ==================== QUOTE FORM ==================== // Nothing is sent to a server. The enquiry opens in WhatsApp or the email app, ready to send. var C = window.SITE_CONTACT || {}; var waNumber = String(C.whatsapp || '').replace(/\D/g, ''); var quotePlan = 'unsure'; var QUOTE_PLANS = PLANS.filter(function (p) { return p.monthly; }).map(function (p) { return [p.id, p.name]; }).concat([['unsure', 'Not sure, help me choose']]); function renderChips() { var box = document.getElementById('q-plans'); box.innerHTML = ''; QUOTE_PLANS.forEach(function (pair) { var chip = el('button', 'chip', pair[1]); chip.type = 'button'; chip.setAttribute('aria-pressed', String(pair[0] === quotePlan)); chip.addEventListener('click', function () { quotePlan = pair[0]; renderChips(); }); box.appendChild(chip); }); } function chooseQuotePlan(id, jump) { quotePlan = id; renderChips(); if (jump) { document.getElementById('quote').scrollIntoView({ behavior: 'smooth', block: 'start' }); setTimeout(function () { document.getElementById('q-name').focus({ preventScroll: true }); }, 450); } } renderChips(); // Where to reach us, shown beside the form and in the phone dock if (waNumber) { document.getElementById('reach-wa').hidden = false; var waLink = document.getElementById('reach-wa-link'); waLink.href = 'https://wa.me/' + waNumber; waLink.textContent = C.phone || '+' + waNumber; var dockWa = document.getElementById('dock-wa'); dockWa.hidden = false; dockWa.href = 'https://wa.me/' + waNumber + '?text=' + encodeURIComponent('Hello PicSpot AI, I would like to know more about your plans.'); } if (C.email) { document.getElementById('reach-mail').hidden = false; var mailLink = document.getElementById('reach-mail-link'); mailLink.href = 'mailto:' + C.email; mailLink.textContent = C.email; } document.getElementById('q-whatsapp').hidden = !waNumber; document.getElementById('q-email-btn').hidden = !C.email; if (!waNumber && !C.email) { document.getElementById('q-help').hidden = true; quoteNote(t('Quote requests are not connected yet.')); } function quoteNote(text, ok) { var n = document.getElementById('q-note'); n.textContent = text || ''; n.className = 'q-note full' + (ok ? ' ok' : ''); n.hidden = !text; } function v(id) { return document.getElementById(id).value.trim(); } // The message the studio sends us. Field names stay in English so every enquiry reads the same on our side. function buildEnquiry() { var name = v('q-name'), phone = v('q-phone'); if (!name || !phone) { quoteNote(t('Enter your name and phone number.')); document.getElementById(name ? 'q-phone' : 'q-name').focus(); return null; } if (phone.replace(/\D/g, '').length < 8) { quoteNote(t('Enter a valid phone number.')); document.getElementById('q-phone').focus(); return null; } var plan = QUOTE_PLANS.filter(function (p) { return p[0] === quotePlan; })[0]; var period = PERIODS.filter(function (p) { return p.id === current; })[0]; var lines = [ 'Hello PicSpot AI, I would like a quote.', '', 'Name: ' + name, 'Phone / WhatsApp: ' + phone ]; if (v('q-email')) lines.push('Email: ' + v('q-email')); if (v('q-studio')) lines.push('Studio: ' + v('q-studio')); lines.push('Events: ' + document.getElementById('q-type').value); lines.push('Plan: ' + (quotePlan === 'unsure' ? 'Not sure, help me choose' : plan[1] + ' (' + period.label.toLowerCase() + ' billing)')); if (v('q-details')) lines.push('', v('q-details')); quoteNote(''); return { subject: 'Quote request: ' + (v('q-studio') || name), body: lines.join('\n') }; } document.getElementById('quote-form').addEventListener('submit', function (e) { e.preventDefault(); if (!waNumber) return; var m = buildEnquiry(); if (!m) return; window.open('https://wa.me/' + waNumber + '?text=' + encodeURIComponent(m.body), '_blank', 'noopener'); quoteNote(t('WhatsApp should now be open with the message. Press send there to deliver it.'), true); }); document.getElementById('q-email-btn').addEventListener('click', function () { if (!C.email) return; var m = buildEnquiry(); if (!m) return; window.location.href = 'mailto:' + C.email + '?subject=' + encodeURIComponent(m.subject) + '&body=' + encodeURIComponent(m.body); quoteNote(t('Your email app should now be open with the message. Press send there to deliver it.'), true); });