Introduces six new HTML product pages (e.g., rubiks-cube-mug-auf-victim.html) with individual SEO meta tags, Open Graph, Twitter cards, and structured data. Updates index.html to include a new 'Shop' section, adds robots.txt and sitemap.xml, and enhances homepage SEO with a canonical URL, organization schema, and an ItemList schema for products. Replit-Commit-Author: Agent Replit-Commit-Session-Id: f5797e65-2210-4d2e-bf70-278d8a0098c1 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: cb7f5886-1e99-485f-ba60-5e1aed72d023 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/2a2c58da-54a0-4c86-8ad0-3b93439f70de/f5797e65-2210-4d2e-bf70-278d8a0098c1/z77BLws Replit-Helium-Checkpoint-Created: true
47 lines
2.3 KiB
JavaScript
47 lines
2.3 KiB
JavaScript
|
|
// Hamburger
|
|
const hamburger = document.getElementById('hamburger'), mobileMenu = document.getElementById('mobileMenu');
|
|
hamburger.addEventListener('click', function () { hamburger.classList.toggle('open'); mobileMenu.classList.toggle('open'); });
|
|
document.querySelectorAll('.mobile-nav-link').forEach(function (a) { a.addEventListener('click', function () { hamburger.classList.remove('open'); mobileMenu.classList.remove('open'); }); });
|
|
|
|
// Scroll reveal
|
|
const observer = new IntersectionObserver(function (entries) {
|
|
entries.forEach(function (e) { if (e.isIntersecting) { e.target.classList.add('visible'); observer.unobserve(e.target); } });
|
|
}, { threshold: 0.1 });
|
|
document.querySelectorAll('.reveal').forEach(function (el) { observer.observe(el); });
|
|
|
|
// Active nav
|
|
const secObs = new IntersectionObserver(function (entries) {
|
|
entries.forEach(function (e) { if (e.isIntersecting) { const id = e.target.id; document.querySelectorAll('.nav-links a[data-section]').forEach(function (a) { a.classList.toggle('active', a.dataset.section === id); }); } });
|
|
}, { rootMargin: '-40% 0px -55% 0px' });
|
|
['home', 'shop', 'about', 'faq', 'contact'].forEach(function (id) { const el = document.getElementById(id); if (el) secObs.observe(el); });
|
|
|
|
// FAQ card accordion
|
|
document.querySelectorAll('.faq-card-q').forEach(function (btn) {
|
|
btn.addEventListener('click', function () {
|
|
const card = this.closest('.faq-card');
|
|
const isOpen = card.classList.contains('open');
|
|
document.querySelectorAll('.faq-card.open').forEach(function (c) { c.classList.remove('open'); });
|
|
if (!isOpen) card.classList.add('open');
|
|
});
|
|
});
|
|
|
|
// Contact form
|
|
const contactForm = document.getElementById('contactForm');
|
|
if (contactForm) {
|
|
contactForm.addEventListener('submit', function (e) {
|
|
e.preventDefault();
|
|
const btn = this.querySelector('.form-submit');
|
|
btn.textContent = 'Message Sent ✓'; btn.style.background = 'var(--green)'; btn.style.borderColor = 'var(--green)'; btn.style.color = '#000';
|
|
setTimeout(function () { btn.textContent = 'Send It ↗'; btn.style.background = btn.style.borderColor = btn.style.color = ''; }, 3000);
|
|
});
|
|
}
|
|
|
|
// 3D cube float
|
|
const cube = document.getElementById('cube3d');
|
|
if (cube) {
|
|
let t = 0;
|
|
function floatCube() { t += 0.012; cube.style.marginTop = (Math.sin(t) * 12) + 'px'; requestAnimationFrame(floatCube); }
|
|
floatCube();
|
|
}
|