added Back To Top functionality and Pankuzu list, Q and A Box, and Hamburger menu components

This commit is contained in:
2024-10-12 20:52:13 +09:00
parent 545ac73e0e
commit e99db9f8bd
80 changed files with 1413 additions and 723 deletions

View File

@@ -0,0 +1,29 @@
/**
* Vue Composable for getting scroll distance
* @module composables/scrollDistance
*/
/**
* Vue Composable for getting scroll distance of client
* @returns {globalThis.Ref<number, number>} reference to the scroll distance value
*/
function useScrollDistance() {
const scrollDistance = ref<number>(0);
function update() {
if (import.meta.client) {
scrollDistance.value = window.scrollY;
}
}
onMounted(() => {
update();
window.addEventListener("scroll", update);
});
onUnmounted(() => window.removeEventListener("scroll", update));
return scrollDistance;
}
export { useScrollDistance };