From c7679545350337f34db66fd72e4648b07a5ef9cb Mon Sep 17 00:00:00 2001 From: wasrusgen Date: Tue, 12 May 2026 18:57:40 +0300 Subject: [PATCH] splash: move out of #app + guarantee 700ms min visibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Splash was nested inside
— render functions wipe app.innerHTML before hideSplash() runs, so the splash never showed. Moved it to a sibling of #app and made hideSplash() wait for at least 700ms of total time elapsed since page load before fade-out. Cache bust v=20260513d. --- miniapp/assets/app.js | 8 +++++-- miniapp/index.html | 52 +++++++++++++++++++++---------------------- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/miniapp/assets/app.js b/miniapp/assets/app.js index 962619b..31f0c6a 100644 --- a/miniapp/assets/app.js +++ b/miniapp/assets/app.js @@ -354,14 +354,18 @@ function renderError() { } /* ----------------- Init ----------------- */ +// Засекаем когда стартовали — чтобы splash висел минимум ~700мс +const _splashStart = Date.now(); function hideSplash() { const splash = document.getElementById("splash"); if (!splash) return; - // Минимум 350мс показа, чтобы не было «вспышки» + const elapsed = Date.now() - _splashStart; + const minShow = 700; // минимум показа, мс + const wait = Math.max(0, minShow - elapsed); setTimeout(() => { splash.classList.add("hide"); setTimeout(() => splash.remove(), 450); - }, 200); + }, wait); } async function init() { diff --git a/miniapp/index.html b/miniapp/index.html index b0d6a8b..2a41e6e 100644 --- a/miniapp/index.html +++ b/miniapp/index.html @@ -12,34 +12,34 @@ - - + + -
-
- -
-
-
Открываем кабинет
-
ZOV · кухня и техника
-
+ +
+ +
+
+
Открываем кабинет
+
ZOV · кухня и техника
-
- - - - - - - + +
+ + + + + + +