nkjoy's picture
์—ฐ๋ฝ์ฒ˜ํŽ˜์ด์ง€ ๋ฉ‹์ง€๊ฒŒ ๋งŒ๋“ค์–ด์ค˜
036c2df verified
// 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'
});
}
});
});
});