Xeovalyte
e1ed3d53db
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
30 lines
736 B
Vue
30 lines
736 B
Vue
<template>
|
|
<LayoutLeftbar />
|
|
<div id="observe" class="h-screen snap-y snap-mandatory overflow-y-auto overflow-x-hidden bg-dark-200">
|
|
<SlidesHeading id="heading" />
|
|
<SlidesAbout id="about" />
|
|
<SlidesSkills id="skills" />
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
const router = useRouter()
|
|
|
|
const callback = (entries, observer) => {
|
|
entries.forEach(entry => {
|
|
if (entry.isIntersecting) {
|
|
router.replace({ hash: '#' + entry.target.id})
|
|
}
|
|
})
|
|
}
|
|
|
|
onMounted(() => {
|
|
let targets = document.querySelectorAll('section')
|
|
const observer = new IntersectionObserver(callback, { root: document.querySelector('#observe'), threshold: 0.9 })
|
|
|
|
targets.forEach(target => {
|
|
observer.observe(target)
|
|
})
|
|
})
|
|
</script>
|