Changed around line 1
+ document.addEventListener('DOMContentLoaded', function() {
+ const landingVideo = document.getElementById('landingVideo');
+ const homeButton = document.getElementById('homeButton');
+ const projectsSection = document.getElementById('projects');
+ const projectContents = document.querySelectorAll('.project-content');
+ const projectTitles = document.querySelectorAll('.project-title');
+ const gridItems = document.querySelectorAll('.grid-item');
+ const videoModal = document.getElementById('videoModal');
+ const modalVideo = document.getElementById('modalVideo');
+ const videoLink = document.getElementById('videoLink');
+ const closeModal = document.querySelector('.close');
+
+ // Landing page click handler
+ landingVideo.addEventListener('click', function() {
+ landingVideo.classList.add('hidden');
+ projectsSection.classList.remove('hidden');
+ });
+
+ // Home button click handler
+ homeButton.addEventListener('click', function() {
+ projectsSection.classList.add('hidden');
+ projectContents.forEach(content => content.classList.add('hidden'));
+ landingVideo.classList.remove('hidden');
+ });
+
+ // Project title click handlers
+ projectTitles.forEach(title => {
+ title.addEventListener('click', function() {
+ const target = this.dataset.target;
+ projectsSection.classList.add('hidden');
+ document.getElementById(target).classList.remove('hidden');
+ });
+ });
+
+ // Grid item click handlers
+ gridItems.forEach(item => {
+ item.addEventListener('click', function() {
+ const videoSrc = this.dataset.video;
+ modalVideo.src = videoSrc;
+ videoLink.href = videoSrc;
+ videoModal.classList.remove('hidden');
+ modalVideo.play();
+ });
+ });
+
+ // Close modal handler
+ closeModal.addEventListener('click', function() {
+ videoModal.classList.add('hidden');
+ modalVideo.pause();
+ modalVideo.currentTime = 0;
+ });
+
+ // Close modal when clicking outside
+ window.addEventListener('click', function(event) {
+ if (event.target === videoModal) {
+ videoModal.classList.add('hidden');
+ modalVideo.pause();
+ modalVideo.currentTime = 0;
+ }
+ });
+ });