TIANYONG 1 year ago
parent
commit
20aeb3a1bf

+ 8 - 8
dist/colexiu.html

@@ -2,7 +2,7 @@
 <html lang="en">
 
 <head>
-  <script type="module" crossorigin src="./js/polyfills-fdbee6c4.js"></script>
+  <script type="module" crossorigin src="./js/polyfills-e59429fb.js"></script>
 
   <meta charset="UTF-8" />
   <link rel="icon" type="image/svg+xml" href="./vite.svg" />
@@ -40,12 +40,12 @@
       },
     })
   </script>
-  <script type="module" crossorigin src="./js/colexiu-7bbbd5cb.js"></script>
-  <link rel="modulepreload" crossorigin href="./js/index-f598c6bf.js">
-  <link rel="modulepreload" crossorigin href="./js/index-68ca15d1.js">
-  <link rel="modulepreload" crossorigin href="./js/index-85e52b6c.js">
+  <script type="module" crossorigin src="./js/colexiu-7212d287.js"></script>
+  <link rel="modulepreload" crossorigin href="./js/index-2bd63e09.js">
+  <link rel="modulepreload" crossorigin href="./js/index-2b9aef9a.js">
+  <link rel="modulepreload" crossorigin href="./js/index-2fb18736.js">
   <link rel="stylesheet" href="./css/index-8634d3f1.css">
-  <link rel="stylesheet" href="./css/colexiu-62f31c4f.css">
+  <link rel="stylesheet" href="./css/colexiu-e8b419b5.css">
   <script type="module">import.meta.url;import("_").catch(()=>1);async function* g(){};window.__vite_is_modern_browser=true;</script>
   <script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy chunks, syntax error above and the same error below should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script>
 </head>
@@ -55,8 +55,8 @@
   <img id="loading" class="show" src="./loading.svg" alt="loading" />
   
   <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
-  <script nomodule crossorigin id="vite-legacy-polyfill" src="./js/polyfills-legacy-77fa62bb.js"></script>
-  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/colexiu-legacy-63977e90.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+  <script nomodule crossorigin id="vite-legacy-polyfill" src="./js/polyfills-legacy-113d9ef4.js"></script>
+  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/colexiu-legacy-a0dd1ca8.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
 </body>
 
 </html>

+ 7 - 7
dist/index.html

@@ -2,7 +2,7 @@
 <html lang="ZH-cn">
 
 <head>
-  <script type="module" crossorigin src="./js/polyfills-fdbee6c4.js"></script>
+  <script type="module" crossorigin src="./js/polyfills-e59429fb.js"></script>
 
   <meta charset="UTF-8">
   <link rel="icon" href="./favicon.ico" />
@@ -75,10 +75,10 @@
       }
     })
   </script>
-  <script type="module" crossorigin src="./js/gym-fe431f43.js"></script>
-  <link rel="modulepreload" crossorigin href="./js/index-f598c6bf.js">
-  <link rel="modulepreload" crossorigin href="./js/index-68ca15d1.js">
-  <link rel="modulepreload" crossorigin href="./js/index-fe7dd51e.js">
+  <script type="module" crossorigin src="./js/gym-bbfbe2ae.js"></script>
+  <link rel="modulepreload" crossorigin href="./js/index-2bd63e09.js">
+  <link rel="modulepreload" crossorigin href="./js/index-2b9aef9a.js">
+  <link rel="modulepreload" crossorigin href="./js/index-85618896.js">
   <link rel="modulepreload" crossorigin href="./js/plyr.min-c8c2777b.js">
   <link rel="stylesheet" href="./css/index-8634d3f1.css">
   <link rel="stylesheet" href="./css/index-85f95688.css">
@@ -97,8 +97,8 @@
   <img id="loading" class="show" src="./loading.svg" alt="loading" />
   
   <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
