[HTML] 날짜: 2025년 6월 16일 월요일 오후 5:24:02

This commit is contained in:
김현주
2025-06-16 17:35:16 +09:00
parent bc1b3a9c31
commit 29f7966457
5 changed files with 122 additions and 10 deletions

View File

@@ -0,0 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 21.5006L12 5.67773" stroke="#868E96" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4 11.7383L12 3.73828L20 11.7383" stroke="#868E96" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 345 B

View File

@@ -1,6 +1,6 @@
etUI.utils.ready(function () {
console.log('document ready');
etUI.initUI();
// etUI.initUI();
// [공통] 헤더 스크롤 관련 기능
etUI.pages.headerScroll = function () {
@@ -253,6 +253,66 @@ etUI.utils.ready(function () {
}
};
// [공통] top 버튼
etUI.pages.scrollTop = function () {
const floatingEl = document.querySelector('.floating-area');
const hasFooter = document.querySelector('.footer');
const isFixedBtn = document.querySelector('.component-btns.fixed');
let isVisible = false;
if (!floatingEl) return;
// 초기 숨김 상태 설정
gsap.set(floatingEl, {
opacity: 0,
// scale: 0,
pointerEvents: 'none'
});
etUI.hooks.useEventListener(window, 'scroll', () => {
const scrollY = window.scrollY;
// bottom 위치 설정
if (hasFooter) {
floatingEl.style.bottom = '72px';
} else if (isFixedBtn) {
floatingEl.style.bottom = '112px';
} else {
floatingEl.style.bottom = '';
}
if (scrollY <= 0 && isVisible) {
// 스크롤 맨 위: 숨기기
isVisible = false;
gsap.to(floatingEl, {
duration: 0.4,
opacity: 0,
// scale: 0,
pointerEvents: 'none',
ease: 'power4.out'
});
} else if (scrollY > 0 && !isVisible) {
// 스크롤 내림: 보이기
isVisible = true;
gsap.to(floatingEl, {
duration: 0.4,
opacity: 1,
scale: 1,
pointerEvents: 'auto',
ease: 'power4.out'
});
}
});
// 클릭 시 top으로 부드럽게 이동
etUI.hooks.useEventListener(floatingEl, 'click', () => {
window.scrollTo({
top: 0,
behavior: 'smooth'
});
});
};
document.fonts.ready.then(() => {
etUI.pages.initSwitchStyleToggle();
etUI.pages.initPriceInputComma();
@@ -262,5 +322,6 @@ etUI.utils.ready(function () {
etUI.pages.activeAppbarOnPath();
etUI.pages.headerScroll();
etUI.pages.tabButtonToggle();
etUI.pages.scrollTop();
});
});
});

File diff suppressed because one or more lines are too long

View File

@@ -6003,9 +6003,7 @@ button.swiper-pagination-bullet {
font-weight: 600;
}
.component-select.bottom-sheet .select-options {
display: -webkit-box;
display: -webkit-flex;
display: flex;
display: none;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
@@ -7762,6 +7760,27 @@ button.swiper-pagination-bullet {
padding-bottom: 0.8rem;
}
.floating-area {
opacity: 0;
position: fixed;
bottom: 7.4rem;
right: 1.6rem;
}
.floating-area .btn-top {
display: block;
width: 4.8rem;
height: 4.8rem;
border-radius: 50%;
background-image: url("../images/common/ico_btn_top.svg");
background-color: #ffffff;
background-size: 2.4rem 2.4rem;
background-repeat: no-repeat;
background-position: center;
border: 0.1rem solid #E9ECEF;
box-shadow: 0px 3px 8px 0px rgba(0, 0, 0, 0.1);
z-index: 2;
}
.detail-wrap {
margin-top: 3.2rem;
}