瀏覽代碼

Merge branch 'feature-tianyong-newVersion' into ktyq-test-new

TIANYONG 8 月之前
父節點
當前提交
5915845256

+ 6 - 0
src/page-instrument/view-detail/index.module.less

@@ -234,6 +234,12 @@
                 stroke: #000000;
             }
         }
+        .lyricActive {
+            text {
+                fill: #000000;
+                stroke: #000000;
+            }
+        }
     }
 }
 

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

@@ -22,6 +22,7 @@ type smoothAnimationType = {
    osdmScrollDomWith: number
    osdmScrollDomOffsetLeft: number
    selectionBoxDom: null | HTMLElement
+   selectionBgBoxDom: null | HTMLElement
    batePos: pointsPosType
    pointsPos: pointsPosType
    translateXNum: number
@@ -45,6 +46,7 @@ export const smoothAnimationState = {
    osdmScrollDomWith: 0,
    osdmScrollDomOffsetLeft: 0,
    selectionBoxDom: null,
+   selectionBgBoxDom: null,
    batePos: [], // times 直接转换的数组
    pointsPos: [], // 筛选之后的点坐标数组
    translateXNum: 0, // 当前谱面的translateX的距离   谱面的位置信息 由translateX和scrollLeft的偏移一起决定
@@ -145,6 +147,7 @@ export function destroySmoothAnimation() {
       osdmScrollDomWith: 0,
       osdmScrollDomOffsetLeft: 0,
       selectionBoxDom: null,
+      selectionBgBoxDom: null,
       batePos: [],
       pointsPos: [],
       translateXNum: 0,
@@ -285,6 +288,7 @@ function move_osmd(nowPointsPos: pointsPosType[0]) {
 export function moveTranslateXNum(translateXNum: number) {
    smoothAnimationState.osmdCanvasPageDom && (smoothAnimationState.osmdCanvasPageDom.style.transform = `translateX(-${translateXNum}px)`)
    smoothAnimationState.selectionBoxDom && (smoothAnimationState.selectionBoxDom.style.transform = `translateX(-${translateXNum}px)`)
+   smoothAnimationState.selectionBgBoxDom && (smoothAnimationState.selectionBgBoxDom.style.transform = `translateX(-${translateXNum}px)`)
 }
 
 /**
@@ -308,7 +312,9 @@ function createSmoothAnimation() {
    // selectionBox
    setTimeout(() => {
       const selectionBoxDom = document.querySelector("#selectionBox") as HTMLElement
+      const selectionBgBoxDom = document.querySelector("#selectionBgBox") as HTMLElement
       smoothAnimationState.selectionBoxDom = selectionBoxDom
+      smoothAnimationState.selectionBgBoxDom = selectionBgBoxDom
    }, 0)
    // box
    const smoothAnimationBoxDom = document.createElement("div")

+ 3 - 2
src/page-instrument/view-evaluat-report/component/share-top/index.module.less

@@ -332,8 +332,9 @@
         }
     }
     &.padPlayerBox{
-        width: 418px;
-        height: 248px;
+        width: 428px;
+        height: 252px;
+        padding: 12px;
         .audioBox{
             .audioBga1{
                 width: 112px;

+ 14 - 6
src/page-instrument/view-evaluat-report/component/share-top/index.tsx

@@ -119,7 +119,9 @@ export default defineComponent({
 			type propsType = { canvWidth: number; canvHeight: number; canvFillColor: string; lineColor: string; lineGap: number }
 			// canvas
 			const canvasCtx = canvasDom.getContext("2d")!
-			const { width, height } = canvasDom.getBoundingClientRect()
+      let { width, height } = canvasDom.getBoundingClientRect()
+      width = Math.ceil(width)
+      height = Math.ceil(height)
 			canvasDom.width = width
 			canvasDom.height = height
 			// audio
@@ -191,8 +193,8 @@ export default defineComponent({
             return
           }
           //analyser?.getByteFrequencyData(dataArray)
-          draw(generateMixedData(38), canvasCtx, {
-            lineGap: 3,
+          draw(generateMixedData(48), canvasCtx, {
+            lineGap: 2,
             canvWidth: width,
             canvHeight: height,
             canvFillColor: "transparent",
@@ -228,19 +230,25 @@ export default defineComponent({
 				pauseVisualDraw
 			}
 		}
-    function generateMixedData(size:number) {
+    function generateMixedData(size: number) {
       const dataArray = new Uint8Array(size);
       const baseNoiseAmplitude = 30;
       const minFrequency = 0.01;
       const maxFrequency = 0.2;
       const minAmplitude = 50;
       const maxAmplitude = 150;
+      let lastAmplitude = maxAmplitude;  // 初始振幅设置为最大值
+      let lastFrequency = minFrequency + Math.random() * (maxFrequency - minFrequency);
+    
       for (let i = 0; i < size; i++) {
-          const frequency = minFrequency + Math.random() * (maxFrequency - minFrequency);
-          const amplitude = minAmplitude + Math.random() * (maxAmplitude - minAmplitude);
+          const decayFactor = 1 - (i / size);  // 使振幅随时间递减
+          const amplitude = lastAmplitude * decayFactor + (Math.random() - 0.5) * 10;
+          const frequency = lastFrequency + (Math.random() - 0.5) * 0.01;
           const wave = amplitude * (0.5 + 0.5 * Math.sin(frequency * i));
           const noise = Math.floor(Math.random() * baseNoiseAmplitude) - baseNoiseAmplitude / 2;
           dataArray[i] = Math.min(255, Math.max(0, Math.floor(wave + noise)));
+          lastAmplitude += (amplitude - lastAmplitude) * 0.05;
+          lastFrequency += (frequency - lastFrequency) * 0.05;
       }
       return dataArray;
     }

+ 1 - 1
src/view/music-score/index.tsx

@@ -159,7 +159,7 @@ export default defineComponent({
 			// 需要渲染总谱的云教练页面
 			if (!state.isSimplePage && state.isCombineRender) {
 				for (let i = 0; i < osmd.Sheet.Instruments.length; i++) {
-					const trackName = osmd.Sheet.Instruments[i].Name || '';
+					const trackName = state.isEvxml ? osmd.Sheet.Instruments[i].idString || '' : osmd.Sheet.Instruments[i].Name || '';
 					osmd.Sheet.Instruments[i].Visible = state.canSelectTracks.includes(trackName)
 				  }
 			}

+ 1 - 1
src/view/selection/index.tsx

@@ -257,7 +257,7 @@ export default defineComponent({
 		});
 		return () => (
 			<>
-				<div class={styles.staveBgContainer}>
+				<div id="selectionBgBox" class={styles.staveBgContainer}>
 						{
 							selectData.staves.map((item: any) => {
 								return (