|
|
@ -1,11 +1,11 @@ |
|
|
|
<template> |
|
|
|
<div class="header_line_container" ref="el"> |
|
|
|
<h2 class="title" ref="titleRef">{{ title }}</h2> |
|
|
|
<p class="line" ref="lineRef"></p> |
|
|
|
<p class="desc" v-if="line1" ref="descRef1"> |
|
|
|
<h2 class="title">{{ title }}</h2> |
|
|
|
<p class="line"></p> |
|
|
|
<p class="desc" v-if="line1"> |
|
|
|
{{ line1 }} |
|
|
|
</p> |
|
|
|
<p :class="margin ? 'desc mt' : 'desc'" v-if="line2" ref="descRef2"> |
|
|
|
<p :class="margin ? 'desc mt' : 'desc'" v-if="line2"> |
|
|
|
{{ line2 }} |
|
|
|
</p> |
|
|
|
</div> |
|
|
@ -14,10 +14,6 @@ |
|
|
|
<script setup> |
|
|
|
import { ref, onMounted } from 'vue' |
|
|
|
const el = ref(null) |
|
|
|
const titleRef = ref(null) |
|
|
|
const lineRef = ref(null) |
|
|
|
const descRef1 = ref(null) |
|
|
|
const descRef2 = ref(null) |
|
|
|
const props = defineProps({ |
|
|
|
title: { |
|
|
|
type: String, |
|
|
@ -36,10 +32,7 @@ onMounted(() => { |
|
|
|
const observer = new IntersectionObserver(entries => { |
|
|
|
entries.forEach(entry => { |
|
|
|
if (entry.isIntersecting) { |
|
|
|
animateCSS(titleRef.value, 'fadeInUp') |
|
|
|
animateCSS(lineRef.value, 'fadeInUp') |
|
|
|
animateCSS(descRef1.value, 'fadeInUp') |
|
|
|
animateCSS(descRef2.value, 'fadeInUp') |
|
|
|
animateCSS(el.value, 'fadeInUp') |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|