浏览代码

自测bug fix

任一存 1 年之前
父节点
当前提交
c341fadbff
共有 2 个文件被更改,包括 18 次插入16 次删除
  1. 15 8
      src/useFunctions/useSmoothSwipe.js
  2. 3 8
      src/views/MoreContent.vue

+ 15 - 8
src/useFunctions/useSmoothSwipe.js

@@ -95,6 +95,11 @@ export default function useSmoothSwipe({
     })
   }
 
+  function onWheel(e) {
+    console.log(e)
+    translateLength.value += e.deltaY / 2.5
+  }
+
   /**
    * swipe begin
    */
@@ -256,14 +261,15 @@ export default function useSmoothSwipe({
   if (scrollTargetRef) {
     watch(scrollTargetRef, (v) => {
       if (v) {
-        v.addEventListener('mousedown', onMouseDown)
-        v.addEventListener('mouseleave', onMouseLeave)
-        v.addEventListener('mousemove', onMouseMove)
-        v.addEventListener('mouseup', onMouseUp)
-        v.addEventListener('touchstart', onTouchStart)
-        v.addEventListener('touchmove', onTouchMove)
-        v.addEventListener('touchend', onTouchEnd)
-        v.addEventListener('touchcancel', onTouchCancel)
+        v.addEventListener('wheel', onWheel)
+        // v.addEventListener('mousedown', onMouseDown)
+        // v.addEventListener('mouseleave', onMouseLeave)
+        // v.addEventListener('mousemove', onMouseMove)
+        // v.addEventListener('mouseup', onMouseUp)
+        // v.addEventListener('touchstart', onTouchStart)
+        // v.addEventListener('touchmove', onTouchMove)
+        // v.addEventListener('touchend', onTouchEnd)
+        // v.addEventListener('touchcancel', onTouchCancel)
       }
     }, {
       immediate: true,
@@ -275,6 +281,7 @@ export default function useSmoothSwipe({
   }
 
   return {
+    onWheel,
     onMouseDown,
     onMouseLeave,
     onMouseMove,

+ 3 - 8
src/views/MoreContent.vue

@@ -275,11 +275,6 @@ const maxTranslateLength = computed(() => {
   return (windowHeight.value * windowWidthDesign) / windowHeightDesign
 })
 
-const positionNumInit = computed(() => {
-  console.log("x=", windowWidth.value / windowHeight.value)
-  return windowWidth.value / windowHeight.value >= 0.5 ? 236 : 206
-})
-
 const {
   translateLength,
 } = useSmoothSwipe({
@@ -300,7 +295,7 @@ const layer4Left = ref(layer4InitialLeft)
 
 // layer3Left位移
 const layer3SpeedFactor = 0.8 * 0.8
-const layer3InitialLeft = 0
+const layer3InitialLeft = 600 * windowHeight.value / windowHeightDesign
 const layer3Left = ref(layer3InitialLeft)
 
 // layer2Left位移
@@ -513,7 +508,7 @@ const OpenScene = () => {
       }
       .painting-creation-group {
         position: absolute;
-        left: calc(2050px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
+        left: calc(2100px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
         top: calc(243px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
         > .button-group {
           position: absolute;
@@ -552,7 +547,7 @@ const OpenScene = () => {
         position: absolute;
         top: 0;
         height: 100%;
-        left: calc(2650px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
+        left: calc(3700px * v-bind("windowHeight") / v-bind("windowHeightDesign"));
         font-family: "KingHwa_OldSong";
         z-index: 2;
         display: flex;