Initial commit: Fat Kiss site — Hugo + Decap CMS
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
// Fat Kiss — main.js
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// Mobile nav toggle
|
||||
const toggle = document.getElementById('navToggle');
|
||||
const nav = document.getElementById('mainNav');
|
||||
if (toggle && nav) {
|
||||
toggle.addEventListener('click', () => nav.classList.toggle('open'));
|
||||
nav.querySelectorAll('a').forEach(a => {
|
||||
a.addEventListener('click', () => nav.classList.remove('open'));
|
||||
});
|
||||
}
|
||||
|
||||
// FAQ accordion
|
||||
document.querySelectorAll('.faq-item__question').forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
btn.parentElement.classList.toggle('open');
|
||||
});
|
||||
});
|
||||
|
||||
// Sparkle effect on primary buttons
|
||||
document.querySelectorAll('.btn--primary').forEach(btn => {
|
||||
btn.addEventListener('mousemove', (e) => {
|
||||
const rect = btn.getBoundingClientRect();
|
||||
btn.style.setProperty('--x', ((e.clientX - rect.left) / rect.width * 100) + '%');
|
||||
btn.style.setProperty('--y', ((e.clientY - rect.top) / rect.height * 100) + '%');
|
||||
});
|
||||
});
|
||||
|
||||
// Kiss mark entrance animation for hero logo
|
||||
const heroLogo = document.querySelector('.hero__logo');
|
||||
if (heroLogo && !sessionStorage.getItem('fk-hero-seen')) {
|
||||
heroLogo.classList.add('kiss-mark');
|
||||
sessionStorage.setItem('fk-hero-seen', '1');
|
||||
}
|
||||
|
||||
// Jingle button (if present)
|
||||
const jingleBtn = document.getElementById('jingleBtn');
|
||||
if (jingleBtn) {
|
||||
const audio = document.getElementById('jingleAudio');
|
||||
jingleBtn.addEventListener('click', () => {
|
||||
if (audio) {
|
||||
if (audio.paused) {
|
||||
audio.play();
|
||||
jingleBtn.textContent = '⏸ Pause';
|
||||
} else {
|
||||
audio.pause();
|
||||
jingleBtn.textContent = '▶ Play Jingle';
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user