-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbtn2.html
174 lines (166 loc) · 3.22 KB
/
btn2.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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>btn</title>
<style type="text/css">
*{
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
body{
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
div{
width: 200px;
height: 100px;
/*background: red;*/
border: 0.5px solid #111;
border-radius: 10px;
position: absolute;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
transition: all 2s;
}
div:before{
content: "";
display: flex;
align-items: center;
justify-content: end;
width: 50%;
height: 100%;
left: -100px;
background: navy;
position: absolute;
border-top-left-radius: 8px;
border-bottom-left-radius: 8px;
z-index: -1;
transition: all 2s;
}
div:after{
content: "";
display: flex;
align-items: center;
width: 50%;
height: 100%;
right: -100px;
top: 0px;
background: navy;
position: absolute;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
z-index: -1;
transition: all 2s;
}
div:hover:before{
left:0px;
transition: 1s all;
}
div:hover:after{
right:0px;
transition: 1s all;
}
div span:nth-child(1){
top: 0px;
width: 100%;
height: 2.5px;
position: absolute;
background: linear-gradient(to right,transparent,blue,orange);
animation: ani1 2s linear infinite ;
transform: 2s all;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
}
@keyframes ani1{
0%{left: -250px;}
100%{left: 250px;}
}
div span:nth-child(2){
width: 2.5px;
height: 100%;
right: 0px;
top: -100px;
position: absolute;
background: linear-gradient(to bottom,transparent,blue,orange);
animation: ani2 2s linear infinite ;
transform: 2s all;
animation-delay: 1s;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
@keyframes ani2{
0%{top: -100px;}
100%{top: 150px;}
}
div span:nth-child(3){
width: 100%;
height: 2.5px;
bottom: 0px;
right: -250px;
position: absolute;
background: linear-gradient(to left,transparent,blue,orange);
animation: ani3 2s linear infinite ;
transform: 2s all;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}
@keyframes ani3{
0%{right: -250px;}
100%{right: 250px;}
}
div span:nth-child(4){
width: 2.5px;
height: 100%;
left: 0px;
bottom: -100px;
position: absolute;
background: linear-gradient(to top,transparent,blue,orange);
animation: ani4 2s linear infinite ;
transform: 2s all;
animation-delay: 1s;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
@keyframes ani4{
0%{bottom: -100px;}
100%{bottom: 150px;}
}
span{
display: none;
}
div:hover span{
display: block;
}
p{
font-weight: bold;
text-transform: uppercase;
font-size: 0px;
color: white;
transition: 1s all;
}
div:hover p{
font-size: 22px;
}
</style>
</head>
<body>
<div onclick="btn()">
<span></span>
<span></span>
<span></span>
<span></span>
<p>click</p>
</div>
<script type="text/javascript">
function btn(){
alert("DON'T DO IT AGAIN")
}
</script>
</body>
</html>