# blockenberg/2.0.7/blocks/typing-effect/frontend.js

Blockenberg — 600+ Advanced Gutenberg Blocks &amp; AI Agent for WordPress Block Editor, version 2.0.7. 57 lines.

- Page: https://pluginprobe.com/plugins/blockenberg/2.0.7/code/blocks/typing-effect/frontend.js
- Raw: https://pluginprobe.com/plugins/blockenberg/2.0.7/raw/blocks/typing-effect/frontend.js
- Modified: 2026-03-06T12:32:40+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/blockenberg/2.0.7/code/blocks/typing-effect/frontend.js#L10-L20`.

```javascript
( function () {
  function initTyping(wrap) {
    var typed       = wrap.querySelector('.bkte-typed');
    var cursor      = wrap.querySelector('.bkte-cursor');
    if (!typed) return;

    var phrasesRaw  = wrap.dataset.phrases || '';
    var typeSpeed   = parseInt(wrap.dataset.typeSpeed, 10) || 80;
    var deleteSpeed = parseInt(wrap.dataset.deleteSpeed, 10) || 40;
    var pause       = parseInt(wrap.dataset.pause, 10) || 1800;
    var loop        = wrap.dataset.loop !== '0';
    var cursorBlink = wrap.dataset.cursorBlink !== '0';

    if (cursorBlink && cursor) cursor.style.animation = 'bkteCursorBlink 0.75s step-end infinite';

    var phrases = phrasesRaw.split(',').map(function(s){ return s.trim(); }).filter(Boolean);
    if (!phrases.length) return;

    var idx = 0;
    var charIdx = 0;
    var deleting = false;

    function tick() {
      var current = phrases[idx];
      if (!deleting) {
        charIdx++;
        typed.textContent = current.slice(0, charIdx);
        if (charIdx >= current.length) {
          deleting = true;
          setTimeout(tick, pause);
          return;
        }
        setTimeout(tick, typeSpeed);
      } else {
        charIdx--;
        typed.textContent = current.slice(0, charIdx);
        if (charIdx === 0) {
          deleting = false;
          idx++;
          if (idx >= phrases.length) {
            if (!loop) return;
            idx = 0;
          }
        }
        setTimeout(tick, deleting ? deleteSpeed : typeSpeed + 20);
      }
    }

    // Start typing after a short delay
    setTimeout(tick, 600);
  }

  document.addEventListener('DOMContentLoaded', function () {
    document.querySelectorAll('.bkte-wrap[data-phrases]').forEach(initTyping);
  });
}() );

```
