-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
49 lines (47 loc) · 1.54 KB
/
main.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
import TypeIt from "typeit";
document.addEventListener("DOMContentLoaded", function () {
new TypeIt("#type-code", {
strings: [
`<span class='purple'>import </span>
<span class="red"> React </span>
<span class="purple"> from </span>
<span class="green">'react</span>';`,
` `,
`<span class='purple'>function</span>
<span class="red"> helloWorld </span>
() {`,
`<span class='purple'> return </span>
<div> Hello World! </div>`,
`}`,
` `,
`
<span class='red'> ReactDOM.render</span>(<HelloWorld >,<span class='purple'>document</span>.<span class='red'>getElementById</span>(<span class='green'>'root'</span>));`,
` `,
` `,
`// I need some coffee ! `,
],
speed: 40,
waitUntilVisible: true,
})
.pause(3000)
.delete()
.type(
`<span class='purple'>const </span>
coffeeCup =
<span class='purple'> new </span>
<span class="red"> Coffee</span>();
<div class="text-black"> .</div>
<div> <span class='purple'> if </span> ( coffeeCup.isEmpty() ) { </div>
<div> coffee.<span class="red">refill</span>(); </div>
<div>}</div>
<div class="text-black"> .</div>
<div> <span class='purple'> if </span> ( !coffeeCup.isEmpty() ) { </div>
<div> coffee.<span class="red">drink</span>(); </div>
<div>}</div>
<div class="text-black"> .</div>
work.<span class="red">execute</span>();
`,
{}
)
.go();
});