Ver código fonte

整理代码

任一存 3 anos atrás
pai
commit
6490d9571b
1 arquivos alterados com 13 adições e 8 exclusões
  1. 13 8
      src/views/HomeView.vue

+ 13 - 8
src/views/HomeView.vue

@@ -63,20 +63,25 @@ export default {
   },
   data() {
     return {
-      tourState: 0, // 0: 第一次镜头右移;1:宝物展示;2:第二次镜头右移
+      // 鼠标拖拽相关
+      isMouseDown: false,
+      lastMoveEventTimeStamp: 0,
+
+      // 动画帧相关
+      lastAnimationTimeStamp: 0,
+      animationFrameId: null,
+
+      tourState: 0, // 0: 第一次镜头平移阶段;1:宝物渐入过渡阶段;
 
+      // 镜头平移相关
+      moveSpeed: 0,
+      translateLength: 0,
       landscapePositionRight: '-50%',
       peopleFarPositionRight: '0px',
       peopleNearPositionRight: '-30%',
       introducePositionLeft: '2%',
-      translateLength: 0,
-      isMouseDown: false,
-
-      moveSpeed: 0,
-      lastMoveEventTimeStamp: 0,
-      lastAnimationTimeStamp: 0,
-      animationFrameId: null,
 
+      // 前景人物变色相关
       peopleNearColorStatus: 'no-color', // 'no-color', 'color'
       isPeopleNearColorChanging: false,
     }