From 2cd69f7d986e62d396127b2d9c86f39bab2e2daf Mon Sep 17 00:00:00 2001 From: morethanwords Date: Tue, 19 Jan 2021 21:49:01 +0400 Subject: [PATCH] Input label animation fix --- src/components/chat/bubbles.ts | 24 +++-- src/index.hbs | 35 +------- src/lib/mtproto/authorizer.ts | 71 +++++++++++---- src/lib/mtproto/mtproto.worker.ts | 20 +++-- src/pages/pageAuthCode.ts | 15 +++- src/pages/pagePassword.ts | 26 +++++- src/pages/pageSignIn.ts | 143 ++++++++++++++++++++---------- src/scss/partials/_input.scss | 24 +++-- 8 files changed, 224 insertions(+), 134 deletions(-) diff --git a/src/components/chat/bubbles.ts b/src/components/chat/bubbles.ts index 83b606cd..7c9f4e89 100644 --- a/src/components/chat/bubbles.ts +++ b/src/components/chat/bubbles.ts @@ -24,7 +24,7 @@ import animationIntersector from "../animationIntersector"; import { months } from "../../helpers/date"; import RichTextProcessor from "../../lib/richtextprocessor"; import mediaSizes from "../../helpers/mediaSizes"; -import { isAndroid, isApple, isSafari } from "../../helpers/userAgent"; +import { isAndroid, isApple, isSafari, isAppleMobile } from "../../helpers/userAgent"; import { langPack } from "../../lib/langPack"; import AvatarElement from "../avatar"; import { formatPhoneNumber } from "../misc"; @@ -2428,9 +2428,11 @@ export default class ChatBubbles { //this.scrollable.scrollTop = this.scrollable.scrollHeight; isTouchSupported && isApple && (this.scrollable.container.style.overflow = ''); - this.scrollable.container.style.display = 'none'; - void this.scrollable.container.offsetLeft; // reflow - this.scrollable.container.style.display = ''; + if(isSafari && !isAppleMobile) { // * fix blinking and jumping + this.scrollable.container.style.display = 'none'; + void this.scrollable.container.offsetLeft; // reflow + this.scrollable.container.style.display = ''; + } /* if(DEBUG) { this.log('performHistoryResult: have set up scrollTop:', newScrollTop, this.scrollable.scrollTop, this.isHeavyAnimationInProgress); @@ -2707,14 +2709,18 @@ export default class ChatBubbles { const promises = [topRes.animationPromise, middleRes.animationPromise, bottomRes.animationPromise]; const delays: number[] = [topRes.lastMsDelay, middleRes.lastMsDelay, bottomRes.lastMsDelay]; + let promise: Promise; if(topIds.length || middleIds.length || bottomIds.length) { - dispatchHeavyAnimationEvent(Promise.all(promises), Math.max(...delays) + 200); // * 200 - transition time + promise = Promise.all(promises); + dispatchHeavyAnimationEvent(promise, Math.max(...delays) + 200); // * 200 - transition time } - } - setTimeout(() => { - this.loadMoreHistory(true, true); - }, 0); + (promise || Promise.resolve()).then(() => { + setTimeout(() => { // preload messages + this.loadMoreHistory(reverse, true); + }, 0); + }); + } }); } diff --git a/src/index.hbs b/src/index.hbs index dc2f0b51..0f4dd5ab 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -39,25 +39,6 @@

Sign in to Telegram

Please confirm your country and
enter your phone number.

-
- {{!--
--}} -
- - - -
-
- - -
- - - {{!--
--}} - -
@@ -78,12 +59,7 @@

-
-
- - -
-
+
@@ -91,14 +67,7 @@

Enter Your Password

Your account is protected with
an additional password

-
-
- - - -
- -
+