|
@@ -3,7 +3,7 @@
|
|
|
id="ability"
|
|
id="ability"
|
|
|
ref="abilityRef"
|
|
ref="abilityRef"
|
|
|
class="ability transition-all duration-1000 ease-out"
|
|
class="ability transition-all duration-1000 ease-out"
|
|
|
- :class="[isAbilityVisible ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-100px']"
|
|
|
|
|
|
|
+ :class="[isVisible ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-100px']"
|
|
|
>
|
|
>
|
|
|
<div class="ability-title pf-sc-semibold">一体化智慧解决方案</div>
|
|
<div class="ability-title pf-sc-semibold">一体化智慧解决方案</div>
|
|
|
<div class="ability-desc pf-sc-regular">
|
|
<div class="ability-desc pf-sc-regular">
|
|
@@ -58,7 +58,7 @@
|
|
|
import { abilityTabs, abilities } from '@/constants/common'
|
|
import { abilityTabs, abilities } from '@/constants/common'
|
|
|
|
|
|
|
|
const abilityRef = ref<HTMLElement | null>(null)
|
|
const abilityRef = ref<HTMLElement | null>(null)
|
|
|
- const isAbilityVisible = ref(false)
|
|
|
|
|
|
|
+ const { isVisible } = useScrollReveal(abilityRef)
|
|
|
|
|
|
|
|
const activeAbilityTab = ref<AbilityTab>(abilityTabs[0] as AbilityTab)
|
|
const activeAbilityTab = ref<AbilityTab>(abilityTabs[0] as AbilityTab)
|
|
|
|
|
|
|
@@ -72,23 +72,6 @@
|
|
|
const handleAbilityTabClick = (tab: AbilityTab) => {
|
|
const handleAbilityTabClick = (tab: AbilityTab) => {
|
|
|
activeAbilityTab.value = tab
|
|
activeAbilityTab.value = tab
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- onMounted(() => {
|
|
|
|
|
- const observer = new IntersectionObserver(
|
|
|
|
|
- (entries) => {
|
|
|
|
|
- entries.forEach((entry) => {
|
|
|
|
|
- if (!entry.isIntersecting) return
|
|
|
|
|
- isAbilityVisible.value = true
|
|
|
|
|
- observer.unobserve(entry.target)
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- { threshold: 0.1 }
|
|
|
|
|
- )
|
|
|
|
|
-
|
|
|
|
|
- if (abilityRef.value) {
|
|
|
|
|
- observer.observe(abilityRef.value)
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|