(flag)
| 512 | }; |
| 513 | |
| 514 | const 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 | } |
no test coverage detected