Mystic Hearth Baking Studio

The course pantry

Find a bake worth making twice.

Explore clear, kitchen-tested lessons for bread, pastry, fermentation, and seasonal baking.

View Fallows

Loading the course pantry.

`; const footerHTML=``; headerContainer.innerHTML=headerHTML; footerContainer.innerHTML=footerHTML; const html=document.documentElement; const themeKey='mh-theme'; function applyTheme(t){if(t==='dark'){html.classList.add('dark');}else{html.classList.remove('dark');}} const saved=localStorage.getItem(themeKey); if(saved){applyTheme(saved);}else{applyTheme('light');} const toggle=document.getElementById('theme-toggle'); if(toggle){toggle.addEventListener('click',()=>{const cur=html.classList.contains('dark')?'dark':'light';const next=cur==='dark'?'light':'dark';localStorage.setItem(themeKey,next);applyTheme(next);});} const mobileBtn=document.getElementById('mobile-menu-toggle'); const mobileNav=document.getElementById('mobile-menu'); if(mobileBtn&&mobileNav){mobileBtn.addEventListener('click',()=>{mobileNav.classList.toggle('hidden');});} const authOpen=document.getElementById('auth-open'); const authModal=document.getElementById('auth-modal'); const authClose=document.getElementById('auth-close'); if(authOpen&&authModal){authOpen.addEventListener('click',()=>{authModal.classList.remove('hidden');authModal.classList.add('grid');});} if(authClose&&authModal){authClose.addEventListener('click',()=>{authModal.classList.remove('grid');authModal.classList.add('hidden');});} if(authModal){authModal.addEventListener('click',(e)=>{if(e.target===authModal){authModal.classList.remove('grid');authModal.classList.add('hidden');}});} const banner=document.getElementById('cookie-banner'); const acceptBtn=document.getElementById('cookie-accept'); const key='mh-cookie-consent'; if(localStorage.getItem(key)==='accepted'&&banner){banner.style.display='none';} if(acceptBtn&&banner){acceptBtn.addEventListener('click',()=>{localStorage.setItem(key,'accepted');banner.style.display='none';});} const courses=[ {"id":"c1","title":"Sourdough Fundamentals","category":"Bread","level":"Beginner","duration":"6 weeks","price":145,"currency":"USD","description":"Master the art of naturally leavened bread with step-by-step guidance on starter maintenance, mixing, and baking.","lessons":["Starter creation","Autolyse technique","Shaping boules","Oven spring mastery"],"format":"Self-paced video"}, {"id":"c2","title":"Rye & Ancient Grains","category":"Bread","level":"Intermediate","duration":"4 weeks","price":165,"currency":"USD","description":"Explore heritage flours and dense, flavorful loaves that celebrate regional traditions.","lessons":["Rye starter care","Spelt incorporation","Crumb structure","Long fermentation"],"format":"Live sessions"}, {"id":"c3","title":"Croissant & Laminated Doughs","category":"Pastry","level":"Intermediate","duration":"5 weeks","price":195,"currency":"USD","description":"Create buttery, flaky pastries with precise lamination techniques and professional finishing.","lessons":["Butter block prep","Turns and resting","Egg wash secrets","Flavor variations"],"format":"Self-paced video"}, {"id":"c4","title":"Seasonal Fruit Tarts","category":"Pastry","level":"Beginner","duration":"3 weeks","price":115,"currency":"USD","description":"Design and bake beautiful tarts that highlight the best produce of each season.","lessons":["Pastry cream","Blind baking","Fruit arrangement","Glazing methods"],"format":"Self-paced video"}, {"id":"c5","title":"Fermentation Science","category":"Fermentation","level":"Advanced","duration":"8 weeks","price":225,"currency":"USD","description":"Deep dive into microbial activity, flavor development, and controlled fermentation environments.","lessons":["Wild yeast isolation","Temperature control","Flavor profiling","Safety protocols"],"format":"Live sessions"}, {"id":"c6","title":"Holiday Panettone","category":"Seasonal","level":"Advanced","duration":"6 weeks","price":210,"currency":"USD","description":"Craft traditional Italian enriched bread with candied fruit and perfect structure for celebrations.","lessons":["Big dough method","Fruit preparation","Proofing schedule","Scoring & baking"],"format":"Self-paced video"}, {"id":"c7","title":"Everyday Sandwich Loaves","category":"Bread","level":"Beginner","duration":"4 weeks","price":125,"currency":"USD","description":"Reliable, soft sandwich breads perfect for daily family use and simple lunches.","lessons":["Enriched dough basics","Milk bread variations","Braiding techniques","Storage solutions"],"format":"Self-paced video"}, {"id":"c8","title":"Chocolate & Nut Pastries","category":"Pastry","level":"Intermediate","duration":"5 weeks","price":175,"currency":"USD","description":"Elevate viennoiserie with premium chocolate and toasted nuts for luxurious results.","lessons":["Chocolate tempering","Nut paste filling","Lamination layers","Finishing touches"],"format":"Live sessions"}, {"id":"c9","title":"Kimchi & Vegetable Ferments","category":"Fermentation","level":"Beginner","duration":"3 weeks","price":95,"currency":"USD","description":"Learn safe, delicious vegetable fermentation for vibrant condiments and side dishes.","lessons":["Brine ratios","Jar packing","Fermentation timeline","Flavor balancing"],"format":"Self-paced video"}, {"id":"c10","title":"Pumpkin & Spice Bakes","category":"Seasonal","level":"Intermediate","duration":"4 weeks","price":135,"currency":"USD","description":"Celebrate autumn with spiced breads, rolls, and pies that warm any kitchen.","lessons":["Pumpkin puree prep","Spice blending","Pie crust mastery","Decorative finishes"],"format":"Self-paced video"}, {"id":"c11","title":"Ciabatta & Rustic Italian","category":"Bread","level":"Intermediate","duration":"5 weeks","price":155,"currency":"USD","description":"High-hydration doughs yielding open crumb and crisp crusts for authentic Italian loaves.","lessons":["Poolish building","High hydration handling","Steam baking","Cooling process"],"format":"Live sessions"}, {"id":"c12","title":"Macarons & Meringue Basics","category":"Pastry","level":"Advanced","duration":"4 weeks","price":185,"currency":"USD","description":"Achieve consistent shells, perfect feet, and creative fillings with meringue mastery.","lessons":["Meringue stages","Macaronage method","Filling recipes","Storage tips"],"format":"Self-paced video"}, {"id":"c13","title":"Kombucha & Beverage Ferments","category":"Fermentation","level":"Beginner","duration":"3 weeks","price":105,"currency":"USD","description":"Brew and flavor your own probiotic beverages with safe, repeatable methods.","lessons":["SCOBY care","First fermentation","Flavoring batches","Bottling & carbonation"],"format":"Self-paced video"}, {"id":"c14","title":"Winter Spice Breads","category":"Seasonal","level":"Intermediate","duration":"5 weeks","price":145,"currency":"USD","description":"Warm, aromatic loaves and rolls ideal for the colder months and holiday tables.","lessons":["Spice infusion","Enriched doughs","Plaited shapes","Glaze applications"],"format":"Live sessions"}, {"id":"c15","title":"Focaccia & Flatbreads","category":"Bread","level":"Beginner","duration":"3 weeks","price":110,"currency":"USD","description":"Create versatile, dimpled flatbreads with endless topping possibilities.","lessons":["Dough hydration","Dimpling technique","Topping ideas","Herb infusions"],"format":"Self-paced video"}, {"id":"c16","title":"Puff Pastry Classics","category":"Pastry","level":"Advanced","duration":"6 weeks","price":205,"currency":"USD","description":"Master full and rough puff techniques for vol-au-vents, turnovers, and more.","lessons":["Butter incorporation","Folding methods","Blind baking","Savory & sweet fillings"],"format":"Self-paced video"}, {"id":"c17","title":"Miso & Soy Ferments","category":"Fermentation","level":"Intermediate","duration":"5 weeks","price":165,"currency":"USD","description":"Explore Japanese fermentation traditions for umami-rich condiments and dishes.","lessons":["Koji cultivation","Miso packing","Aging timelines","Recipe applications"],"format":"Live sessions"}, {"id":"c18","title":"Spring Flower Cakes","category":"Seasonal","level":"Intermediate","duration":"4 weeks","price":140,"currency":"USD","description":"Delicate cakes and pastries featuring edible flowers and light spring flavors.","lessons":["Flower sourcing","Cake batter balance","Assembly techniques","Edible decoration"],"format":"Self-paced video"}, {"id":"c19","title":"Bagels & Boiled Breads","category":"Bread","level":"Intermediate","duration":"4 weeks","price":130,"currency":"USD","description":"Achieve chewy texture and shiny crusts with traditional boiling methods.","lessons":["Sponge starter","Boiling process","Seed toppings","Storage methods"],"format":"Self-paced video"}, {"id":"c20","title":"Opera & Layered Cakes","category":"Pastry","level":"Advanced","duration":"7 weeks","price":230,"currency":"USD","description":"Professional layered cakes with precise ganache, sponge, and assembly skills.","lessons":["Sponge baking","Ganache control","Layer stacking","Mirror glaze"],"format":"Live sessions"}, {"id":"c21","title":"Pickles & Quick Ferments","category":"Fermentation","level":"Beginner","duration":"2 weeks","price":85,"currency":"USD","description":"Fast, flavorful pickles and short ferments for immediate kitchen use.","lessons":["Brine formulas","Vegetable prep","Quick fermentation","Flavor experiments"],"format":"Self-paced video"}, {"id":"c22","title":"Harvest Grain Loaves","category":"Seasonal","level":"Intermediate","duration":"5 weeks","price":150,"currency":"USD","description":"Nutritious multi-grain breads celebrating late-summer and autumn harvests.","lessons":["Grain soaking","Blend ratios","Crust development","Slicing & serving"],"format":"Live sessions"} ]; const grid=document.getElementById('catalog-grid'); const status=document.getElementById('catalog-status'); const searchInput=document.getElementById('catalog-search'); const categorySelect=document.getElementById('catalog-category'); const pagination=document.getElementById('pagination'); const modal=document.getElementById('course-modal'); const modalClose=document.getElementById('modal-close'); const modalTitle=document.getElementById('modal-title'); const modalCategory=document.getElementById('modal-category'); const modalDescription=document.getElementById('modal-description'); const modalLessons=document.getElementById('modal-lessons'); const modalCart=document.getElementById('modal-cart'); const modalFollow=document.getElementById('modal-follow'); let currentPage=1; const perPage=6; let filteredCourses=courses; function populateCategories(){ const cats=[...new Set(courses.map(c=>c.category))].sort(); cats.forEach(cat=>{ const opt=document.createElement('option'); opt.value=cat; opt.textContent=cat; categorySelect.appendChild(opt); }); } function filterCourses(){ const term=searchInput.value.toLowerCase().trim(); const cat=categorySelect.value; filteredCourses=courses.filter(c=>{ const matchTerm=c.title.toLowerCase().includes(term)||c.description.toLowerCase().includes(term); const matchCat=cat==='all'||c.category===cat; return matchTerm&&matchCat; }); currentPage=1; renderGrid(); } function renderGrid(){ grid.innerHTML=''; status.textContent=''; if(filteredCourses.length===0){ status.textContent='No courses match your filters.'; pagination.innerHTML=''; return; } const start=(currentPage-1)*perPage; const pageCourses=filteredCourses.slice(start,start+perPage); pageCourses.forEach(course=>{ const card=document.createElement('div'); card.className='dd23l xk9h7 p2aql rounded-3xl border border-[#DCCDBD] bg-white/70 p-6 flex flex-col'; card.innerHTML=`
${course.category}

