MediaWiki:Common.js: Difference between revisions

From HyruleGamingGroup Wiki
Jump to navigation Jump to search
(Created page with "→‎Any JavaScript here will be loaded for all users on every page load.: function updateText(text){ let delay = 200; let h1 = document.getElementById("admin-quality-animated"); h1.innerHTML = text .split("") .map(letter => { console.log(letter); return `<span>` + letter + `</span>`; }) .join(""); Array.from(h1.children).forEach((span, index) => { setTimeout(() => { span.classList.ad...")
 
No edit summary
Line 5: Line 5:
let delay = 200;
let delay = 200;


let h1 = document.getElementById("admin-quality-animated");
let span = document.getElementById("admin-quality-animated");


       h1.innerHTML = text
       h1.innerHTML = text

Revision as of 14:25, 23 November 2023

/* Any JavaScript here will be loaded for all users on every page load. */

function updateText(text){

let delay = 200;

	let span = document.getElementById("admin-quality-animated");

      h1.innerHTML = text
        .split("")
        .map(letter => {
          console.log(letter);
          return `<span>` + letter + `</span>`;
        })
        .join("");

      Array.from(h1.children).forEach((span, index) => {
        setTimeout(() => {
          span.classList.add("admin-quality-wavy");
        }, index * 60 + delay);
      });

}