MCPcopy Create free account
hub / github.com/TechSpiritSS/Terminal-Portfolio / typingCmd

Function typingCmd

scripts/functions.js:514–533  ·  view source on GitHub ↗
(flag)

Source from the content-addressed store, hash-verified

512};
513
514const typingCmd = async (flag) => {
515 const typing = localStorage.getItem("typing");
516 let typingSpeed = localStorage.getItem("typingSpeed");
517
518 if (flag == "-on") {
519 localStorage.setItem("typing", "on");
520 createText("Typing animation is turned on");
521 } else if (flag == "-off") {
522 localStorage.setItem("typing", "off");
523 createText("Typing animation is turned off");
524 } else if (Number(flag)) {
525 localStorage.setItem("typingSpeed", Number(flag));
526 typingSpeed = localStorage.getItem("typingSpeed");
527 await createText(`Typing animation speed is set to ${typingSpeed ? typingSpeed : 20}ms`);
528 } else {
529 await createText(`Typing animation is currently ${typing ? typing : "on"} and speed is set to ${typingSpeed ? typingSpeed : 20}ms`);
530 await createText("Turn typing animation on and off by adding -on or -off flags respectively");
531 await createText("Also u can write a number(in ms) to set typing custom animation speed");
532 }
533}

Callers 1

getInputValueFunction · 0.85

Calls 1

createTextFunction · 0.85

Tested by

no test coverage detected