瀏覽代碼

feat: 一行谱修改

TIANYONG 1 年之前
父節點
當前提交
223566f5a9

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

@@ -62,7 +62,7 @@
             transform: translateX(11Px);
         }
         #cursor-copy {
-            transform: translate(11Px,-23%);
+            transform: translate(11Px, -23%);
         }
     }
 

+ 2 - 1
src/state.ts

@@ -1225,7 +1225,8 @@ export const moveSvgDom = (offset: number) => {
   const cursorLeft = state.cursorDom?.getBoundingClientRect()?.left || 0;
   const leftValue = parseFloat(state.cursorDom.style.left) - 47 - 20
   // console.log(cursorLeft,leftValue,'光标位置')
-  
+  // state.osmdSvgDom.style.transform = `translateX(${-leftValue}px)`;
+  // state.osdmScrollDom.scrollLeft = leftValue
   state.osdmScrollDom.scrollTo({
     left: leftValue,
     behavior: "smooth",

+ 2 - 1
src/view/music-score/index.module.less

@@ -7,6 +7,7 @@
         height: 100%;
         max-height: 100vh;
         transform: translateY(-5%);
+        transition: all 0.5s;
         &::-webkit-scrollbar {
             width: 0;
             display: none;
@@ -32,7 +33,7 @@
 .inGradualRange{
    :global{
         #cursorImg-0{
-            opacity: 0 !important;
+            // opacity: 0 !important;
         }
    } 
 }

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

@@ -92,8 +92,8 @@ export default defineComponent({
 		// 一行谱模式,创建固定的光标
 		const createFixedCursor = () => {
 			if (!state.isSingleLine) return;
-			// const svg: any = document.getElementById("osmdSvgPage1");
-			// state.osmdSvgDom = svg;
+			const svg: any = document.getElementById("osmdSvgPage1");
+			state.osmdSvgDom = svg;
 			const scrollDom = document.getElementById("musicAndSelection");
 			const cursorDom = document.getElementById("cursorImg-0");
 			state.fistNoteLeft = cursorDom?.getBoundingClientRect()?.left || 0;
@@ -130,7 +130,7 @@ export default defineComponent({
 				
 			});
 			// osmd.EngravingRules.CompactMode = true // 紧凑模式
-			osmd.EngravingRules.PageRightMargin = state.isSingleLine ? (window.innerWidth+100)/10 : 2;
+			osmd.EngravingRules.PageRightMargin = state.isSingleLine ? (window.innerWidth+200)/10 : 2;
 			osmd.EngravingRules.PageTopMargin = 10;
 			osmd.EngravingRules.PageTopMarginNarrow = 3;
 			osmd.EngravingRules.PageLeftMargin = 2;

+ 2 - 2
vite.config.ts

@@ -76,9 +76,9 @@ export default defineConfig({
 				// target: "https://kt.colexiu.com",
 				// target: "https://test.lexiaoya.cn",
 				// target: "https://dev.kt.colexiu.com",
-				// target: "https://test.resource.colexiu.com", // 内容平台开发环境,内容平台开发,需在url链接上加上isCbs=true
+				target: "https://test.resource.colexiu.com", // 内容平台开发环境,内容平台开发,需在url链接上加上isCbs=true
 				// target: "https://dev.resource.colexiu.com",
-				target: "https://test.kt.colexiu.com", // 课堂乐器测试环境
+				// target: "https://test.kt.colexiu.com", // 课堂乐器测试环境
 				// target: "https://mec.colexiu.com",
 				changeOrigin: true,
 				rewrite: (path) => path.replace(/^\/instrument/, ""),