// Property data const properties = [ { id: 1, title: "Luxury Riverside Apartment", type: "apartment", price: "$1,250,000", bedrooms: 3, bathrooms: 2, area: "1,850 sq ft", location: "Downtown", image: "http://static.photos/real-estate/640x360/101" }, { id: 2, title: "Modern Loft with City Views", type: "apartment", price: "$895,000", bedrooms: 2, bathrooms: 2, area: "1,350 sq ft", location: "Midtown", image: "http://static.photos/real-estate/640x360/102" }, { id: 3, title: "Exclusive Skyline Penthouse", type: "penthouse", price: "$3,500,000", bedrooms: 4, bathrooms: 3.5, area: "3,200 sq ft", location: "Uptown", image: "http://static.photos/real-estate/640x360/103" }, { id: 4, title: "Charming Brownstone House", type: "house", price: "$2,100,000", bedrooms: 5, bathrooms: 3, area: "2,800 sq ft", location: "Suburb", image: "http://static.photos/real-estate/640x360/104" }, { id: 5, title: "Top-Floor Penthouse Suite", type: "penthouse", price: "$4,200,000", bedrooms: 5, bathrooms: 4, area: "3,700 sq ft", location: "Downtown", image: "http://static.photos/real-estate/640x360/105" }, { id: 6, title: "Contemporary Studio Apartment", type: "apartment", price: "$650,000", bedrooms: 1, bathrooms: 1, area: "800 sq ft", location: "Midtown", image: "http://static.photos/real-estate/640x360/106" } ]; // Load properties on properties.html if (window.location.pathname.includes('properties.html')) { document.addEventListener('DOMContentLoaded', function() { const container = document.querySelector('.property-container'); properties.forEach(property => { const propertyCard = document.createElement('div'); propertyCard.className = `property-card bg-white rounded-lg shadow-lg overflow-hidden hover:shadow-xl transition-shadow duration-300`; propertyCard.dataset.type = property.type; propertyCard.innerHTML = ` ${property.title}

${property.title}

${property.type}

${property.location} • ${property.bedrooms} beds • ${property.bathrooms} baths • ${property.area}

${property.price}

View Details
`; container.appendChild(propertyCard); }); // Filter functionality const filterButtons = document.querySelectorAll('.filter-btn'); filterButtons.forEach(button => { button.addEventListener('click', () => { filterButtons.forEach(btn => btn.classList.remove('active', 'bg-mint-600', 'text-white')); button.classList.add('active', 'bg-mint-600', 'text-white'); const filterValue = button.dataset.filter; const cards = document.querySelectorAll('.property-card'); cards.forEach(card => { if (filterValue === 'all' || card.dataset.type === filterValue) { card.style.display = 'block'; } else { card.style.display = 'none'; } }); }); }); }); } // Contact form submission if (window.location.pathname.includes('contact.html')) { document.addEventListener('DOMContentLoaded', function() { const contactForm = document.getElementById('contactForm'); contactForm.addEventListener('submit', function(e) { e.preventDefault(); // Get form values const name = document.getElementById('name').value; const email = document.getElementById('email').value; const phone = document.getElementById('phone').value; const message = document.getElementById('message').value; // Simple validation if (!name || !email || !message) { alert('Please fill in all required fields.'); return; } // Here you would typically send the data to a server console.log('Form submitted:', { name, email, phone, message }); // Show success message alert('Thank you for your message! We will contact you soon.'); contactForm.reset(); }); }); }