-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjs.js
More file actions
40 lines (38 loc) · 1.44 KB
/
js.js
File metadata and controls
40 lines (38 loc) · 1.44 KB
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
var i = 0;
var k =0;
// var txt = 'Hi, I\'m Daoqi.\n' +
// ' A passionate and self-motivated Robotics Engineering graduate.' +
// 'I received my Master degree in Robotics from the University of Pennsylvania.' +
// 'I love buliding robots and enjoy programming the robots to make them automatic.'; /* The text */
var txt = 'Hi, I am Daoqi Zhang.'
var txt2 = 'And I\'m a Software Engineer.'
var speed = 80; /* The speed/duration of the effect in milliseconds */
function typeWriter() {
if (i < txt.length) {
document.getElementById('demo1').innerHTML += txt.charAt(i);
i++;
setTimeout(typeWriter, speed);
}
}
typeWriter()
function typeWriter_1() {
if (k < txt2.length) {
document.getElementById('demo2').innerHTML += txt2.charAt(k);
k++;
setTimeout(typeWriter_1, speed);
}
}
typeWriter_1()
// var app = document.getElementById('about');
//
// var typewriter = new Typewriter(app, {
// loop: true
// });
//
// typewriter.typeString('Hello, my name is Daoqi. ')
// .pauseFor(2500)
// .typeString('A passionate and self-motivated Robotics Engineering graduate.I received my Master degree in Robotics from the University of Pennsylvania')
// .pauseFor(2500)
// .typeString('I love buliding robots and enjoy programming the robots to make them automatic. I would like to focus more on robots path planning in the furture.')
// .pauseFor(2500)
// .start();