Ad a promotional banner above the header saying '20% Off All Services Confirmed in January & February 2026' Also, remove the contact us navigation link the header. Note the header needs to be a tempalte that is globally applied. Just like we need to have CSS variables and CSS Classes that are global too. Please make that happen. Ensure also that we always build pages with SEO Structure in mind with Heading tags and body tags etc. Where you have a hero section on the homepage can you please make that a gradient dark violoet colour and make it a slider of 3 slides. Left align the content to be the same width as the header content.
b53040f verified Download script.js from didgitch/didgit-vibes-code-with-groove: direct link, hf CLI and curl.
- Browser
- Download file 3.48 kB
-
https://huggingface.co/spaces/didgitch/didgit-vibes-code-with-groove/resolve/main/script.js
- Command line
-
hf download hf://spaces/didgitch/didgit-vibes-code-with-groove/script.js
-
curl -L -o script.js https://huggingface.co/spaces/didgitch/didgit-vibes-code-with-groove/resolve/main/script.js
3.48 kB
| // Main JavaScript for Didgit.co.uk | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Hero Slider | |
| const slides = document.querySelectorAll('.slide'); | |
| const dots = document.querySelectorAll('.dot'); | |
| let currentSlide = 0; | |
| function showSlide(n) { | |
| slides.forEach(slide => slide.classList.remove('active')); | |
| dots.forEach(dot => dot.classList.remove('active')); | |
| currentSlide = (n + slides.length) % slides.length; | |
| slides[currentSlide].classList.add('active'); | |
| dots[currentSlide].classList.add('active'); | |
| } | |
| function nextSlide() { | |
| showSlide(currentSlide + 1); | |
| } | |
| // Auto slide every 5 seconds | |
| setInterval(nextSlide, 5000); | |
| // Dot navigation | |
| dots.forEach((dot, index) => { | |
| dot.addEventListener('click', () => { | |
| showSlide(index); | |
| }); | |
| }); | |
| // 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) { | |
| window.scrollTo({ | |
| top: targetElement.offsetTop - 80, | |
| behavior: 'smooth' | |
| }); | |
| } | |
| }); | |
| }); | |
| // Animation on scroll | |
| const animateOnScroll = function() { | |
| const elements = document.querySelectorAll('.animate-on-scroll'); | |
| elements.forEach(element => { | |
| const elementPosition = element.getBoundingClientRect().top; | |
| const windowHeight = window.innerHeight; | |
| if (elementPosition < windowHeight - 100) { | |
| element.classList.add('animate-fadeInUp'); | |
| } | |
| }); | |
| }; | |
| // Initialize animations | |
| window.addEventListener('scroll', animateOnScroll); | |
| animateOnScroll(); | |
| // Form submission handling | |
| const contactForm = document.querySelector('#contact form'); | |
| if (contactForm) { | |
| contactForm.addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| // Get form values | |
| const name = this.querySelector('#name').value; | |
| const email = this.querySelector('#email').value; | |
| const message = this.querySelector('#message').value; | |
| // Simple validation | |
| if (!name || !email || !message) { | |
| alert('Please fill in all fields'); | |
| return; | |
| } | |
| // Here you would typically send the form data to a server | |
| console.log('Form submitted:', { name, email, message }); | |
| alert('Thank you for your message! We will get back to you soon.'); | |
| // Reset form | |
| this.reset(); | |
| }); | |
| } | |
| }); | |
| // Intersection Observer for animations | |
| const observerOptions = { | |
| threshold: 0.1 | |
| }; | |
| const observer = new IntersectionObserver((entries) => { | |
| entries.forEach(entry => { | |
| if (entry.isIntersecting) { | |
| entry.target.classList.add('animate-fadeInUp'); | |
| observer.unobserve(entry.target); | |
| } | |
| }); | |
| }, observerOptions); | |
| document.querySelectorAll('.animate-on-scroll').forEach(element => { | |
| observer.observe(element); | |
| }); |