This repository has been archived by the owner on Jul 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
95 lines (94 loc) · 2.62 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
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
<!DOCTYPE html>
<html>
<head>
<title>Self-Distruct Button</title>
<script>
var $ = function(id) {
return document.getElementById(id);
};
function load() {
$("lid").classList.has = function(val) {
for (var i in $("lid").classList)
if ($("lid").classList[i] == val) return true;
return false;
};
$("lid").addEventListener("click", function() {
if (this.classList.has("on")) {
//it will close
this.classList.remove("on");
} else {
//it will open
this.classList.add("on");
}
});
$("btn").addEventListener("click", function() {
console.log('HERE');
document.getElementById("container").innerHTML = "Page not found"
});
}
</script>
<style>
.lid,
.btn,
.btn-inr {
display: inline-block;
position: absolute;
width: 50px;
height: 50px;
}
.lid {
width: 50px;
height: 50px;
z-index: 3;
background-color: #1a1a1a;
-webkit-transform: perspective(200px) rotateY(0deg);
-moz-transform: perspective(200px) rotateY(0deg);
-ms-transform: perspective(200px) rotateY(0deg);
-o-transform: perspective(200px) rotateY(0deg);
transform: perspective(200px) rotateY(0deg);
transition: transform 1s;
color: #fff;
text-align: center;
padding-top: 17px;
height: 33px;
}
.lid.on {
-webkit-transform: perspective(200px) rotateY(180deg) translate(50px, 0);
-moz-transform: perspective(200px) rotateY(180deg) translate(50px, 0);
-ms-transform: perspective(200px) rotateY(180deg) translate(50px, 0);
-o-transform: perspective(200px) rotateY(180deg) translate(50px, 0);
transform: perspective(200px) rotateY(180deg) translate(50px, 0);
}
.btn-inr {
z-index: 2;
width: 10px;
height: 10px;
border-radius: 50%;
font-size: 10px;
background-color: #ff0f0f;
border: none;
}
.btn {
z-index: 1;
padding: 20px;
height: 10px;
width: 10px;
background-color: #4a4a4a;
}
.self_d {
padding: 50px;
}
</style>
</head>
<body onload="load()">
<div id="container">
<div class="self_d">
<div class="lid" id="lid"> </div>
<div id="btn" class="btn">
<button class="btn-inr"> </button>
</div>
</div>
Don't press this button
</div>
</body>
</html>