back btn 추가

This commit is contained in:
yoon 2025-03-24 10:25:49 +09:00
parent 9249610442
commit 676636b246
2 changed files with 23 additions and 3 deletions

View File

@ -591,25 +591,31 @@
/* Scroll Button */
.scroll-top-btn {
bottom: 20px;
bottom: 40px;
right: 21.7%;
transition:
opacity 0.4s ease,
visibility 0.4s ease,
transform 0.4s ease;
}
.scroll-top-btn.visible {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
.scroll-top-btn.hidden {
opacity: 0;
visibility: hidden;
transform: translateY(10px);
}
.back-btn {
bottom: 40px;
right: 21.7%;
transition: transform 0.4s ease;
}
.back-btn.shifted {
transform: translateY(-50px);
}
/* Scroll Button end */

View File

@ -1,4 +1,13 @@
<template>
<!-- 뒤로가기 -->
<button
@click="goBack"
:class="{ 'shifted': showButton }"
class="back-btn rounded-pill btn-icon btn-secondary position-fixed shadow z-5 border-0">
<i class='bx bx-chevron-left'></i>
</button>
<!-- 위로 -->
<button
@click="scrollToTop"
class="scroll-top-btn rounded-pill btn-icon btn-primary position-fixed shadow z-5 border-0"
@ -21,6 +30,11 @@ const scrollToTop = () => {
window.scrollTo({ top: 0, behavior: "smooth" });
};
const goBack = () => {
window.history.back();
};
onMounted(() => {
window.addEventListener("scroll", handleScroll);
});