|
@@ -46,14 +46,13 @@
|
46
|
46
|
|
47
|
47
|
<div class="groups abs">
|
48
|
48
|
<div>
|
49
|
|
- <div>
|
50
|
|
- <img class="ruins" src="/images/pg2/废墟.png" alt />
|
51
|
|
- </div>
|
|
49
|
+ <InkEffect class="ink-ruins" src="./images/pg2/废墟color.png" :speed="10" :active="inkActive" :clearable="true" />
|
|
50
|
+ <img class="ruins" src="/images/pg2/废墟.png" alt />
|
52
|
51
|
</div>
|
53
|
52
|
</div>
|
54
|
53
|
<div class="flower1">
|
55
|
54
|
<div>
|
56
|
|
- <img src="/images/pg2/flower1.png" alt="" />
|
|
55
|
+ <img :class="{'flower-fly': show}" src="/images/pg2/flower1.png" alt="" @animationend="inkActive = true" />
|
57
|
56
|
</div>
|
58
|
57
|
</div>
|
59
|
58
|
|
|
@@ -71,47 +70,55 @@
|
71
|
70
|
</template>
|
72
|
71
|
|
73
|
72
|
<script setup>
|
74
|
|
-import { reactive, ref } from "vue";
|
75
|
|
-import { useRouter } from "vue-router";
|
76
|
|
-import Bell from "@/components/Bell.vue";
|
77
|
|
-import Animate from "@/components/Animate.vue";
|
78
|
|
-import Cloud from "./Cloud.vue";
|
79
|
|
-import Smoke from "./smoke.vue";
|
80
|
|
-import Flower1 from "./flower/Flower1.vue";
|
81
|
|
-import Flower2 from "./flower/Flower2.vue";
|
82
|
|
-import Flower3 from "./flower/Flower3.vue";
|
83
|
|
-import usePageShow from "../usePageShow";
|
84
|
|
-
|
85
|
|
-const router = useRouter();
|
86
|
|
-
|
87
|
|
-const onClick = () => {
|
88
|
|
- router.push(`/pg2-2`);
|
89
|
|
-};
|
90
|
|
-
|
91
|
|
-const flowerAnimate = reactive({
|
92
|
|
- left: "",
|
93
|
|
- right: "",
|
94
|
|
-});
|
95
|
|
-
|
96
|
|
-let lastRatio = 0;
|
97
|
|
-const flowShow = ({ intersectionRatio }) => {
|
98
|
|
- console.log(intersectionRatio);
|
99
|
|
- const isIn = intersectionRatio > 0.5 && intersectionRatio > lastRatio;
|
100
|
|
- const isOut = intersectionRatio < 0.9 && intersectionRatio < lastRatio;
|
101
|
|
-
|
102
|
|
- if (isIn) {
|
103
|
|
- flowerAnimate.left = "animate__fadeInLeft";
|
104
|
|
- flowerAnimate.right = "animate__fadeInRight";
|
105
|
|
- }
|
106
|
|
- if (isOut) {
|
107
|
|
- flowerAnimate.left = "animate__fadeOutLeft";
|
108
|
|
- flowerAnimate.right = "animate__fadeOutRight";
|
109
|
|
- }
|
|
73
|
+ import { reactive, ref, watch } from "vue";
|
|
74
|
+ import { useRouter } from "vue-router";
|
|
75
|
+ import Bell from "@/components/Bell.vue";
|
|
76
|
+ import Animate from "@/components/Animate.vue";
|
|
77
|
+ import InkEffect from "@/components/InkEffect.vue";
|
|
78
|
+ import Cloud from "./Cloud.vue";
|
|
79
|
+ import Smoke from "./smoke.vue";
|
|
80
|
+ import Flower1 from "./flower/Flower1.vue";
|
|
81
|
+ import Flower2 from "./flower/Flower2.vue";
|
|
82
|
+ import Flower3 from "./flower/Flower3.vue";
|
|
83
|
+ import usePageShow from "../usePageShow";
|
|
84
|
+
|
|
85
|
+ const router = useRouter();
|
|
86
|
+ const inkActive = ref(false);
|
|
87
|
+
|
|
88
|
+ const onClick = () => {
|
|
89
|
+ router.push(`/pg2-2`);
|
|
90
|
+ };
|
|
91
|
+
|
|
92
|
+ const flowerAnimate = reactive({
|
|
93
|
+ left: "",
|
|
94
|
+ right: "",
|
|
95
|
+ });
|
|
96
|
+
|
|
97
|
+ let lastRatio = 0;
|
|
98
|
+ const flowShow = ({ intersectionRatio }) => {
|
|
99
|
+ console.log(intersectionRatio);
|
|
100
|
+ const isIn = intersectionRatio > 0.5 && intersectionRatio > lastRatio;
|
|
101
|
+ const isOut = intersectionRatio < 0.9 && intersectionRatio < lastRatio;
|
|
102
|
+
|
|
103
|
+ if (isIn) {
|
|
104
|
+ flowerAnimate.left = "animate__fadeInLeft";
|
|
105
|
+ flowerAnimate.right = "animate__fadeInRight";
|
|
106
|
+ }
|
|
107
|
+ if (isOut) {
|
|
108
|
+ flowerAnimate.left = "animate__fadeOutLeft";
|
|
109
|
+ flowerAnimate.right = "animate__fadeOutRight";
|
|
110
|
+ }
|
|
111
|
+
|
|
112
|
+ lastRatio = intersectionRatio;
|
|
113
|
+ };
|
110
|
114
|
|
111
|
|
- lastRatio = intersectionRatio;
|
112
|
|
-};
|
|
115
|
+ const [pgRef, show] = usePageShow(flowShow);
|
113
|
116
|
|
114
|
|
-const [pgRef, show] = usePageShow(flowShow);
|
|
117
|
+ watch(show, (val) => {
|
|
118
|
+ if (!val) {
|
|
119
|
+ inkActive.value = false;
|
|
120
|
+ }
|
|
121
|
+ })
|
115
|
122
|
</script>
|
116
|
123
|
|
117
|
124
|
<style lang="less" scoped>
|
|
@@ -170,6 +177,15 @@ const [pgRef, show] = usePageShow(flowShow);
|
170
|
177
|
z-index: 2;
|
171
|
178
|
position: relative;
|
172
|
179
|
}
|
|
180
|
+
|
|
181
|
+ .ink-ruins {
|
|
182
|
+ position: absolute;
|
|
183
|
+ z-index: 4;
|
|
184
|
+ top: 0;
|
|
185
|
+ left: 0;
|
|
186
|
+ width: 100%;
|
|
187
|
+ height: 100%;
|
|
188
|
+ }
|
173
|
189
|
}
|
174
|
190
|
.flower1 {
|
175
|
191
|
position: absolute;
|
|
@@ -184,6 +200,29 @@ const [pgRef, show] = usePageShow(flowShow);
|
184
|
200
|
width: 50px;
|
185
|
201
|
}
|
186
|
202
|
}
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+ .flower-fly {
|
|
206
|
+ transform-origin: left bottom;
|
|
207
|
+ animation: flower-fly 3s ease-in-out 1s forwards;
|
|
208
|
+ }
|
|
209
|
+
|
|
210
|
+ @keyframes flower-fly {
|
|
211
|
+ 0% {
|
|
212
|
+ transform: rotate(0) translate3d(0, 0, 0);
|
|
213
|
+ opacity: 1;
|
|
214
|
+ }
|
|
215
|
+
|
|
216
|
+ 90% {
|
|
217
|
+ opacity: 0;
|
|
218
|
+ }
|
|
219
|
+
|
|
220
|
+ 100% {
|
|
221
|
+ transform: rotate(180deg) translate3d(-60vw, -6vh, 0);
|
|
222
|
+ opacity: 0;
|
|
223
|
+ }
|
|
224
|
+ }
|
|
225
|
+
|
187
|
226
|
.flower2 {
|
188
|
227
|
position: absolute;
|
189
|
228
|
z-index: 20;
|