Today’s Spice Rush Deal

Hot picks cool down in --:--:--

Diet
5

Loading...

    Product image

    Item

    Category

    Veg

    Description

    Price

    ₹0

    Spice Visual

    Cookie preferences

    `; }); fetch('./footer.html').then(r=> r.ok?r.text():Promise.reject()).then(html=>{ footerMount.innerHTML = html; }).catch(()=>{ footerMount.innerHTML = ` `; }); } function initTheme(){ const btn = byId('themeToggle'); const icon = byId('themeIcon'); function setIcon(){ const isDark = document.documentElement.classList.contains('dark'); icon.innerHTML = isDark ? '' : ''; } btn.addEventListener('click', ()=>{ const isDark = document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', isDark?'dark':'light'); setIcon(); }); setIcon(); } function initDealTimer(){ const el = byId('dealTimer'); function update(){ const now = new Date(); const end = new Date(); end.setHours(23,59,59,999); let ms = end-now; if(ms<0) ms=0; const h = String(Math.floor(ms/3600000)).padStart(2,'0'); const m = String(Math.floor((ms%3600000)/60000)).padStart(2,'0'); const s = String(Math.floor((ms%60000)/1000)).padStart(2,'0'); el.textContent = `${h}:${m}:${s}`; } update(); setInterval(update, 1000); } function initCookies(){ const prefs = readLS('cookiePrefs-v1', null); const banner = byId('cookieBanner'); const dlg = byId('cookieDialog'); const showBanner = prefs===null; if(showBanner) banner.classList.remove('hidden'); byId('cookieAcceptAll').onclick = ()=>{ saveLS('cookiePrefs-v1',{necessary:true, analytics:true, marketing:true}); banner.classList.add('hidden'); }; byId('cookieReject').onclick = ()=>{ saveLS('cookiePrefs-v1',{necessary:true, analytics:false, marketing:false}); banner.classList.add('hidden'); }; byId('cookieManage').onclick = ()=> dlg.showModal(); byId('cookieDlgClose').onclick = ()=> dlg.close(); const p = readLS('cookiePrefs-v1', {necessary:true, analytics:false, marketing:false}); byId('ckAnalytics').checked = !!p.analytics; byId('ckMarketing').checked = !!p.marketing; byId('cookieSave').onclick = ()=>{ saveLS('cookiePrefs-v1',{necessary:true, analytics:byId('ckAnalytics').checked, marketing:byId('ckMarketing').checked}); dlg.close(); banner.classList.add('hidden'); }; } function bindControls(){ byId('searchInput').addEventListener('input', debounce(e=>{ state.q=e.target.value; state.page=1; applyFilters(); }, 250)); $$('input[name="diet"]').forEach(r=> r.addEventListener('change', e=>{ state.diet=e.target.value; state.page=1; applyFilters(); })); byId('categorySelect').addEventListener('change', e=>{ state.category=e.target.value; state.page=1; applyFilters(); }); byId('spiceRange').addEventListener('input', e=>{ state.spiceMax=Number(e.target.value); byId('spiceOut').textContent=String(state.spiceMax); state.page=1; applyFilters(); }); byId('priceMin').addEventListener('change', e=>{ state.priceMin = Number(e.target.value||0); state.page=1; applyFilters(); }); byId('priceMax').addEventListener('change', e=>{ state.priceMax = Number(e.target.value||999999); state.page=1; applyFilters(); }); byId('sortSelect').addEventListener('change', e=>{ state.sort=e.target.value; state.page=1; applyFilters(); }); byId('favOnly').addEventListener('change', e=>{ state.favOnly=e.target.checked; state.page=1; applyFilters(); }); byId('pageSize').addEventListener('change', e=>{ state.pageSize=Number(e.target.value); state.page=1; applyFilters(); }); byId('prevPage').addEventListener('click', ()=>{ if(state.page>1){ state.page--; applyFilters(); }}); byId('nextPage').addEventListener('click', ()=>{ state.page++; applyFilters(); }); byId('gridMode').addEventListener('click', ()=>{ state.view='grid'; applyFilters(); }); byId('listMode').addEventListener('click', ()=>{ state.view='list'; applyFilters(); }); byId('resetFiltersBtn').addEventListener('click', ()=>{ byId('searchInput').value=''; state.q=''; byId('dietAll').checked = true; state.diet='all'; byId('categorySelect').value='all'; state.category='all'; byId('spiceRange').value=5; state.spiceMax=5; byId('spiceOut').textContent='5'; setPriceBounds(); byId('sortSelect').value='pop'; state.sort='pop'; byId('favOnly').checked=false; state.favOnly=false; byId('pageSize').value='8'; state.pageSize=8; state.page=1; applyFilters(); }); byId('dlgClose').addEventListener('click', closeDialog); byId('itemDialog').addEventListener('click', (e)=>{ if(e.target.id==='itemDialog') closeDialog(); }); byId('notifyForm').addEventListener('submit', (e)=>{ e.preventDefault(); const email = byId('notifyEmail').value.trim(); const msg = byId('notifyMsg'); const re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; if(!re.test(email)){ msg.textContent = 'Please enter a valid email.'; msg.className = 'text-sm mt-2 text-rose-600'; return; } msg.textContent = 'You are subscribed! We\'ll keep you posted on hot deals.'; msg.className = 'text-sm mt-2 text-emerald-600'; }); } async function loadData(){ try{ const res = await fetch('./catalog.json', {cache:'no-cache'}); if(!res.ok) throw new Error('Failed to load catalog.json'); const json = await res.json(); const items = Array.isArray(json)? json : (Array.isArray(json.items)? json.items : []); DATA = items.map((it,idx)=>({ id: it.id ?? String(idx+1), name: it.name ?? 'Item', description: it.description ?? '', image: it.image ?? './images/maximum_ditailes_of_this_image.delicious_stone_baked_pizza_on_wooden_peel_with_fresh_basil_and_melting_cheese_closeup_photography.jpg', price: Number(it.price ?? 0), category: it.category ?? 'General', veg: !!(it.veg ?? (it.type? String(it.type).toLowerCase()==='veg': true)), spiceLevel: Number(it.spiceLevel ?? 0), tags: Array.isArray(it.tags)? it.tags : [], rating: typeof it.rating==='number'? it.rating : (3 + Math.random()*2) })); }catch(err){ DATA = [ { id: 'd1', name: 'Margherita Supreme', description: 'Classic stone-baked base, San Marzano sauce, fresh mozzarella, basil and a drizzle of extra virgin olive oil.', image: './images/maximum_ditailes_of_this_image.margherita_pizza_with_fresh_basil_mozzarella_on_wooden_board_rustic_style_closeup.jpg', price: 299, category: 'Pizzas', veg: true, spiceLevel: 0, tags: ['classic','italian','cheese'], rating: 4.6 }, { id: 'd2', name: 'Tandoori Chicken Blaze', description: 'Smoky tandoori chicken, onions, peppers and mint mayo swirl on our signature crust.', image: './images/maximum_ditailes_of_this_image.tandoori_chicken_pizza_with_onions_and_peppers_smoky_grill_marks_closeup.jpg', price: 449, category: 'Pizzas', veg: false, spiceLevel: 3, tags: ['chicken','tandoori','spicy'], rating: 4.4 }, { id: 'd3', name: 'Peri-Peri Paneer Sizzler', description: 'Cottage cheese cubes tossed in peri-peri spice, roasted corn, olives and jalapeños.', image: './images/maximum_ditailes_of_this_image.paneer_pizza_with_jalapenos_and_olives_spicy_closeup_vibrant_colors.jpg', price: 399, category: 'Pizzas', veg: true, spiceLevel: 4, tags: ['paneer','peri-peri','hot'], rating: 4.5 }, { id: 'd4', name: 'Garlic Bread Sticks', description: 'Buttery, garlicky sticks with herbed seasoning and parmesan sprinkle.', image: './images/maximum_ditailes_of_this_image.garlic_bread_sticks_with_herbs_and_parmesan_on_wooden_board.jpg', price: 149, category: 'Sides', veg: true, spiceLevel: 0, tags: ['bread','side'], rating: 4.2 }, { id: 'd5', name: 'Jalapeño Cheese Dip', description: 'Creamy cheese dip infused with pickled jalapeños for an extra kick.', image: './images/maximum_ditailes_of_this_image.jalapeno_cheese_dip_in_ceramic_bowl_creamy_spicy_closeup.jpg', price: 79, category: 'Dips', veg: true, spiceLevel: 2, tags: ['dip','jalapeno'], rating: 4.1 }, { id: 'd6', name: 'Sparkling Lemon Fizz', description: 'Refreshing lemon beverage with a tingle of mint.', image: './images/maximum_ditailes_of_this_image.sparkling_lemon_drink_with_mint_in_glass_condensation_macro.jpg', price: 99, category: 'Beverages', veg: true, spiceLevel: 0, tags: ['drink','lemon'], rating: 4.0 } ]; } buildCategories(); setPriceBounds(); applyFilters(); } function injectJSONLD(){ const ld = { "@context":"https://schema.org", "@type":"CollectionPage", "name":"Menu Catalog — White Crust Pizzeria India", "description":"Browse the full White Crust Pizzeria India menu. Filter veg/non-veg, spice, categories and find your perfect pizza.", "isPartOf":{"@type":"WebSite","name":"White Crust Pizzeria India"}, "publisher":{"@type":"Organization","name":"White Crust Pizzeria India","telephone":"+91-8923564137","brand":{"@type":"Brand","name":"White Crust"}}, "inLanguage":"en-IN" }; const s = document.createElement('script'); s.type='application/ld+json'; s.textContent = JSON.stringify(ld); document.head.appendChild(s); } document.addEventListener('DOMContentLoaded', ()=>{ injectJSONLD(); initHeaderFooter(); initTheme(); initDealTimer(); initCookies(); FAVORITES = new Set(readLS('favItems-v1', [])); bindControls(); loadData(); });