-  <script nomodule crossorigin id="vite-legacy-polyfill" src="./js/polyfills-legacy-77fa62bb.js"></script>
-  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/gym-legacy-3774eedc.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+  <script nomodule crossorigin id="vite-legacy-polyfill" src="./js/polyfills-legacy-113d9ef4.js"></script>
+  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/gym-legacy-cba77a72.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
 </body>
 
 </html>

+ 5 - 5
dist/instrument.html

@@ -2,7 +2,7 @@
 <html lang="en">
 
 <head>
-  <script type="module" crossorigin src="./js/polyfills-fdbee6c4.js"></script>
+  <script type="module" crossorigin src="./js/polyfills-e59429fb.js"></script>
 
   <meta charset="UTF-8" />
   <meta name="viewport"
@@ -41,8 +41,8 @@
       })
     }
   </script>
-  <script type="module" crossorigin src="./js/instrument-8a3fe70f.js"></script>
-  <link rel="modulepreload" crossorigin href="./js/index-f598c6bf.js">
+  <script type="module" crossorigin src="./js/instrument-3b49ec36.js"></script>
+  <link rel="modulepreload" crossorigin href="./js/index-2bd63e09.js">
   <link rel="stylesheet" href="./css/index-8634d3f1.css">
   <link rel="stylesheet" href="./css/instrument-28f98fa4.css">
   <script type="module">import.meta.url;import("_").catch(()=>1);async function* g(){};window.__vite_is_modern_browser=true;</script>
@@ -62,8 +62,8 @@
 
   
   <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
-  <script nomodule crossorigin id="vite-legacy-polyfill" src="./js/polyfills-legacy-77fa62bb.js"></script>
-  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/instrument-legacy-be837f00.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+  <script nomodule crossorigin id="vite-legacy-polyfill" src="./js/polyfills-legacy-113d9ef4.js"></script>
+  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/instrument-legacy-b742a2a7.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
 </body>
 
 </html>

+ 9 - 9
dist/orchestra.html

@@ -2,7 +2,7 @@
 <html lang="en">
 
 <head>
-  <script type="module" crossorigin src="./js/polyfills-fdbee6c4.js"></script>
+  <script type="module" crossorigin src="./js/polyfills-e59429fb.js"></script>
 
   <meta charset="UTF-8" />
   <!-- <link rel="icon" type="image/svg+xml" href="/vite.svg" /> -->
@@ -41,14 +41,14 @@
       transition: opacity .3s;
     }
   </style>
-  <script type="module" crossorigin src="./js/orchestra-46fa75fd.js"></script>
-  <link rel="modulepreload" crossorigin href="./js/index-f598c6bf.js">
-  <link rel="modulepreload" crossorigin href="./js/index-68ca15d1.js">
-  <link rel="modulepreload" crossorigin href="./js/index-85e52b6c.js">
-  <link rel="modulepreload" crossorigin href="./js/index-fe7dd51e.js">
+  <script type="module" crossorigin src="./js/orchestra-f5dce318.js"></script>
+  <link rel="modulepreload" crossorigin href="./js/index-2bd63e09.js">
+  <link rel="modulepreload" crossorigin href="./js/index-2b9aef9a.js">
+  <link rel="modulepreload" crossorigin href="./js/index-2fb18736.js">
+  <link rel="modulepreload" crossorigin href="./js/index-85618896.js">
   <link rel="stylesheet" href="./css/index-8634d3f1.css">
   <link rel="stylesheet" href="./css/index-85f95688.css">
-  <link rel="stylesheet" href="./css/orchestra-8bc1a9c0.css">
+  <link rel="stylesheet" href="./css/orchestra-8e05e751.css">
   <script type="module">import.meta.url;import("_").catch(()=>1);async function* g(){};window.__vite_is_modern_browser=true;</script>
   <script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy chunks, syntax error above and the same error below should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script>
 </head>
@@ -69,8 +69,8 @@
   </script>
   
   <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
