-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
52 lines (46 loc) · 1.58 KB
/
index.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
50
51
52
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="media/love.png" type="image/x-icon">
<title>Key Sequence Detection</title>
<script src="https://cdn.jsdelivr.net/npm/js-confetti@latest/dist/js-confetti.browser.js"></script>
<style>
body {
background: url('./media/pattern.svg');
font-family: cursive, sans-serif;
}
.title {
width: 800px;
margin: auto;
text-align: center;
margin-top: 50px;
color: purple;
}
</style>
</head>
<body>
<div class="title">
<h1>🎉 Type my crush 😍 name for surprise 🎊</h1>
</div>
<script>
const pressed = [];
const secretCode = 'khushi';
console.info('Hint: Ask my close friends or figure out on your own 👍')
window.addEventListener('keyup', (e) => {
pressed.push(e.key);
pressed.splice(-secretCode.length - 1, pressed.length - secretCode.length);
if (pressed.join('').includes(secretCode)) {
const jsConfetti = new JSConfetti()
jsConfetti.addConfetti({
emojis: ['😍','🥰','😘','🤗','💖','💞','💕','❤️🔥','❤️','💋','🎉','🎊','💫'],
emojiSize: 70,
confettiNumber: 100,
})
}
})
</script>
</body>
</html>