/* import Lenis from '@studio-freight/lenis' import gsap from 'gsap' import ScrollTrigger from 'gsap/ScrollTrigger' */ gsap.registerPlugin(ScrollTrigger) // Lenis ÃʱâÈ­ const lenis = new Lenis({ duration: 1.5, easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)), smooth: true }) // raf ·çÇÁ function raf(time) { lenis.raf(time) requestAnimationFrame(raf) } requestAnimationFrame(raf) // Lenis¿Í ScrollTrigger ¿¬°á lenis.on('scroll', ScrollTrigger.update) ScrollTrigger.scrollerProxy(document.body, { scrollTop(value) { if (arguments.length) { lenis.scrollTo(value) } return window.scrollY }, getBoundingClientRect() { return { top: 0, left: 0, width: window.innerWidth, height: window.innerHeight } }, // pinTypeÀº bodyÀÇ overflow ¹æ½Ä¿¡ µû¶ó °áÁ¤ //pinType: 'transform' pinType: document.body.style.transform ? 'transform' : 'fixed' }) // ½ºÅ©·Ñ À§Ä¡°¡ º¯ÇßÀ½À» ¾Ë·ÁÁÜ ScrollTrigger.addEventListener('refresh', () => lenis.update()) ScrollTrigger.refresh() // ¾ÞÄ¿ ¸µÅ© Ŭ¸¯ ½Ã ºÎµå·¯¿î À̵¿ document.querySelectorAll('a[href^="#"]').forEach(link => { link.addEventListener('click', e => { e.preventDefault() const targetId = link.getAttribute('href') const targetEl = document.querySelector(targetId) if (targetEl) { lenis.scrollTo(targetEl, { offset: 0, // Çì´õ ³ôÀ̸¸Å­ Á¶Àý : -50 duration: 1.2, easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)) }) } }) }) /* // ¾ÞÄ¿ ¸µÅ© Ŭ¸¯ ½Ã ºÎµå·¯¿î À̵¿ document.querySelectorAll('.anchor-link').forEach((link) => { link.addEventListener('click', (e) => { e.preventDefault() const targetId = link.getAttribute('href') const targetElement = document.querySelector(targetId) if (targetElement) { lenis.scrollTo(targetElement, { offset: 0, // ¿øÇÏ´Â ¸¸Å­ ¿ÀÇÁ¼Â Á¶Àý °¡´É duration: 1.2, // ¾Ö´Ï¸ÞÀÌ¼Ç Áö¼Ó ½Ã°£ (ÃÊ) easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)) // ÀÌ¡ Ä¿½ºÅÒ °¡´É }) } }) }) */