-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtry.html
More file actions
127 lines (100 loc) · 2.77 KB
/
try.html
File metadata and controls
127 lines (100 loc) · 2.77 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE html>
<html>
<head>
<style>
html {
padding: 0;
margin: 0;
height: 100%;
outline: none;
background-color: brown;
}
body {
border: 20px solid brown;
position: relative;
}
.main {
display: flex;
height: 98vh;
background-color: #ffffff;
}
#left {
width: 50%;
float: left;
background-color: lightblue;
border: 1px solid black;
box-shadow: -4px 6px 8px rgba(0, 0, 0, .7);
}
#right {
width: 50%;
float: right;
background-color: lightskyblue;
border: 1px solid black;
box-shadow: -4px 6px 8px rgba(0, 0, 0, .7);
}
@keyframes opengateLeft {
100% {
transform: translateX(-800px);
}
}
@keyframes opengateRight {
100% {
transform: translateX(800px);
}
}
button {
height: 50px;
width: 50px;
border-radius: 50%;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
#cover {
position: fixed;
width: 100%;
height: 100%;
background: brown;
}
@keyframes cover {
0% {
transform: scale(0);
}
100% {
transform: scale(4);
}
}
</style>
</head>
<body>
<div class="main" id="enterbox">
<div id="left"></div>
<div id="right"></div>
</div>
<button id="btn" onclick="openAnimation()"></button>
<div id="cover"></div>
<script>
function openAnimation() {
var left = document.getElementById("left");
var right = document.getElementById("right");
var cover = document.getElementById("enterbox");
left.style.animation = "opengateLeft 4s";
right.style.animation = "opengateRight 4s";
left.addEventListener('animationend', function () {
left.style.display = 'none';
});
right.addEventListener('animationend', function () {
right.style.display = 'none';
cover.style.animation = "cover 2s forwards";
});
cover.addEventListener('animationend', function () {
setTimeout(function () {
window.location.href = 'index.html';
}, 500);
});
document.getElementById("btn").style.display = "none";
}
</script>
</body>
</html>