-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkonami.html
More file actions
73 lines (61 loc) · 2.96 KB
/
konami.html
File metadata and controls
73 lines (61 loc) · 2.96 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
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
69
70
71
72
73
<!DOCTYPE html>
<html lang="en">
<head>
<title>Konami Code</title>
<script src="https://kit.fontawesome.com/2f6b90b1d3.js" crossorigin="anonymous"></script>
</head>
<body>
<nav style="display: flex; flex-direction: row-reverse;">
<ul id="code" style="list-style-type: none;">
<!-- <li id="up"><i class="fas fa-arrow-circle-up"></i></li>-->
<!-- <li id="down"><i class="fas fa-arrow-circle-down"></i></li>-->
<!-- <li id="left"><i class="fas fa-arrow-circle-left"></i></li>-->
<!-- <li id="right"><i class="fas fa-arrow-circle-right"></i></li>-->
<!-- <li id="b"><img src="assets/letter-b.png" alt="" height="16px" width="16px"></li>-->
<!-- <li id="a"><img src="assets/letter-a.png" alt="" height="16px" width="16px"></li>-->
<!-- <li id="enter"><img src="assets/start.png" alt="" height="16px" width="16px"></li>-->
</ul>
</nav>
<h1 style="text-align:center">Konami Code</h1>
<div id="emu" style="opacity: 0;"></div>
<div class="music" style="display:none;"></div>
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
<script>
"use strict";
var code = [];
var konamiCode = [38,38,40,40,37,39,37,39,66,65,13];
// console.log('konamiCode: ', konamiCode);
// console.log('konami Code String format: ', konamiCode.toString());
$(document).keyup(function(event){
// console.log(event.keyCode);
code.push(event.keyCode);
// console.log("String of Inputs: ", code.toString());
if(code.toString().includes(konamiCode.toString())){
$('body').css({"background-image":"url('../img/contraLogo.png')","background-size":"cover","background-repeat":"no-repeat"});
$('h1').css('color','red');
$('#emu').css("opacity","1");
$('.music').html('<audio controls autoplay>\n' +
' <source src="assets/title.mp3" type="audio/mpeg">\n' +
' Your browser does not support the audio element.\n' +
'</audio>\n')
}
});
// trying to get code buttons to show up
// $(document).keyup(function (e){
// if(e.keyCode === 38){
// let html =''
// $('#code').html( html +='<li id="up"><i class="fas fa-arrow-circle-up"></i></li>')
// }
// })
</script>
<script>
var NepPlayer = "#emu"; // ID of html element where the emulator will be inserted
var NepEmu = "nes"; // Platform select
var NepZoom = "enable"; // Add extra button on toolbar to scale up emulator. Disabled by default
var NepMaxWidth = "1100px"; // Maximum width size of emulator. 870px by default
var NepLang = "en"; // Interface language of the emulator. EN by default
var gameUrl = src = "assets/Contra.zip"; // Game Url
</script>
<script src="https://mem.neptunjs.com/njs/njsLoader.js" type="text/javascript"> //NeptunJS lib </script>
</body>
</html>