-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathexample.html
44 lines (43 loc) · 1.02 KB
/
example.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
<script type="text/javascript" src="typing.min.js"></script>
</head>
<style>
#typingCursor {
opacity: 1;
-webkit-animation: blink 1s infinite;
-moz-animation: blink 1s infinite;
animation: blink 1s infinite;
}
@keyframes blink{
0% { opacity:1; }
50% { opacity:0; }
100% { opacity:1; }
}
@-webkit-keyframes blink{
0% { opacity:1; }
50% { opacity:0; }
100% { opacity:1; }
}
@-moz-keyframes blink{
0% { opacity:1; }
50% { opacity:0; }
100% { opacity:1; }
}
</style>
<body>
<span id="typingText">This is a test</span><span id="typingCursor">|</span>
<script>
var element = document.querySelector("#typingText");
var options = {
isRandomSpeed: true,
speed: 1000
};
var typing = new Typing(element, options);
typing.add('1234567890').pause(2000).delete(10);
</script>
</body>
</html>