Skip to content

juliocesarlab/js-write-machine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

js-write-machine

Javascript class to simulate a write machine effect

functionalities preview

Get started

you can copy and paste code or install it from npm (recommended)

Using npm

  npm i js-write-machine 

Using yarn

  yarn add js-write-machine

Vanilla JS

  <!--after paste the content, turn your main script a module (so you can use import/export statements) -->
  <script **type="module"** src="your-script-path.js"> </script>

  <!-- Inside your main script -->
  <script>
    import WriteMachine from "./writeMachine.js";

    const phrasesArray = ["I love to Code", "Hello World", "Welcome !"];
    const htmlElement = document.querySelector('.myElement');
    const typeSpeed = 100;

    new WriteMachine(phrasesArray, htmlElement, typeSpeed).alternatePhrases()
  </script>

Examples

 import WriteMachine from "writeMachine"

const phrases = ["I love to Code", "Hello World", "Welcome !"];
const htmlElement = document.querySelector('.myElement');
const typeSpeed = 200;

new TypeMachine(phrasesArray, htmlElement, typeSpeed).alternatePhrases()

Releases

No releases published

Packages

No packages published