Studio access
Keep your creative progress together
Demo sign-in is available for this front-end experience. No payment or account data is collected.
Your worktable
Course cart
Keep your selected studies together before deciding which creative path suits your time.
Review request received
This front-end demo does not process payment. Contact the studio to arrange the next enrollment step.
`;
const footerHTML = `
`;
document.querySelector('header').innerHTML = headerHTML;
document.querySelector('footer').innerHTML = footerHTML;
let products = [];
let cart = JSON.parse(localStorage.getItem('corecanvas-cart') || '{}');
function initTheme() {
if (localStorage.getItem('corecanvas-theme') === 'dark') {
document.documentElement.classList.add('dark');
}
document.querySelectorAll('[data-theme-toggle]').forEach(btn => {
btn.addEventListener('click', () => {
document.documentElement.classList.toggle('dark');
localStorage.setItem('corecanvas-theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light');
});
});
}
function initMobileMenu() {
const toggle = document.querySelector('[data-mobile-toggle]');
const menu = document.querySelector('[data-mobile-menu]');
if (toggle && menu) {
toggle.addEventListener('click', () => {
menu.classList.toggle('hidden');
});
}
}
function initCookieBanner() {
const banner = document.querySelector('[data-cookie-banner]');
if (!banner) return;
if (localStorage.getItem('corecanvas-cookie-consent') === 'yes') {
banner.remove();
return;
}
document.querySelector('[data-cookie-close]')?.addEventListener('click', () => {
localStorage.setItem('corecanvas-cookie-consent', 'yes');
banner.remove();
});
}
async function renderCart() {
products = await (await fetch('./catalog.json')).json();
const chosen = products.filter(x => cart[x.id]);
const itemsContainer = document.querySelector('#cart-items');
const summaryContainer = document.querySelector('#cart-summary');
if (chosen.length) {
itemsContainer.innerHTML = chosen.map(x => `
${x.title}
${x.duration} · $${x.price.toFixed(2)} each
`).join('');
const total = chosen.reduce((sum, x) => sum + x.price * cart[x.id], 0);
summaryContainer.innerHTML = `
Estimated total
$${total.toFixed(2)}
`;
} else {
itemsContainer.innerHTML = ``;
summaryContainer.innerHTML = '';
}
document.querySelectorAll('[data-qty]').forEach(input => {
input.addEventListener('change', e => {
const id = e.target.dataset.qty;
cart[id] = Math.max(1, parseInt(e.target.value, 10) || 1);
localStorage.setItem('corecanvas-cart', JSON.stringify(cart));
renderCart();
});
});
document.querySelectorAll('[data-remove]').forEach(btn => {
btn.addEventListener('click', e => {
const id = e.target.dataset.remove;
delete cart[id];
localStorage.setItem('corecanvas-cart', JSON.stringify(cart));
renderCart();
});
});
document.querySelector('[data-checkout]')?.addEventListener('click', () => {
document.getElementById('checkout-modal').classList.remove('hidden');
document.getElementById('checkout-modal').classList.add('flex');
});
}
document.getElementById('checkout-modal').addEventListener('click', e => {
if (e.target.id === 'checkout-modal' || e.target.hasAttribute('data-close-checkout')) {
document.getElementById('checkout-modal').classList.add('hidden');
document.getElementById('<|eos|>