From 5b172414ecc2670e2376ae53b8917ed160dc45e2 Mon Sep 17 00:00:00 2001 From: Spedon Date: Fri, 24 Mar 2023 16:53:31 +0800 Subject: [PATCH] now the overlay delay time will change with the stack depth --- assets/ts/desktop.ts | 2 +- assets/ts/overlay.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/assets/ts/desktop.ts b/assets/ts/desktop.ts index cbfc030..2bbbf90 100644 --- a/assets/ts/desktop.ts +++ b/assets/ts/desktop.ts @@ -124,7 +124,7 @@ async function enterOverlay(): Promise { e.style.transitionDelay = `${0.1 * i}s` } } - await delay(1600) + await delay(stackDepth * 100 + 100 + 1000) // Offset previous self increment of global index (by handleOnMove) globalIndexDec() // overlay init diff --git a/assets/ts/overlay.ts b/assets/ts/overlay.ts index 81f86ef..7beaaa2 100644 --- a/assets/ts/overlay.ts +++ b/assets/ts/overlay.ts @@ -8,7 +8,8 @@ import { transformCache, pushIndex, emptyTransformCache, - emptyTrailingImageIndexes + emptyTrailingImageIndexes, + stackDepth } from './desktop' import { imagesArrayLen } from './dataFetch' import { imgIndexSpanUpdate } from './indexDisp' @@ -63,7 +64,7 @@ async function handleCloseClick(): Promise { e.style.zIndex = `${indexesNum - i - 1}` e.dataset.status = i === 0 ? 'resumeTop' : 'resume' } - await delay(1700) + await delay(1200 + stackDepth * 100 + 100) for (let i: number = 0; i < indexesNum; i++) { images[calcImageIndex(globalIndex - i, imagesArrayLen)].dataset.status = 'null' }