-  <script nomodule crossorigin id="vite-legacy-polyfill" src="./js/polyfills-legacy-77fa62bb.js"></script>
-  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/orchestra-legacy-08ce1a5c.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+  <script nomodule crossorigin id="vite-legacy-polyfill" src="./js/polyfills-legacy-113d9ef4.js"></script>
+  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/orchestra-legacy-74d6e963.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
 </body>
 
 </html>

+ 5 - 5
dist/report-share.html

@@ -2,7 +2,7 @@
 <html lang="en">
 
 <head>
-  <script type="module" crossorigin src="./js/polyfills-fdbee6c4.js"></script>
+  <script type="module" crossorigin src="./js/polyfills-e59429fb.js"></script>
 
   <meta charset="UTF-8" />
   <!-- <link rel="icon" type="image/svg+xml" href="/vite.svg" /> -->
@@ -25,8 +25,8 @@
       transition: opacity .3s;
     }
   </style>
-  <script type="module" crossorigin src="./js/report-share-257ab966.js"></script>
-  <link rel="modulepreload" crossorigin href="./js/index-f598c6bf.js">
+  <script type="module" crossorigin src="./js/report-share-d81bbd0f.js"></script>
+  <link rel="modulepreload" crossorigin href="./js/index-2bd63e09.js">
   <link rel="modulepreload" crossorigin href="./js/plyr.min-c8c2777b.js">
   <link rel="stylesheet" href="./css/index-8634d3f1.css">
   <link rel="stylesheet" href="./css/plyr-ad8ef5ae.css">
@@ -51,8 +51,8 @@
   </script>
   
   <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
-  <script nomodule crossorigin id="vite-legacy-polyfill" src="./js/polyfills-legacy-77fa62bb.js"></script>
-  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/report-share-legacy-6d5b3142.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+  <script nomodule crossorigin id="vite-legacy-polyfill" src="./js/polyfills-legacy-113d9ef4.js"></script>
+  <script nomodule crossorigin id="vite-legacy-entry" data-src="./js/report-share-legacy-34de73fa.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
 </body>
 
 </html>

+ 9 - 9
src/page-instrument/view-detail/smoothAnimation/index.ts

@@ -148,7 +148,7 @@ const moveState = {
    progress: 0,
    activeIndex: 0
 }
