-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkonami.html
More file actions
129 lines (119 loc) · 3.1 KB
/
konami.html
File metadata and controls
129 lines (119 loc) · 3.1 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!DOCTYPE html>
<html>
<style>
body {
background-image: url('img/contra.jpeg');
background-size: cover;
background-repeat: no-repeat;
}
h1 {
color: white;
font-size: 40px;
}
h2 {
font-size: 40px;
color: darkred;
}
@keyframes pulse {
0% {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}
@keyframes increaseSize {
0% {
font-size: 24px;
}
50% {
font-size: 30px;
}
100% {
font-size: 24px;
}
}
/*@keyframes bleedingColor {*/
/* 0% {*/
/* background-position: 0% 50%;*/
/* }*/
/* 50% {*/
/* background-position: 100% 50%;*/
/* }*/
/* 100% {*/
/* background-position: 0% 50%;*/
/* }*/
/*}*/
.bleeding-text {
animation: moveSmoke 5s infinite alternate;
background: repeating-linear-gradient(45deg, dimgrey, black, darkred);
color: transparent;
-webkit-text-stroke: 1px white;
text-align: center;
padding: 10px;
border-radius: 5px;
/*animation: bleedingColor 4s infinite;*/
width: 250px;
height: 80px;
background-clip: text;
-webkit-background-clip: text;
}
@keyframes moveSmoke {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
</style>
<head>
<title>Konami Code</title>
</head>
<body>
<h1 id="title">Konami Code</h1>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<h2 id="life">Life Count: 3</h2>
<script>
"use strict";
document.addEventListener("keyup", event => console.log(event.key));
const keysPressed = [];
document.addEventListener("keyup", event => { keysPressed.push(event.key);
const konamiCode =
keysPressed[0] === "ArrowUp" && keysPressed[1] === "ArrowUp"
&& keysPressed[2] === "ArrowDown" && keysPressed[3] === "ArrowDown"
&& keysPressed[4] === "ArrowLeft" && keysPressed[5] === "ArrowRight"
&& keysPressed[6] === "ArrowLeft" && keysPressed[7] === "ArrowRight"
&& keysPressed[8] === 'a' && keysPressed[9] === 'b' && keysPressed[10] === 'Enter';
if (konamiCode) {
const LifeCount = document.getElementById('life');
LifeCount.innerHTML = "<div><h2 class='bleeding-text'>Konami Code Life Count: 30</h2></div>"
const Title = document.getElementById('title');
Title.innerHTML = "<h1></h1>"
alert("You have added 30 lives!")
document.body.style.backgroundImage = "url(img/contraHD.jpeg"
document.body.style.animation = 'pulse 2s infinite';
document.body.style.margin = '150px';
}
});
setTimeout(function () {
keysPressed.length = 0;
}, 8000);
</script>
</body>
</html>