forked from brunosimon/burno.js
-
Notifications
You must be signed in to change notification settings - Fork 1
/
konami_code.html
36 lines (28 loc) · 951 Bytes
/
konami_code.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Burno.js - Demo - Konami Code</title>
<link rel="stylesheet" href="../src/css/style.css">
</head>
<body>
<div class="element"><strong>Use the konami code</strong><br><br><span class="value"></span></div>
<!-- B.js -->
<script src="../../builds/burno-0.2.js"></script>
<script>
var konami = new B.Tools.Konami_Code();
konami.on( 'used', function()
{
document.querySelector( '.element .value' ).innerHTML = 'Hadouken!!!';
} );
konami.on( 'wrong', function( index )
{
document.querySelector( '.element .value' ).innerHTML = 'wrong after ' + index + ' keys';
} );
konami.on( 'timeout', function( index )
{
document.querySelector( '.element .value' ).innerHTML = 'timeout after ' + index + ' keys';
} );
</script>
</body>
</html>