-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfragile.html
51 lines (41 loc) · 984 Bytes
/
fragile.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"><meta name="viewport" content="width=0, initial-scale=0.6">
<title>Fragile</title>
</head>
<style type="text/css">
h1 {
color: #EE1100;
font-family: sans-serif;
border: solid;
border-radius: 8px;
padding: 4px;
text-align: center;
width: 200px;
margin: auto;
margin-top: 44vh;
}
</style>
<body>
<h1>FRAGILE</h1>
<script>
console.log("Careful now, this webpage is very fragile. Don't change anything!")
function setOriginal() {
original = new XMLSerializer().serializeToString(document);
}
window.onload = setOriginal;
var audio = new Audio('shatter.mp3');
function checkIntegrity() {
var current = new XMLSerializer().serializeToString(document);
if (current != original) {
document.body.style.backgroundImage = "url('shatter.png')";
audio.play();
console.log("Oh deary me!");
clearInterval(intervalID);
}
}
intervalID = setInterval(checkIntegrity, 500);
</script>
</body>
</html>