Estiu 1993

de Carla Simón. Inicia Films. Llargmetratge de ficció. Disseny de so. Nominació a millor so als premis Gaudí.

(function () { 'use strict';function initCursor() { const cursor = document.createElement('div'); cursor.className = 'cs-cursor'; cursor.id = 'cs-cursor';const ring = document.createElement('div'); ring.className = 'cs-cursor-ring'; ring.id = 'cs-cursor-ring';document.body.appendChild(cursor); document.body.appendChild(ring);let mx = 0, my = 0, rx = 0, ry = 0;document.addEventListener('mousemove', function (e) { mx = e.clientX; my = e.clientY; });function animateCursor() { cursor.style.left = mx + 'px'; cursor.style.top = my + 'px'; rx += (mx - rx) * 0.12; ry += (my - ry) * 0.12; ring.style.left = rx + 'px'; ring.style.top = ry + 'px'; requestAnimationFrame(animateCursor); } animateCursor(); }function initNavScroll() { var header = document.querySelector('.site-header'); if (!header) return;window.addEventListener('scroll', function () { if (window.scrollY > 60) { header.classList.add('cs-scrolled'); } else { header.classList.remove('cs-scrolled'); } }, { passive: true }); }/* ---------------------------------------------------------- 3. BARRES D'ESPECTRE (HERO) Afegeix un div.cs-spectrum dins del teu bloc hero ---------------------------------------------------------- */ function initSpectrum() { var spectrum = document.getElementById('cs-spectrum'); if (!spectrum) return;for (var i = 0; i < 80; i++) { var bar = document.createElement('div'); bar.className = 'cs-bar'; var min = (Math.random() * 20 + 5).toFixed(0); var max = (Math.random() * 120 + 20).toFixed(0); var dur = (Math.random() * 1.5 + 0.5).toFixed(2) + 's'; bar.style.setProperty('--min', min + 'px'); bar.style.setProperty('--max', max + 'px'); bar.style.setProperty('--dur', dur); spectrum.appendChild(bar); } }function initPortfolioFilter() { var filterBtns = document.querySelectorAll('.cs-filter-btn'); if (!filterBtns.length) return;filterBtns.forEach(function (btn) { btn.addEventListener('click', function () { filterBtns.forEach(function (b) { b.classList.remove('active'); }); btn.classList.add('active');var filter = btn.getAttribute('data-filter'); var cards = document.querySelectorAll('.cs-project-card');cards.forEach(function (card) { if (!filter || filter === 'all') { card.style.display = ''; } else { var type = card.getAttribute('data-type') || ''; card.style.display = type === filter ? '' : 'none'; } }); }); }); }function initScrollReveal() { var reveals = document.querySelectorAll('.cs-reveal'); if (!reveals.length) return;if ('IntersectionObserver' in window) { var observer = new IntersectionObserver(function (entries) { entries.forEach(function (entry) { if (entry.isIntersecting) { entry.target.classList.add('cs-visible'); } }); }, { threshold: 0.1 });reveals.forEach(function (el) { observer.observe(el); }); } else { /* Fallback per a navegadors sense IntersectionObserver */ reveals.forEach(function (el) { el.classList.add('cs-visible'); }); } }function initSmoothScroll() { document.querySelectorAll('a[href^="#"]').forEach(function (anchor) { anchor.addEventListener('click', function (e) { var target = document.querySelector(this.getAttribute('href')); if (target) { e.preventDefault(); target.scrollIntoView({ behavior: 'smooth', block: 'start' }); } }); }); } function initContactForm() { var form = document.getElementById('cs-contact-form'); if (!form) return;form.addEventListener('submit', function (e) { var inputs = form.querySelectorAll('input[required], textarea[required]'); var valid = true;inputs.forEach(function (input) { if (!input.value.trim()) { input.style.borderBottomColor = '#e85d24'; valid = false; } else { input.style.borderBottomColor = ''; } });if (!valid) { e.preventDefault(); } }); }function init() { initCursor(); initNavScroll(); initSpectrum(); initPortfolioFilter(); initScrollReveal(); initSmoothScroll(); initContactForm(); }if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', init); } else { init(); }})();