Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ const slider = document.querySelector('.slider');
+ const beforeImg = document.getElementById('before-img');
+ const afterImg = document.getElementById('after-img');
+ const demoContainer = document.querySelector('.image-comparison');
+ let isResizing = false;
+
+ // Initialize slider position
+ slider.style.left = '50%';
+ afterImg.style.width = '50%';
+
+ // Slider functionality
+ demoContainer.addEventListener('mousedown', (e) => {
+ isResizing = true;
+ demoContainer.classList.add('active');
+ });
+
+ document.addEventListener('mousemove', (e) => {
+ if (!isResizing) return;
+
+ const rect = demoContainer.getBoundingClientRect();
+ const x = e.clientX - rect.left;
+ const percent = (x / rect.width) * 100;
+
+ if (percent >= 0 && percent <= 100) {
+ slider.style.left = `${percent}%`;
+ afterImg.style.width = `${percent}%`;
+ }
+ });
+
+ document.addEventListener('mouseup', () => {
+ isResizing = false;
+ demoContainer.classList.remove('active');
+ });
+
+ // Form submission
+ const contactForm = document.getElementById('contact-form');
+ contactForm.addEventListener('submit', (e) => {
+ e.preventDefault();
+ const formData = new FormData(contactForm);
+ // Add form submission logic here
+ alert('Thank you for your message! We will get back to you soon.');
+ contactForm.reset();
+ });
+
+ // Smooth scroll for navigation
+ document.querySelectorAll('a[href^="#"]').forEach(anchor => {
+ anchor.addEventListener('click', function (e) {
+ e.preventDefault();
+ document.querySelector(this.getAttribute('href')).scrollIntoView({
+ behavior: 'smooth'
+ });
+ });
+ });
+
+ // Upload button functionality
+ document.getElementById('upload-btn').addEventListener('click', () => {
+ // Add image upload logic here
+ alert('Image upload functionality would be implemented here');
+ });
+
+ // Enhance button functionality
+ document.getElementById('enhance-btn').addEventListener('click', () => {
+ // Add enhancement logic here
+ alert('Image enhancement processing would occur here');
+ });
+ });