// 아이콘 초기화 lucide.createIcons(); // 스크롤 네비게이션 효과 window.addEventListener('scroll', function() { const navbar = document.getElementById('navbar'); if (window.scrollY > 50) { navbar.classList.add('scrolled'); } else { navbar.classList.remove('scrolled'); } }); // 부드러운 스크롤 document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); const target = document.querySelector(this.getAttribute('href')); if (target) { target.scrollIntoView({ behavior: 'smooth', block: 'start' }); } }); }); // ==================== Contact Modal Functions ==================== function openContactModal() { document.getElementById('contactModal').classList.add('active'); document.body.style.overflow = 'hidden'; } function closeContactModal() { document.getElementById('contactModal').classList.remove('active'); document.getElementById('contactForm').reset(); clearFormErrors(); document.body.style.overflow = 'auto'; } function clearFormErrors() { document.getElementById('nameError').textContent = ''; document.getElementById('phoneError').textContent = ''; document.getElementById('messageError').textContent = ''; } function submitContactForm(event) { event.preventDefault(); clearFormErrors(); const name = document.getElementById('name').value.trim(); const phone = document.getElementById('phone').value.trim(); const message = document.getElementById('message').value.trim(); let isValid = true; // 유효성 검증 if (!name) { document.getElementById('nameError').textContent = '이름을 입력해주세요'; isValid = false; } if (!phone) { document.getElementById('phoneError').textContent = '연락처를 입력해주세요'; isValid = false; } if (!message) { document.getElementById('messageError').textContent = '메시지를 입력해주세요'; isValid = false; } if (!isValid) return; // mailto 링크 생성 및 열기 const subject = encodeURIComponent('[SF ICT 프로젝트 문의] ' + name); const emailBody = encodeURIComponent( '=== 프로젝트 문의 정보 ===\n\n' + '성명: ' + name + '\n' + '연락처: ' + phone + '\n' + '\n--- 문의 내용 ---\n' + message ); const mailtoLink = 'mailto:help@sfict.co.kr?subject=' + subject + '&body=' + emailBody; // 메일 클라이언트 열기 window.location.href = mailtoLink; // 모달 닫기 및 폼 초기화 closeContactModal(); } // ESC 키로 모달 닫기 document.addEventListener('keydown', function(event) { if (event.key === 'Escape') { const modal = document.getElementById('contactModal'); if (modal.classList.contains('active')) { closeContactModal(); } } }); // 모달 배경 클릭으로 닫기 document.getElementById('contactModal').addEventListener('click', function(event) { if (event.target === this) { closeContactModal(); } }); // ==================== Capabilities Tab Switching ==================== (function() { var tabs = document.querySelectorAll('.cap-tab'); var panels = document.querySelectorAll('.cap-panel'); var descText = document.getElementById('capDescText'); var badge = document.querySelector('.cap-desc-badge'); var descriptions = [ '스마트 팩토리 솔루션을 통해 실시간 생산 공정을 모니터링하고 IoT 센서 데이터를 통합하여 최적의 재고 상태를 유지합니다.', '고객 접점을 극대화하는 모바일 인터페이스와 효율적인 예약 관리 시스템을 통해 고객 만족도를 높이고 CRM 데이터를 자산화합니다.', '학습 관리 시스템(LMS)을 통한 체계적인 교육 진행과 성취도 평가 분석 데이터를 바탕으로 개인화된 학습 경험을 제공합니다.', '공공 데이터의 표준 체계를 수립하고 메타데이터를 통합 관리하여 국가 정보 자원의 품질과 성능을 공정하게 평가합니다.' ]; var badgeColors = ['#3b82f6', '#10b981', '#f59e0b', '#334155']; tabs.forEach(function(tab) { tab.addEventListener('click', function() { var index = this.getAttribute('data-tab'); // 탭 활성화 전환 tabs.forEach(function(t) { t.classList.remove('active'); }); this.classList.add('active'); // 패널 전환 panels.forEach(function(p) { p.classList.remove('active'); }); var activePanel = document.querySelector('.cap-panel[data-panel="' + index + '"]'); if (activePanel) { activePanel.classList.add('active'); } // 설명 텍스트 업데이트 if (descText && descriptions[index]) { descText.textContent = descriptions[index]; } // 뱃지 색상 업데이트 if (badge && badgeColors[index]) { badge.style.backgroundColor = badgeColors[index]; } // 아이콘 재렌더링 lucide.createIcons(); }); }); })();