Jelajahi Sumber

home页 文脉出现动效

任一存 3 tahun lalu
induk
melakukan
b0d9368d3b

TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0000.png


TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0001.png


TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0002.png


TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0003.png


TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0004.png


TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0005.png


TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0006.png


TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0007.png


TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0008.png


TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0009.png


TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0010.png


TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0011.png


TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0012.png


TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0013.png


TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0014.png


TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0015.png


TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0016.png


TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0017.png


TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0018.png


TEMPAT SAMPAH
public/wenmai-frames/Abstract Element _0019.png


+ 48 - 1
src/views/Home.vue

@@ -25,7 +25,18 @@
       src="@/assets/image/博物馆的力量.png"
       alt=""
     >
-    <SlideTip />
+    <div class="slide-tip-emerge">
+      <img
+        v-for="index of 20"
+        v-show="currentFrameIdx === index - 1"
+        :key="index"
+        :src="`/wenmai-frames/Abstract Element _${(index - 1).toString().padStart(4, '0')}.png`"
+        alt=""
+        @load="onImgLoad(index - 1)"
+        @error="onImgError(index - 1)"
+      >
+    </div>
+    <SlideTip v-if="currentFrameIdx >= 20" />
     <div class="bottom-wrapper">
       <img
         class="jiangsu"
@@ -55,6 +66,9 @@
 export default {
   data() {
     return {
+      currentFrameIdx: 0,
+      imgStateList: new Array(20),
+      loadCountDown: 20,
     }
   },
   mounted() {
@@ -66,8 +80,31 @@ export default {
       console.log(ev)
       that.$router.push({ name: 'TreeAnimation' })
     })
+
+    this.intervalId = setInterval(() => {
+      if ((this.loadCountDown === 0)) {
+        do {
+          this.currentFrameIdx++
+        } while (this.imgStateList[this.currentFrameIdx] === false)
+        if (this.currentFrameIdx >= 20) {
+          clearInterval(this.intervalId)
+        }
+      }
+    }, 41)
   },
   methods: {
+    onImgLoad(idx) {
+      if (idx < 100) {
+        this.loadCountDown--
+      }
+      this.imgStateList[idx] = true
+    },
+    onImgError(idx) {
+      if (idx < 100) {
+        this.loadCountDown--
+      }
+      this.imgStateList[idx] = false
+    }
   }
 }
 </script>
@@ -107,6 +144,16 @@ export default {
     left: 50%;
     transform: translateX(-50%);
   }
+  .slide-tip-emerge {
+    position: absolute;
+    left: 50%;
+    bottom: 10rem;
+    transform: translateX(-50%);
+    img {
+      display: inline-block;
+      width: 8rem;
+    }
+  }
   .bottom-wrapper {
     position: absolute;
     width: 100%;