-
Notifications
You must be signed in to change notification settings - Fork 13
/
easter_egg.php
93 lines (63 loc) · 2.09 KB
/
easter_egg.php
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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="easter_egg_style.css">
</head>
<body>
<!-- The Easter Egg Modal -->
<div id="eEgg_modal" class="modal-eEgg">
<div class="modal-content-eEgg">
<div class="caption" style="border-radius: 5px 5px 0 0;">
<h3>They float,' it growled, 'they float, Georgie, and when
you’re down here with me, you’ll float, too–'</h3>
</div>
<img id="eEgg_image" src="/images/pennywise.jpg">
<div class="caption" style="border-radius: 0 0 5px 5px;">
<h3 id="footer" style="text-align:center;">Going back in 20s...</h3>
</div>
</div>
</div>
</body>
</html>
<script>
var old_time = 0;
var count = 1;
var eEgg_flag = false;
var modal = document.getElementById('eEgg_modal');
var footer = document.getElementById('footer');
function eEgg_func(){
var d = new Date();
var n = d.getTime();
var new_time = Math.ceil(n/1000);
if ((new_time - old_time) <= 1) {
count++;
}
else {
count = 1;
}
old_time = new_time;
if (count > 7 && !eEgg_flag) {
modal.style.display = "block";
eEgg_flag = true;
// Timeout
setTimeout(function () {
modal.style.display = "none";
}, 21000);
//Timeout text display in the footer
var now = new Date().getTime();
var countDownDate = now + 21000;
setInterval(function() {
// Get todays date and time
var now = new Date().getTime();
// Find the distance between now an the count down date
var distance = countDownDate - now;
// Time calculations for seconds
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Display the result in the element with id="demo"
document.getElementById("footer").innerHTML =
"Going back in "+ seconds + "s...";
}, 1000);
}
}
</script>