feat: 初始化慧遇书院官网一期

This commit is contained in:
2026-08-12 18:01:17 +08:00
commit 5d31ee5743
101 changed files with 17259 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
<script setup lang="ts">
const root = ref<HTMLElement>()
const visible = ref(false)
let observer: IntersectionObserver | undefined
onMounted(() => {
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
visible.value = true
return
}
observer = new IntersectionObserver(([entry]) => {
if (entry?.isIntersecting) {
visible.value = true
observer?.disconnect()
}
}, { threshold: 0.16 })
if (root.value) observer.observe(root.value)
})
onBeforeUnmount(() => observer?.disconnect())
</script>
<template>
<section ref="root" :class="['reveal-section', { visible }]">
<slot />
</section>
</template>