Skip to content

Commit

Permalink
update docs, delete unused file
Browse files Browse the repository at this point in the history
  • Loading branch information
mattboldt committed Mar 11, 2023
1 parent 4da11fd commit 3d2dd9c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 476 deletions.
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[![Build Status](https://travis-ci.org/mattboldt/typed.js.svg?branch=typed-2.0)](https://travis-ci.org/mattboldt/typed.js)
[![Code Climate](https://codeclimate.com/github/mattboldt/typed.js/badges/gpa.svg)](https://codeclimate.com/github/mattboldt/typed.js)
[![GitHub release](https://img.shields.io/github/release/mattboldt/typed.js.svg)]()
[![npm](https://img.shields.io/npm/dt/typed.js.svg)](https://img.shields.io/npm/dt/typed.js.svg)
Expand All @@ -16,6 +15,10 @@ Typed.js is a library that types. Enter in any string, and watch it type at the

### CDN

```html
<script src="https://unpkg.com/[email protected]/dist/typed.umd.js"></script>
```

For use directly in the browser via `<script>` tag:

```html
Expand All @@ -29,7 +32,7 @@ For use directly in the browser via `<script>` tag:
<script>
var typed = new Typed('#element', {
strings: ['<i>First</i> sentence.', '&amp; a second sentence.'],
typeSpeed: 40,
typeSpeed: 50,
});
</script>
</body>
Expand All @@ -51,7 +54,18 @@ npm install typed.js
yarn add typed.js
```

### Use with ReactJS
#### General ESM Usage

```js
import Typed from 'typed.js';

const typed = new Typed('#element', {
strings: ['<i>First</i> sentence.', '&amp; a second sentence.'],
typeSpeed: 50,
});
```

### ReactJS Usage

```js
import React from 'react';
Expand All @@ -63,11 +77,7 @@ function MyComponent() {

React.useEffect(() => {
const typed = new Typed(el.current, {
strings: [
'Some <i>strings</i> are italic',
'Some <strong>strings</strong> are bold',
'HTML characters &times; &copy;',
],
strings: ['<i>First</i> sentence.', '&amp; a second sentence.'],
typeSpeed: 50,
});

Expand Down
2 changes: 1 addition & 1 deletion assets/demos.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ document.addEventListener('DOMContentLoaded', function () {
stringsElement: '#typed-strings',
typeSpeed: 20,
backSpeed: 20,
startDelay: 1000,
startDelay: 100,
loop: false,
loopCount: Infinity,
onBegin: function (self) {
Expand Down
Loading

0 comments on commit 3d2dd9c

Please sign in to comment.