Spaces:
Running
Running
| // Contact form submission | |
| document.addEventListener('DOMContentLoaded', function() { | |
| const contactForm = document.querySelector('form'); | |
| if (contactForm) { | |
| contactForm.addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| alert('๋ฌธ์๊ฐ ์ฑ๊ณต์ ์ผ๋ก ์ ์ก๋์์ต๋๋ค. ๋น ๋ฅธ ์์ผ ๋ด์ ๋ต๋ณ๋๋ฆฌ๊ฒ ์ต๋๋ค.'); | |
| this.reset(); | |
| }); | |
| } | |
| // Initialize animations and gallery when page loads | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Initialize gallery masonry layout | |
| if (document.querySelector('.gallery-grid')) { | |
| const galleryGrid = document.querySelector('.gallery-grid'); | |
| const galleryItems = document.querySelectorAll('.gallery-item'); | |
| // Set random heights for masonry effect | |
| galleryItems.forEach(item => { | |
| const randomHeight = Math.floor(Math.random() * 100) + 200; | |
| item.style.height = `${randomHeight}px`; | |
| }); | |
| } | |
| // Add water drop animation to all glass buttons | |
| const glassButtons = document.querySelectorAll('.glass-btn'); | |
| glassButtons.forEach(button => { | |
| button.addEventListener('mouseenter', function() { | |
| this.classList.add('animate-water-drop'); | |
| }); | |
| button.addEventListener('mouseleave', function() { | |
| this.classList.remove('animate-water-drop'); | |
| }); | |
| }); | |
| // 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' | |
| }); | |
| } | |
| }); | |
| }); | |
| }); |