|
@@ -1335,7 +1335,7 @@
|
|
|
transform="matrix( 0.770660400390625, 0, 0, 0.770660400390625, 860.35,522.9) "
|
|
|
id="Anim_SaoMiaoCeFeng_All"
|
|
|
data-anim-id="Anim_SaoMiaoCeFeng_All"
|
|
|
- :class="{ 'animate-scan': isAnimating }"
|
|
|
+ :class="{ 'animate-scan-down': animateDrection === 'down', 'animate-scan-up': animateDrection === 'up' }"
|
|
|
>
|
|
|
<g transform="matrix( 1, 0, 0, 1, -139.2,5.95) " class="animate-blink">
|
|
|
<g transform="matrix( 1, 0, 0, 1, 0,0) ">
|
|
@@ -1454,7 +1454,8 @@
|
|
|
<script setup lang="ts">
|
|
|
import { onMounted, defineExpose, ref } from 'vue';
|
|
|
import { useSvgAnimation } from '/@/hooks/vent/useSvgAnimation';
|
|
|
- const isAnimating = ref(false);
|
|
|
+ const isAnimating = ref(false); // 动画是否在进行中
|
|
|
+ const animateDrection = ref<'' | 'down' | 'up'>(''); // 动画方向
|
|
|
// 动画持续时间(秒)
|
|
|
const ANIMATION_DURATION = 3;
|
|
|
// 元素信息(常量数据,使用Map)
|
|
@@ -1487,12 +1488,13 @@
|
|
|
// const scanSvg = ref<SVGSVGElement | null>(null);
|
|
|
|
|
|
/** 根据SVG的使用场景播放动画 */
|
|
|
- function animate() {
|
|
|
+ function animate(data?: any) {
|
|
|
// 在SVG图片中,找到需要动起来的元素(类似<use xlink:href="#RE_L_0_Layer0_0_FILL"></use>),并填入id即可控制该元素的动画(如有)
|
|
|
// triggerAnimation(['anim_saomiaocefeng_all'], false);
|
|
|
if (isAnimating.value) return; // 防止未挂载或重复触发
|
|
|
|
|
|
isAnimating.value = true;
|
|
|
+ animateDrection.value = data;
|
|
|
// 设置定时器,在动画结束后重置状态
|
|
|
setTimeout(() => {
|
|
|
isAnimating.value = false;
|
|
@@ -1533,11 +1535,16 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @keyframes scan {
|
|
|
+ @keyframes scanDown {
|
|
|
0% {
|
|
|
transform: matrix(0.770660400390625, 0, 0, 0.770660400390625, 860.35, 522.9);
|
|
|
}
|
|
|
- 50% {
|
|
|
+ 100% {
|
|
|
+ transform: matrix(0.770660400390625, 0, 0, 0.770660400390625, 860.35, 662.9);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ @keyframes scanUp {
|
|
|
+ 0% {
|
|
|
transform: matrix(0.770660400390625, 0, 0, 0.770660400390625, 860.35, 662.9);
|
|
|
}
|
|
|
100% {
|
|
@@ -1547,7 +1554,10 @@
|
|
|
.animate-blink {
|
|
|
animation: blink 3s infinite linear;
|
|
|
}
|
|
|
- .animate-scan {
|
|
|
- animation: scan 3s infinite forwards;
|
|
|
+ .animate-scan-down {
|
|
|
+ animation: scanDown 10s forwards;
|
|
|
+ }
|
|
|
+ .animate-scan-up {
|
|
|
+ animation: scanUp 2s forwards;
|
|
|
}
|
|
|
</style>
|