-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkonami.html
More file actions
59 lines (56 loc) · 1.6 KB
/
konami.html
File metadata and controls
59 lines (56 loc) · 1.6 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
<!DOCTYPE html>
<html>
<head>
<title>Konami Code</title>
<style>
body {
text-align: center;
box-sizing: border-box;
}
</style>
</head>
<body>
<h1>Konami Code</h1>
<label for="user-input">Please enter your code here
<input type="password" id="user-input">
</label>
<div class="output"></div>
<script src="js/jquery-3.5.1.js"></script>
<script>
"use strict";
// $(document).keyup(function(event){
// console.log(event.keyCode);
// });
var str = '';
$('#user-input').keyup(function (e) {
str += e.keyCode;
console.log(str);
if (str === '3838404037393739666513') {
$('.output').html('You have added 30 new lives')
.css({
'border': '5px dashed yellow',
'position': 'absolute',
'padding': '50px 30px',
'width': '50%',
'color': 'yellow',
'font-weight': 'bold',
'background-color': 'rgba(0, 0, 0, 0.8)'
})
.animate({fontSize: '50px'}, "slow")
.animate({
left: '25%',
top: '20vh'
}, 1500)
.animate({
height: '35%',
fontSize: '10vh',
// padding: 'calc((35% - 10vh) / 2) 30px',
left: '12.5%',
width: '75%'
}, 1500);
$('body').css('background', 'url(image/videogame-background.png)');
}
});
</script>
</body>
</html>