diff --git a/src/App.vue b/src/App.vue index d700170..7b01dca 100644 --- a/src/App.vue +++ b/src/App.vue @@ -63,11 +63,12 @@ onMounted(() => { position: fixed; background-color: #000b; backdrop-filter: blur(5px); + z-index: 1; } #ui-list { - width: 90%; - height: 90%; + width: 90vw; + height: 90vh; overflow: hidden; position: relative; left: 0; @@ -75,8 +76,8 @@ onMounted(() => { } .ui-one { - width: 100%; - height: 100%; + width: 90vw; + height: 90vh; position: absolute; left: 0; top: 0; @@ -92,6 +93,7 @@ onMounted(() => { left: 0; top: 0; display: none; + z-index: 0; } @media screen and (max-width: 600px) { diff --git a/src/components/scroll.vue b/src/components/scroll.vue index 206d69c..10fbfb7 100644 --- a/src/components/scroll.vue +++ b/src/components/scroll.vue @@ -46,7 +46,7 @@ let content: HTMLDivElement; let fromSelf = false; const resize = async () => { - await calHeight(); + await calHeight(false); draw(); }; @@ -87,8 +87,10 @@ function draw() { /** * 计算元素总长度 */ -async function calHeight() { - await sleep(20); +async function calHeight(first: boolean) { + if (!first) { + await sleep(20); + } const canvas = ctx.canvas; const style2 = getComputedStyle(canvas); canvas.style.width = `${width}px`; @@ -123,7 +125,7 @@ onUpdated(async () => { if (fromSelf) return; now = props.now ?? now; content.style.transition = `${cssTarget} 0.2s ease-out`; - await calHeight(); + await calHeight(false); scroll(); }); @@ -204,7 +206,7 @@ onMounted(async () => { }); window.addEventListener('resize', resize); - await calHeight(); + await calHeight(true); draw(); }); diff --git a/src/core/main/custom/ui.ts b/src/core/main/custom/ui.ts index 107697a..1b0dfd4 100644 --- a/src/core/main/custom/ui.ts +++ b/src/core/main/custom/ui.ts @@ -179,8 +179,6 @@ export class UiController extends Focus { v.ui.emit('close'); }); if (this.stack.length === 0) { - console.log(this.hold); - if (!this.hold) this.emit('end'); this.hold = false; } diff --git a/src/core/main/init/ui.ts b/src/core/main/init/ui.ts index 1deca61..a4464b9 100644 --- a/src/core/main/init/ui.ts +++ b/src/core/main/init/ui.ts @@ -56,7 +56,9 @@ hook.once('mounted', () => { }); mainUi.on('end', () => { ui.style.display = 'none'; - core.closePanel(); + try { + core.closePanel(); + } catch {} }); fixedUi.on('start', () => { fixed.style.display = 'block'; diff --git a/src/plugin/chase/chase.ts b/src/plugin/chase/chase.ts index eb9d887..f9b61e3 100644 --- a/src/plugin/chase/chase.ts +++ b/src/plugin/chase/chase.ts @@ -4,6 +4,8 @@ import { has } from '../utils'; import { ChaseCameraData, ChasePath, getChaseDataByIndex } from './data'; import { init1 } from './chase1'; +// todo: 优化,可以继承自EventEmitter + export default function init() { return { startChase, chaseInit1: init1 }; }