Make texts fade in and out simultaneously ?

Hello,

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


<span style="color:#323232;">F
</span><span style="color:#323232;">Fi
</span><span style="color:#323232;">Fir
</span><span style="color:#323232;">Firs
</span><span style="color:#323232;">First
</span><span style="color:#323232;"> irst
</span><span style="color:#323232;">  rst
</span><span style="color:#323232;">   st
</span><span style="color:#323232;">    t
</span><span style="color:#323232;">S
</span><span style="color:#323232;">Se
</span><span style="color:#323232;">Sec
</span><span style="color:#323232;">Seco
</span><span style="color:#323232;">Secon
</span><span style="color:#323232;">Second
</span><span style="color:#323232;"> econd
</span><span style="color:#323232;">  cond
</span><span style="color:#323232;">   ond
</span><span style="color:#323232;">    nd
</span><span style="color:#323232;">     d
</span><span style="color:#323232;">T
</span><span style="color:#323232;">Th
</span><span style="color:#323232;">Thi
</span><span style="color:#323232;">Thir
</span><span style="color:#323232;">Third
</span>

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

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


<span style="color:#323232;">F
</span><span style="color:#323232;">Fi
</span><span style="color:#323232;">Fir
</span><span style="color:#323232;">Firs
</span><span style="color:#323232;">First
</span><span style="color:#323232;">S rst
</span><span style="color:#323232;">Se st
</span><span style="color:#323232;">Sec t
</span><span style="color:#323232;">Seco
</span><span style="color:#323232;">Secon
</span><span style="color:#323232;">Second
</span><span style="color:#323232;">T cond
</span><span style="color:#323232;">Th ond
</span><span style="color:#323232;">Thi nd
</span><span style="color:#323232;">Thir d
</span><span style="color:#323232;">Third
</span>

How to do that ?

Thanks !

silas,
@silas@programming.dev avatar

Have you thought of splitting up the string into single letters and animating one letter at a time? The animation would be slightly different than the wipe animation you have going right now, but you wouldn’t have to worry about backgrounds anymore

hassanmckusick,

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,
@KaKi87@sh.itjust.works avatar

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.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • aaaaaaacccccccce
  • [email protected]
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • Socialism
  • KbinCafe
  • TheResearchGuardian
  • oklahoma
  • feritale
  • SuperSentai
  • KamenRider
  • All magazines