-
Notifications
You must be signed in to change notification settings - Fork 0
/
btn_style.html
128 lines (120 loc) · 2.47 KB
/
btn_style.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>btn-style</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: 250px;
height:100px;
background: darkcyan;
border-radius: 5px;
position: absolute;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
}
body div:before{
content: "CLICK ME";
position: absolute;
display: flex;
align-items: center;
justify-content: center;
border-radius: 5px;
width: 100%;
height: 50%;
background: cyan;
}
div span:nth-child(1){
top: 0px;
width: 100%;
height: 2.5px;
position: absolute;
background: linear-gradient(to right,transparent,darkcyan,cyan);
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,cyan,darkcyan);
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,darkcyan,cyan);
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,cyan,darkcyan);
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;}
}
</style>
</head>
<body>
<div onclick="btn()">
<span></span>
<span></span>
<span></span>
<span></span>
</div>
<script type="text/javascript">
function btn() {
alert("Don't Click It Again ,It's Just A Button");
}
</script>
</body>
</html>