Skip to main content
Skip to footer
document.addEventListener("DOMContentLoaded", function () {
// URL에 hash가 있는지 확인
if (window.location.hash) {
// smoother 객체가 로딩 완료될 때까지 약간 딜레이 주기
setTimeout(() => {
const target = document.querySelector(window.location.hash);
if (target) {
// ScrollSmoother가 있다면 Smoother 사용
if (window.smoother) {
smoother.scrollTo(target, true); // true = animate
} else {
// smoother 없으면 기본 동작 fallback
target.scrollIntoView({ behavior: "smooth" });
}
}
}, 300); // 스무더 초기화 시간 때문에 200~400ms 필요
}
});