muna95's picture
create an old money aesthic website for selling mens fashion make it look modern but attract the super weathly as my persona to shop the website
6d259d8 verified
Raw History Blame Contribute Delete
1.47 kB
document.addEventListener('DOMContentLoaded', function() {
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
// Parallax effect for hero section
window.addEventListener('scroll', function() {
const scrollPosition = window.pageYOffset;
const heroSection = document.querySelector('section.relative');
if (heroSection) {
heroSection.style.backgroundPositionY = scrollPosition * 0.5 + 'px';
}
});
// Initialize tooltips
const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl);
});
});
// Product hover effect
function setupProductHover() {
const products = document.querySelectorAll('.product-card');
products.forEach(product => {
product.addEventListener('mouseenter', () => {
product.querySelector('.product-overlay').classList.add('opacity-100');
});
product.addEventListener('mouseleave', () => {
product.querySelector('.product-overlay').classList.remove('opacity-100');
});
});
}