PageSourceSearch

https://www.emiia.ai/typing-effect.js

js emiia.ai collected 2026-09-25 22:06:20 UTC 958 bytes, 38 lines download raw bytes

1let wrapper;
2const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
3
4async function writingAll(stringTarget, container) {
5  wrapper = document.querySelector('[' + container + ']');
6  const stringsContainer = document.getElementsByClassName(stringTarget);
7
8  while (wrapper) {
9    for (i = 0; i < stringsContainer.length; i++) {
10      const string = stringsContainer[i].textContent;
11      await write(string);
12      await sleep(1000);
13      await erase();
14      await sleep(1000);
15    };
16  }
17};
18
19async function write(text) {
20  let index = 0;
21  while (index < text.length) {
22    const timeout = 100;
23    await sleep(timeout);
24    index++;
25    wrapper.innerHTML = text.substring(0, index);
26  }
27};
28
29
30async function erase() {
31  while (wrapper.textContent.length) {
32    const timeout = 100;
33    await sleep(timeout);
34    wrapper.textContent = wrapper.textContent.substring(0, wrapper.textContent.length - 2);
35  }
36};
37
38writingAll('item', 'data-text');

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.