-export function moveSmoothAnimation(progress: number, activeIndex: number) {
+export function moveSmoothAnimation(progress: number, activeIndex: number, isMoveOsmd = true) {
    moveState.progress = progress
    moveState.activeIndex = activeIndex
    // if (!smoothAnimationState.isShow.value) {
@@ -176,14 +176,14 @@ export function moveSmoothAnimation(progress: number, activeIndex: number) {
       smoothAnimationState.pointsPos,
       smoothAnimationState.pointsPos.slice(0, nowIndex)
    )
-   // 当移动到屏幕最右边时候 就不进行移动了
-   if (
-      (smoothAnimationState.osdmScrollDom?.scrollLeft || 0) + smoothAnimationState.translateXNum + smoothAnimationState.osdmScrollDomWith >=
-      smoothAnimationState.canvasDomWith
-   ) {
-      return
-   }
-   move_osmd(nowPointsPos)
+   // 当移动到屏幕最右边时候 就不进行移动了    存在移动到屏幕最右边时候  有反复的情况需要屏幕移动。所以这里注释掉了
+   // if (
+   //    (smoothAnimationState.osdmScrollDom?.scrollLeft || 0) + smoothAnimationState.translateXNum + smoothAnimationState.osdmScrollDomWith >=
+   //    smoothAnimationState.canvasDomWith
+   // ) {
+   //    return
+   // }
+   isMoveOsmd && move_osmd(nowPointsPos)
 }
 
 /**

+ 13 - 6
src/state.ts

@@ -1590,7 +1590,6 @@ export const addNoteBBox = (list: any[]) => {
     //  todo  连续修止小节bug
     note.bbox = bbox;
   }
-
 }
 
 // 给歌词和音符添加动态颜色
@@ -1629,10 +1628,15 @@ export const moveSvgDom = (skipNote?: boolean) => {
    * 当前选中的音符和第一个音符之间的间距
    */
   if (skipNote) {
-    const distance = state.times[state.activeNoteIndex].bbox?.x - state.times[0].bbox?.x + state.times[state.activeNoteIndex].bbox?.width / 2 - state.times[0].bbox?.width / 2;
     // 点击 清空translateXNum
     smoothAnimationState.translateXNum = 0
-    moveSmoothAnimation(0, state.activeNoteIndex)
+    moveTranslateXNum(0)
+    // 移动小鸟的位置
+    moveSmoothAnimation(0, state.activeNoteIndex, false)
+    // 移动谱面当当前音符的位置
+    const noteWidth = state.times[state.activeNoteIndex].bbox?.originWidth || state.times[state.activeNoteIndex].bbox?.width;
+    const firstNoteWidth = state.times[0].bbox?.originWidth || state.times[0].bbox?.width;
+    const distance = state.times[state.activeNoteIndex].bbox?.x - state.times[0].bbox?.x + noteWidth / 2 - firstNoteWidth / 2;
     smoothAnimationState.osdmScrollDom!.scrollTo({
       left: distance,
       behavior: "smooth",
@@ -1649,9 +1653,12 @@ watch(
       // 当在播放中暂停 执行这个方法
       if (!state.playEnd && state.playState === "paused") {
         moveTranslateXNum(0)
-        const scrollLeft = smoothAnimationState.osdmScrollDom!.scrollLeft
-        smoothAnimationState.osdmScrollDom!.scrollLeft = scrollLeft + smoothAnimationState.translateXNum
-        smoothAnimationState.translateXNum = 0
+        // 因为safari浏览器scrollWidth的值一直变化,scrollLeft + smoothAnimationState.translateXNum 为最大宽度的时候,实际上scrollLeft滚不到最大宽度,所以在下一帧处理滚动,能滚动到最大滚动位置
+        requestAnimationFrame(() => {
+          const scrollLeft = smoothAnimationState.osdmScrollDom!.scrollLeft
+          smoothAnimationState.osdmScrollDom!.scrollLeft = scrollLeft + smoothAnimationState.translateXNum
+          smoothAnimationState.translateXNum = 0
+        });
       }
     }
   }

+ 9 - 0
src/view/selection/index.tsx

@@ -59,6 +59,9 @@ const calcNoteData = () => {
 							top: noteBbox.y - parentTop - noteBbox.height + "px",
 							width: noteBbox.width * 1.5 + "px",
 							height: noteBbox.height * 3 + "px",
+							x: item.bbox?.x,
+							y: item.bbox?.y,
+							originWidth: item.bbox?.width
 						};
 						const noteHead = noteEle.querySelector(".vf-numbered-note-head");
 						const noteHeadBbox = noteHead?.getBoundingClientRect?.();
@@ -66,6 +69,9 @@ const calcNoteData = () => {
 							item.bbox = {
 								left: noteHeadBbox.x - parentLeft - noteHeadBbox.width / 4,
 								width: noteHeadBbox.width * 1.5,
+								x: item.bbox?.x,
+								y: item.bbox?.y,
+								originWidth: item.bbox?.width
 							}
 						}
 						
@@ -75,6 +81,9 @@ const calcNoteData = () => {
 							top: staveBbox.y - parentTop + "px",
 							width: noteBbox.width * 1.5 + "px",
 							height: staveBbox.height + "px",
+							x: item.bbox?.x,
+							y: item.bbox?.y,
+							originWidth: item.bbox?.width
 						};
 					}
 					

File diff suppressed because it is too large
+ 0 - 0
stats.html


Some files were not shown because too many files changed in this diff