-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheaster-egg.html
More file actions
89 lines (80 loc) · 2.43 KB
/
Copy patheaster-egg.html
File metadata and controls
89 lines (80 loc) · 2.43 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Easter Egg Link</title>
<style>
body {
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
position: relative;
background-color: #f0f0f0;
overflow: hidden;
position: relative;
background: radial-gradient(circle, white 20%, rgba(255, 255, 255, 0.8) 50%, rgb(162, 161, 162) 100%);
}
#todo {
position: absolute;
top: 0;
font-size: 2rem;
font-weight: 500;
font-family: monospace;
}
.easter-egg {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) scale(2);
padding: 20px;
border-radius: 10px;
text-align: center;
display: none;
}
.link {
text-decoration: none;
}
@media screen and (min-width:2000px) {
#todo {
font-size: 4rem;
}
}
@media screen and (max-width:600px) {
#todo {
font-size: 1rem;
}
}
@media screen and (max-width:300px) {
#todo {
font-size: 0.7rem;
}
}
</style>
</head>
<body>
<p id="todo">Find the hidden easter egg</p>
<div class="easter-egg" id="easter-egg">
<a href="secret.html" class="link" target="_blank">🥚</a>
</div>
<script>
const easterEgg = document.getElementById('easter-egg');
const easterEggPosition = { x: window.innerWidth / 2, y: window.innerHeight / 2 };
const visibilityRadius = 150;
document.addEventListener('mousemove', (event) => {
const distance = Math.sqrt(
Math.pow(event.clientX - easterEggPosition.x, 2) +
Math.pow(event.clientY - easterEggPosition.y, 2)
);
if (distance < visibilityRadius) {
easterEgg.style.display = 'block';
const opacity = 1 - (distance / visibilityRadius);
easterEgg.style.opacity = opacity;
} else {
easterEgg.style.display = 'none';
}
});
</script>
</body>
</html>