aaronnicholasj's picture
we want the buttons to actually go to the corresponding pages, you will have to write the code for those pages. Under the "Our Comfort Promise" section we want each of those boxes to drop down when hovered over with a button that says learn more about[whatever the topic is for that button like warranties] We want to include more sections like the one that says "Real Comfort for Real Homes" you can use the things in the boxes above that section to build these out. We also want to include a sections that talks about working on commercial buildings as well. Come up with a design for the "What Our Customers Say" section, we will include real reviews/testimonials later. For the "10 Quick Comfort Tips" section we want to include some videos eventually breaking down these topics but make all of these topics currently listed lead the user to a new page dedicated to tips on how to take care of common issues as well as scenarios when the customer should call in a professional HVAC technician and when that is the case include a button that leads to a request for services form.
51847d5 verified
Raw History Blame Contribute Delete
2.93 kB
// Main JavaScript file for shared functionality
// Mobile menu toggle functionality
document.addEventListener('DOMContentLoaded', function() {
// Initialize Feather Icons
feather.replace();
// Mobile menu toggle
const mobileMenuButton = document.getElementById('mobile-menu-button');
const mobileMenu = document.getElementById('mobile-menu');
if (mobileMenuButton && mobileMenu) {
mobileMenuButton.addEventListener('click', function() {
mobileMenu.classList.toggle('hidden');
});
}
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function(e) {
e.preventDefault();
const targetId = this.getAttribute('href');
if (targetId === '#') return;
const targetElement = document.querySelector(targetId);
if (targetElement) {
targetElement.scrollIntoView({
behavior: 'smooth'
});
}
});
});
// Form submission handling
const contactForm = document.getElementById('contact-form');
if (contactForm) {
contactForm.addEventListener('submit', function(e) {
e.preventDefault();
// Here you would typically send the form data to your server
// For demo purposes, we'll just show a success message
const submitButton = contactForm.querySelector('button[type="submit"]');
const originalButtonText = submitButton.textContent;
submitButton.disabled = true;
submitButton.innerHTML = '<i data-feather="loader" class="animate-spin mr-2"></i> Sending...';
feather.replace();
// Simulate API call
setTimeout(() => {
submitButton.innerHTML = '<i data-feather="check" class="mr-2"></i> Message Sent!';
feather.replace();
// Reset form
contactForm.reset();
// Reset button after 3 seconds
setTimeout(() => {
submitButton.disabled = false;
submitButton.textContent = originalButtonText;
feather.replace();
}, 3000);
}, 1500);
});
}
});
// Function to handle service card clicks
function navigateToService(serviceId) {
window.location.href = `/services/${serviceId}`;
}
// Function to initialize Google Maps
function initMap() {
// This would be replaced with your actual Google Maps API implementation
console.log('Map would be initialized here');
}
// Call the map function when the window loads
window.onload = function() {
if (document.getElementById('map')) {
initMap();
}
};