-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo-vanilla.html
49 lines (49 loc) · 1.35 KB
/
demo-vanilla.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
<!DOCTYPE html>
<meta charset="UTF-8">
<title>TypeSequence Demo</title>
<h1>TypeSequence Demo</h1>
<p>Type <code>a</code>, <code>b</code> and <code>c</code> for 'Hello World'</p>
<p>Type <code>↑</code>, <code>↑</code>, <code>↓</code>, <code>↓</code>, <code>←</code>, <code>→</code>, <code>←</code>, <code>→</code>, <code>B</code>, <code>A</code> for 'Konami'</p>
<p>Type <code>PASSWORD</code> and end with <code>↵</code> for 'Insecure'</p>
<p>Type <code>RUSSIAN</code> to play Russian roulette.</p>
<hr>
<p>By Arjan Eising</p>
<script src="./vanilla.typesequence.min.js"></script>
<script>
window.onload = function() {
typesequence({
sequence: ['a', 'b', 'c'],
callback: function(){
alert('Hello World!');
}
});
typesequence({
once: true,
sequence: ['↑', '↑', '↓', '↓', '←', '→', '←', '→', 'b', 'a'],
callback: function(){
alert('Konami!');
}
});
typesequence({
sequence: ['p', 'a', 's', 's', 'w', 'o', 'r', 'd'],
enter: true,
callback: function(){
alert('Insecure!');
}
});
typesequence({
once: 'depends',
callback: function() {
if (Math.random() < 0.17) {
alert('DEAD');
return true;
}
else {
alert('STILL ALIVE');
return false;
}
},
sequence: ['R', 'U', 'S', 'S', 'I', 'A', 'N']
});
}
</script>