PowerMe.us - Advanced Energy Storage Solutions | SunFusion Energy Systems
Power Your Future with Guardian Energy Systems
Advanced Energy Storage Solutions with 25-Year Warranty
Our Product Line
Guardian Elite Series
16kWh capacity | Industry-leading efficiency
- 99.1% Efficiency Rating
- Whole Home Backup
- 25-Year Warranty
Learn More
ECHO 3.0
Advanced energy management system
- Smart Load Management
- Remote Monitoring
- Storm Watch Protection
Learn More
Guardian Tower
96kWh capacity | Commercial grade
- Maximum Capacity
- Commercial Applications
- Scalable Design
Learn More
Why Choose Guardian Systems?
25-Year Warranty
Industry-leading protection for your investment
99.1% Efficiency
Maximum power output and storage capacity
Whole Home Backup
Complete power security during outages
Eco-Friendly
Sustainable energy storage solutions
Ready to Power Your Future?
Get a custom quote for your energy storage needs
// Main JavaScript file (main.js)
document.addEventListener('DOMContentLoaded', () => {
initializeNavigation();
initializeAnimations();
initializeProductCards();
initializeTestimonials();
setupEventListeners();
});
// Navigation and Mobile Menu
function initializeNavigation() {
const header = document.querySelector('.site-header');
const mobileMenuBtn = document.createElement('button');
mobileMenuBtn.className = 'mobile-menu-btn';
mobileMenuBtn.innerHTML = '
';
const nav = document.querySelector('.nav-menu');
const mobileMenu = document.createElement('div');
mobileMenu.className = 'mobile-menu';
mobileMenu.innerHTML = nav.innerHTML;
header.appendChild(mobileMenuBtn);
header.appendChild(mobileMenu);
// Mobile menu toggle
mobileMenuBtn.addEventListener('click', () => {
mobileMenu.classList.toggle('active');
mobileMenuBtn.classList.toggle('active');
});
// Header scroll behavior
let lastScroll = 0;
window.addEventListener('scroll', () => {
const currentScroll = window.pageYOffset;
if (currentScroll > lastScroll && currentScroll > 80) {
header.classList.add('header-hidden');
} else {
header.classList.remove('header-hidden');
}
if (currentScroll > 100) {
header.classList.add('header-scrolled');
} else {
header.classList.remove('header-scrolled');
}
lastScroll = currentScroll;
});
}
// Animations and Scroll Effects
function initializeAnimations() {
const animatedElements = document.querySelectorAll('.fade-in');
const observerOptions = {
threshold: 0.2,
rootMargin: '0px 0px -50px 0px'
};
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('visible');
observer.unobserve(entry.target);
}
});
}, observerOptions);
animatedElements.forEach(element => {
observer.observe(element);
});
}
// Product Cards Interaction
function initializeProductCards() {
const productCards = document.querySelectorAll('.product-card');
productCards.forEach(card => {
card.addEventListener('mouseenter', () => {
const features = card.querySelector('.features');
features.style.maxHeight = features.scrollHeight + 'px';
});
card.addEventListener('mouseleave', () => {
const features = card.querySelector('.features');
features.style.maxHeight = null;
});
});
}
// Testimonials Slider
function initializeTestimonials() {
const testimonials = [
{
name: "John D.",
location: "San Diego",
text: "The Guardian Elite system has completely transformed our home energy management. We're seeing significant savings every month.",
image: "/assets/testimonials/john.jpg"
},
{
name: "Sarah M.",
location: "Los Angeles",
text: "Outstanding customer service and the installation was seamless. Our energy bills have been cut in half!",
image: "/assets/testimonials/sarah.jpg"
},
{
name: "Robert K.",
location: "San Francisco",
text: "The backup power during outages has been invaluable. Best investment we've made for our home.",
image: "/assets/testimonials/robert.jpg"
}
];
const testimonialSlider = document.querySelector('.testimonial-slider');
let currentSlide = 0;
function createTestimonialSlide(testimonial) {
return `
\${testimonial.text}
\${testimonial.name}
\${testimonial.location}
`;
}
function updateSlider() {
testimonialSlider.innerHTML = createTestimonialSlide(testimonials[currentSlide]);
currentSlide = (currentSlide + 1) % testimonials.length;
}
updateSlider();
setInterval(updateSlider, 5000);
}
// Form Handling and Validation
function setupEventListeners() {
const forms = document.querySelectorAll('form');
forms.forEach(form => {
form.addEventListener('submit', async (e) => {
e.preventDefault();
if (validateForm(form)) {
const formData = new FormData(form);
try {
const response = await submitForm(formData);
handleFormSuccess(form);
} catch (error) {
handleFormError(form, error);
}
}
});
});
}
function validateForm(form) {
let isValid = true;
const inputs = form.querySelectorAll('input, select, textarea');
inputs.forEach(input => {
if (input.hasAttribute('required') && !input.value.trim()) {
markInputError(input, 'This field is required');
isValid = false;
} else if (input.type === 'email' && !validateEmail(input.value)) {
markInputError(input, 'Please enter a valid email address');
isValid = false;
}
});
return isValid;
}
function validateEmail(email) {
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
}
function markInputError(input, message) {
const errorDiv = document.createElement('div');
errorDiv.className = 'input-error';
errorDiv.textContent = message;
input.classList.add('error');
input.parentNode.appendChild(errorDiv);
input.addEventListener('input', () => {
input.classList.remove('error');
const error = input.parentNode.querySelector('.input-error');
if (error) error.remove();
}, { once: true });
}
async function submitForm(formData) {
const response = await fetch('/api/submit-form', {
method: 'POST',
body: formData
});
if (!response.ok) {
throw new Error('Form submission failed');
}
return response.json();
}
function handleFormSuccess(form) {
const successMessage = document.createElement('div');
successMessage.className = 'form-success';
successMessage.textContent = 'Thank you! We will contact you soon.';
form.reset();
form.appendChild(successMessage);
setTimeout(() => {
successMessage.remove();
}, 5000);
}
function handleFormError(form, error) {
const errorMessage = document.createElement('div');
errorMessage.className = 'form-error';
errorMessage.textContent = 'An error occurred. Please try again later.';
form.appendChild(errorMessage);
setTimeout(() => {
errorMessage.remove();
}, 5000);
}
// Analytics Tracking
function initializeAnalytics() {
// Google Analytics
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
// Custom Event Tracking
trackPageView();
trackUserInteractions();
}
function trackPageView() {
const pageData = {
path: window.location.pathname,
title: document.title,
referrer: document.referrer
};
gtag('event', 'page_view', pageData);
}
function trackUserInteractions() {
// Track clicks on CTAs
document.querySelectorAll('.btn').forEach(button => {
button.addEventListener('click', () => {
gtag('event', 'cta_click', {
button_text: button.textContent,
button_location: getButtonLocation(button)
});
});
});
// Track calculator usage
if (document.querySelector('.powerme-calculator')) {
trackCalculatorUsage();
}
}
function getButtonLocation(button) {
const section = button.closest('section');
return section ? section.className : 'unknown';
}
function trackCalculatorUsage() {
// Implementation will be added with calculator integration
}