${course.title}

${course.level} • ${course.duration}

$${course.price} ${course.currency}
Add to cart Details
`; const followBtn=card.querySelector('.follow-btn'); followBtn.addEventListener('click',function(e){ e.preventDefault(); toggleFollow(course.id); }); const cartBtn=card.querySelector('.cart-btn'); cartBtn.addEventListener('click',function(e){ e.preventDefault(); addToCart(course.id); }); const detailBtn=card.querySelector('.detail-btn'); detailBtn.addEventListener('click',function(e){ e.preventDefault(); openModal(course); }); grid.appendChild(card); }); renderPagination(); } function renderPagination(){ pagination.innerHTML=''; const totalPages=Math.ceil(filteredCourses.length/perPage); if(totalPages<=1)return; for(let i=1;i<=totalPages;i++){ const btn=document.createElement('a'); btn.href='./catalog.html'; btn.textContent=i; btn.className='px-4 py-2 text-sm font-semibold rounded-full border border-[#DCCDBD]'+(i===currentPage?' bg-[#B85C45] text-white':''); btn.addEventListener('click',function(e){ e.preventDefault(); currentPage=i; renderGrid(); }); pagination.appendChild(btn); } } function openModal(course){ modalTitle.textContent=course.title; modalCategory.textContent=course.category+' • '+course.level+' • '+course.duration; modalDescription.textContent=course.description; modalLessons.innerHTML=''; course.lessons.forEach(l=>{ const li=document.createElement('li'); li.textContent=l; modalLessons.appendChild(li); }); modalCart.onclick=function(e){e.preventDefault();addToCart(course.id);modal.classList.add('hidden');modal.classList.remove('grid');}; modalFollow.onclick=function(e){e.preventDefault();toggleFollow(course.id);modal.classList.add('hidden');modal.classList.remove('grid');}; modal.classList.remove('hidden'); modal.classList.add('grid'); } modalClose.addEventListener('click',function(e){ e.preventDefault(); modal.classList.remove('grid'); modal.classList.add('hidden'); }); modal.addEventListener('click',function(e){ if(e.target===modal){ modal.classList.remove('grid'); modal.classList.add('hidden'); } }); function toggleFollow(id){ let followed=JSON.parse(localStorage.getItem('mh-followed-ids')||'[]'); if(followed.includes(id)){ followed=followed.filter(x=>x!==id); }else{ followed.push(id); } localStorage.setItem('mh-followed-ids',JSON.stringify(followed)); alert('Updated your Fallows list.'); } function addToCart(id){ let cart=JSON.parse(localStorage.getItem('mh-cart')||'{}'); cart[id]=(cart[id]||0)+1; localStorage.setItem('mh-cart',JSON.stringify(cart)); alert('Course added to cart.'); } function init(){ populateCategories(); searchInput.addEventListener('input',filterCourses); categorySelect.addEventListener('change',filterCourses); filteredCourses=courses; renderGrid(); status.textContent='Showing '+courses.length+' courses.'; } init(); })();