ソースを参照

树生长分段播放

任一存 3 年 前
コミット
e17fb8b9fe
3 ファイル変更45 行追加8 行削除
  1. 1 1
      public/index.html
  2. 1 1
      src/main.js
  3. 43 6
      src/views/TreeAnimation.vue

+ 1 - 1
public/index.html

@@ -5,7 +5,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
     <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
     <link rel="icon" href="<%= BASE_URL %>icon.jpg">
     <link rel="icon" href="<%= BASE_URL %>icon.jpg">
-    <title>v0.9 5.18博物馆的力量--奔赴美好生活</title>
+    <title>v0.10 5.18博物馆的力量--奔赴美好生活</title>
     <script src="<%= BASE_URL %>libs/hammer.js"></script>
     <script src="<%= BASE_URL %>libs/hammer.js"></script>
   </head>
   </head>
   <body>
   <body>

+ 1 - 1
src/main.js

@@ -1,4 +1,4 @@
-console.log('v0.9')
+console.log('v0.10')
 
 
 import Vue from 'vue'
 import Vue from 'vue'
 import App from './App.vue'
 import App from './App.vue'

+ 43 - 6
src/views/TreeAnimation.vue

@@ -77,11 +77,42 @@ export default {
 
 
       this.timeoutId = setTimeout(() => {
       this.timeoutId = setTimeout(() => {
         this.treeImageNode = document.getElementById('tree-image')
         this.treeImageNode = document.getElementById('tree-image')
-        const tween = new TWEEN.Tween(this.animationBottom)
-        tween.to({
+
+        const tween1 = new TWEEN.Tween(this.animationBottom)
+        tween1.to({
+          value: -this.treeImageNode.clientHeight * 0.305
+        }, 39344 * 0.305)
+        tween1.easing(TWEEN.Easing.Sinusoidal.InOut)
+
+        const tween2 = new TWEEN.Tween(this.animationBottom)
+        tween2.to({
+          value: -this.treeImageNode.clientHeight * 0.50
+        }, 39344 * (0.50 - 0.305))
+        tween2.easing(TWEEN.Easing.Sinusoidal.InOut)
+
+        const tween3 = new TWEEN.Tween(this.animationBottom)
+        tween3.to({
+          value: -this.treeImageNode.clientHeight * 0.59
+        }, 39344 * (0.59 - 0.50))
+        tween3.easing(TWEEN.Easing.Sinusoidal.InOut)
+
+        const tween4 = new TWEEN.Tween(this.animationBottom)
+        tween4.to({
+          value: -this.treeImageNode.clientHeight * 0.7
+        }, 39344 * (0.7 - 0.59))
+        tween4.easing(TWEEN.Easing.Sinusoidal.InOut)
+
+        const tween5 = new TWEEN.Tween(this.animationBottom)
+        tween5.to({
+          value: -this.treeImageNode.clientHeight * 0.8
+        }, 39344 * (0.8 - 0.7))
+        tween5.easing(TWEEN.Easing.Sinusoidal.InOut)
+
+        const tween6 = new TWEEN.Tween(this.animationBottom)
+        tween6.to({
           value: window.innerHeight - this.treeImageNode.clientHeight
           value: window.innerHeight - this.treeImageNode.clientHeight
-        }, 45000)
-        tween.onComplete(() => {
+        }, 39344 * (1 - 0.8) - 39344 * window.innerHeight / this.treeImageNode.clientHeight)
+        tween6.onComplete(() => {
           this.showSlideTip = true
           this.showSlideTip = true
 
 
           let mc = new Hammer(this.$refs['hammer-target'])
           let mc = new Hammer(this.$refs['hammer-target'])
@@ -92,9 +123,15 @@ export default {
             that.$router.push({ name: 'TreeSelection' })
             that.$router.push({ name: 'TreeSelection' })
           })
           })
         })
         })
-        tween.easing(TWEEN.Easing.Sinusoidal.InOut)
-        tween.start()
+        tween6.easing(TWEEN.Easing.Sinusoidal.InOut)
+
+        tween1.chain(tween2)
+        tween2.chain(tween3)
+        tween3.chain(tween4)
+        tween4.chain(tween5)
+        tween5.chain(tween6)
 
 
+        tween1.start()
         this.requestAnimationId = this.animate()
         this.requestAnimationId = this.animate()
       }, 1000)
       }, 1000)
     }
     }