MCPcopy
hub / github.com/mattboldt/typed.js / initFadeOut

Method initFadeOut

src/typed.js:421–436  ·  view source on GitHub ↗

* Adds a CSS class to fade out current string * @private

()

Source from the content-addressed store, hash-verified

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

Callers 1

backspaceMethod · 0.95

Calls 2

replaceTextMethod · 0.95
typewriteMethod · 0.95

Tested by

no test coverage detected