forked from jstejada/react-typist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
58 lines (52 loc) · 1.5 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import React from 'react';
import ReactDOM from 'react-dom';
import Typist from 'Typist';
import './main.scss';
class TypistExample extends React.Component {
state = {
renderMsg: false,
}
onHeaderTyped = () => {
this.setState({ renderMsg: true });
}
render() {
const docs = '//github.com/jstejada/react-typist';
return (
<div className="TypistExample">
<Typist
className="TypistExample-header"
avgTypingSpeed={40}
startDelay={2000}
onTypingDone={this.onHeaderTyped}
>
<a href={docs}>React Typist</a>
</Typist>
<div className="TypistExample-content">
{this.state.renderMsg ? (
<Typist
className="TypistExample-message"
cursor={{ hideWhenDone: true }}
>
* Easy to style
<Typist.Delay ms={1250} />
<br />
* Easy to customize
<Typist.Delay ms={1250} />
<br />
* Easy to use backp<Typist.Delay ms={500} />sace
<Typist.Backspace count={5} delay={1000} />
<Typist.Delay ms={750} />
space
<Typist.Delay ms={1250} />
<br />
<span>* <a href={docs} className="flash">docs</a></span>
<br />
{''}
</Typist>
) : null }
</div>
</div>
);
}
}
ReactDOM.render(<TypistExample />, document.getElementById('content'));