-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample.html
68 lines (62 loc) · 1.49 KB
/
sample.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>Typist sample</title>
<style>
@keyframes blink {
0% { opacity: 1.0; }
50% { opacity: 0.0; }
100% { opacity: 1.0; }
}
@-webkit-keyframes blink {
0% { opacity: 1.0; }
50% { opacity: 0.0; }
100% { opacity: 1.0; }
}
#typist-element:after {
content: " ";
display: inline-block;
height: 1.2em;
vertical-align: baseline;
position: relative;
top: 0.2em;
margin-left: 3px;
margin-right: 7px;
width: 1px;
background: #333;
animation: blink 1s step-start 0s infinite;
-webkit-animation: blink 1s step-start 0s infinite;
}
.selectedText {
font-style: normal;
background: #ccc;
}
</style>
<script src="bower_components/Typist/dist/typist.js"></script>
</head>
<body>
<section>
<h1>example</h1>
<p>
JavaScript is <strong id="typist-element" data-typist="ugly,not as good an CoffeeScript" data-typist-suffix="since it's JS">great</strong>
</p>
</section>
<aside>[positionly/Typist @ GitHub](https://github.com/positionly/Typist)</aside>
<script>
window.onload = function() {
var typist;
typist = document.querySelector("#typist-element");
new Typist(typist, {
letterInterval: 60,
textInterval: 3000,
onSlide: function(text, options) {
var suffix;
suffix = options.typist.getAttribute("data-typist-suffix");
return console.log("" + text + " " + suffix);
}
});
}
</script>
</body>
</html>