* Adds a CSS class to fade out current string * @private
()
| 419 | * @private |
| 420 | */ |
| 421 | initFadeOut() { |
| 422 | this.el.className += ` ${this.fadeOutClass}`; |
| 423 | if (this.cursor) this.cursor.className += ` ${this.fadeOutClass}`; |
| 424 | return setTimeout(() => { |
| 425 | this.arrayPos++; |
| 426 | this.replaceText(''); |
| 427 | |
| 428 | // Resets current string if end of loop reached |
| 429 | if (this.strings.length > this.arrayPos) { |
| 430 | this.typewrite(this.strings[this.sequence[this.arrayPos]], 0); |
| 431 | } else { |
| 432 | this.typewrite(this.strings[0], 0); |
| 433 | this.arrayPos = 0; |
| 434 | } |
| 435 | }, this.fadeOutDelay); |
| 436 | } |
| 437 | |
| 438 | /** |
| 439 | * Replaces current text in the HTML element |
no test coverage detected