scriptspark-studio / script.js
wicwurm's picture
Design a single-page, scrolling website for a sizzle reel production service. The entire site must be built around this core message: 'Turn your script from a document into an experience. I create compelling sizzle reels and proof-of-concept trailers that grab a producer's attention in 60 seconds and make them feel your story, so you can close the deal.'
0a1d0f6 verified
// Show/hide sticky CTA based on scroll position
window.addEventListener('scroll', function() {
const stickyCta = document.getElementById('sticky-cta');
const contactSection = document.getElementById('contact-form');
// Show sticky CTA when scrolled past hero section
if (window.scrollY > window.innerHeight * 0.5) {
stickyCta.classList.remove('translate-y-full');
} else {
stickyCta.classList.add('translate-y-full');
}
// Hide sticky CTA when reaching contact form
const contactRect = contactSection.getBoundingClientRect();
if (contactRect.top <= window.innerHeight && contactRect.bottom >= 0) {
stickyCta.classList.add('translate-y-full');
}
});
// Smooth scroll to contact form
function scrollToForm() {
document.getElementById('contact-form').scrollIntoView({
behavior: 'smooth'
});
}
// Form submission handling
document.getElementById('trailer-form').addEventListener('submit', function(e) {
e.preventDefault();
// Get form values
const formData = {
name: document.getElementById('name').value,
email: document.getElementById('email').value,
logline: document.getElementById('logline').value
};
// In a real application, you would send this data to your server
console.log('Form submitted:', formData);
// Show success message
alert('Thank you! I\'ll get back to you within 24 hours to discuss your project.');
// Reset form
this.reset();
});