luxehaven-estates / script.js
Nickberg1's picture
Сделай сайт продажи домов, в очень дорогом стиле, с авторизацией и прочим. Стиль 2026 года.
74a0332 verified
Raw History Blame Contribute Delete
1.71 kB
document.addEventListener('DOMContentLoaded', function() {
// Initialize animations
const animateElements = document.querySelectorAll('.animate-fade-in');
animateElements.forEach((el, index) => {
el.style.animationDelay = `${index * 0.1}s`;
});
// Smooth scroll for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
// Property card hover effect
const propertyCards = document.querySelectorAll('.property-card-hover');
propertyCards.forEach(card => {
card.addEventListener('mouseenter', () => {
card.classList.add('shadow-xl');
});
card.addEventListener('mouseleave', () => {
card.classList.remove('shadow-xl');
});
});
});
// Auth functions
function togglePasswordVisibility(inputId) {
const input = document.getElementById(inputId);
const icon = document.querySelector(`[data-password="${inputId}"]`);
if (input.type === 'password') {
input.type = 'text';
icon.setAttribute('data-feather', 'eye-off');
} else {
input.type = 'password';
icon.setAttribute('data-feather', 'eye');
}
feather.replace();
}
function handleAuthFormSubmit(type) {
// In a real app, this would handle form submission
console.log(`${type} form submitted`);
document.querySelector('luxe-auth-modal').setAttribute('visible', 'false');
return false; // Prevent actual form submission for demo
}