1
0
mirror of https://github.com/sendevia/website.git synced 2026-03-06 15:42:34 +08:00

feat(ScrollToTop): replace IDs with classes in ScrollToTop component

This commit is contained in:
2025-12-05 23:33:10 +08:00
parent f69f79b453
commit 385eac5881
2 changed files with 9 additions and 9 deletions

View File

@@ -4,14 +4,14 @@ import { useGlobalScroll } from "../composables/useGlobalScroll";
const { isScrolled } = useGlobalScroll({ threshold: 500 });
function scrollToTop() {
const container = document.getElementById("layout-content-flow");
const container = document.getElementById("contentFlow");
(container as HTMLElement).scrollTo({ top: 0, behavior: "smooth" });
}
</script>
<template>
<div id="layout-scrolltop" :class="{ visible: isScrolled }">
<span id="scrolltop-button" role="button" aria-label="Scroll to top" @click="scrollToTop"> arrow_upward </span>
<div class="ScrollToTop" :class="{ visible: isScrolled }">
<span class="button" role="button" aria-label="Scroll to top" @click="scrollToTop"> arrow_upward </span>
</div>
</template>

View File

@@ -1,6 +1,6 @@
@use "../mixin";
#layout-scrolltop {
.ScrollToTop {
display: flex;
align-items: center;
grid-column: 10 / 13;
@@ -20,7 +20,7 @@
visibility: hidden;
z-index: 21;
#scrolltop-button {
.button {
@include mixin.material-symbols($size: 24, $line-height: 84);
position: relative;
@@ -52,25 +52,25 @@
}
@media screen and (max-width: 1600px) {
#layout-scrolltop {
.ScrollToTop {
grid-column: 10 / 13;
}
}
@media screen and (max-width: 1200px) {
#layout-scrolltop {
.ScrollToTop {
grid-column: 7 / 9;
}
}
@media screen and (max-width: 840px) {
#layout-scrolltop {
.ScrollToTop {
grid-column: 6 / 7;
}
}
@media screen and (max-width: 600px) {
#layout-scrolltop {
.ScrollToTop {
grid-column: 4 / 5;
}
}