Changed around line 1
+ document.addEventListener('DOMContentLoaded', function() {
+ // Project modal functionality
+ const projectCards = document.querySelectorAll('.project-card');
+ const projectModal = document.querySelector('.project-modal');
+ const modalContent = document.querySelector('.modal-content');
+ const closeModal = document.querySelector('.close-modal');
+
+ projectCards.forEach(card => {
+ card.addEventListener('click', function() {
+ const projectId = this.getAttribute('data-project');
+ loadProjectDetails(projectId);
+ projectModal.classList.add('active');
+ document.body.style.overflow = 'hidden';
+ });
+ });
+
+ closeModal.addEventListener('click', function() {
+ projectModal.classList.remove('active');
+ document.body.style.overflow = 'auto';
+ });
+
+ projectModal.addEventListener('click', function(e) {
+ if (e.target === projectModal) {
+ projectModal.classList.remove('active');
+ document.body.style.overflow = 'auto';
+ }
+ });
+
+ function loadProjectDetails(projectId) {
+ // In a real implementation, this would fetch project details
+ // For demo purposes, we'll just show placeholder content
+ const projects = {
+ '1': {
+ title: 'Project One',
+ description: 'A comprehensive web design and development project for a leading client in the industry. This project involved creating a responsive website with custom animations and a content management system.',
+ services: 'Web Design, Frontend Development, CMS Integration',
+ year: '2022'
+ },
+ '2': {
+ title: 'Project Two',
+ description: 'Brand identity development for a startup company. Created logo, color palette, typography system, and brand guidelines.',
+ services: 'Brand Identity, Logo Design, Visual System',
+ year: '2021'
+ },
+ '3': {
+ title: 'Project Three',
+ description: 'Interactive experience for a museum exhibition. Developed touchscreen interfaces and motion graphics to enhance visitor engagement.',
+ services: 'Interactive Design, Motion Graphics, UI Development',
+ year: '2023'
+ },
+ '4': {
+ title: 'Project Four',
+ description: 'Mobile application for a health and wellness platform. Designed user flows and developed the frontend for both iOS and Android.',
+ services: 'Mobile App Design, UI/UX, Frontend Development',
+ year: '2022'
+ }
+ };
+
+ const project = projects[projectId];
+
+ modalContent.innerHTML = `
+
${project.title}
+
${project.services} | ${project.year}
+ `;
+ }
+
+ // 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'
+ });
+ }
+ });
+ });
+
+ // Animate elements when they come into view
+ const animateOnScroll = function() {
+ const elements = document.querySelectorAll('.project-card, .about-content, .contact-form');
+
+ elements.forEach(element => {
+ const elementPosition = element.getBoundingClientRect().top;
+ const windowHeight = window.innerHeight;
+
+ if (elementPosition < windowHeight - 100) {
+ element.style.opacity = '1';
+ element.style.transform = 'translateY(0)';
+ }
+ });
+ };
+
+ // Set initial state for animated elements
+ const animatedElements = document.querySelectorAll('.project-card, .about-content, .contact-form');
+ animatedElements.forEach(element => {
+ element.style.opacity = '0';
+ element.style.transform = 'translateY(20px)';
+ element.style.transition = 'opacity 0.5s ease, transform 0.5s ease';
+ });
+
+ window.addEventListener('scroll', animateOnScroll);
+ animateOnScroll(); // Run once on load
+ });