this post was submitted on 23 Oct 2023
4 points (83.3% liked)

Web Development

0 readers
1 users here now

Icon base by Delapouite under CC BY 3.0 with modifications to add a gradient

founded 1 year ago
MODERATORS
 

Hello,

I'm able to make texts fade in and out sequentially, like the following :

F
Fi
Fir
Firs
First
 irst
  rst
   st
    t
S
Se
Sec
Seco
Secon
Second
 econd
  cond
   ond
    nd
     d
T
Th
Thi
Thir
Third

Demo : https://jsfiddle.net/KaKi87/t3jm8yhx/2/

But I'd like to to make these fade in and out simultaneously, like the following :

F
Fi
Fir
Firs
First
S rst
Se st
Sec t
Seco
Secon
Second
T cond
Th ond
Thi nd
Thir d
Third

How to do that ?

Thanks !

you are viewing a single comment's thread
view the rest of the comments
[โ€“] hassanmckusick@lemmy.discothe.quest 1 points 1 year ago (1 children)

Your awaits are random and not synced to your animations. On line 5 you start a 500ms animation but you tell the await to pause for 2000ms. Try 500ms or even 300ms with the current easing.

[โ€“] KaKi87@sh.itjust.works 1 points 1 year ago* (last edited 1 year ago)

I set such delays so that I have time to watch things happening in devtools, that's all.

However, reducing delays still doesn't allow the next text to appear simultaneously with the previous text disappearing.

The solution is figuring out how to overlay the texts without requiring a background color.