-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
131 lines (120 loc) · 3.2 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
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Toidicode.com - Create button animation</title>
<style>
body {
padding: 0;
margin: 0;
background-color: #787878;
}
a {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background-color: #000000;
padding: 20px 40px;
text-decoration: none;
color: white;
text-transform: uppercase;
overflow: hidden;
box-shadow: 0 1px 3px .4px #000000;
transition: all 0.3s;
}
a:hover {
box-shadow: 0 1px 7px .4px #000000;
color: red;
}
/*TOP*/
a span:nth-child(1) {
content: '';
position: absolute;
width: 100%;
height: 3px;
background: red linear-gradient(to right, black, red);
top: 0;
right: 0;
animation: animationleft 2s linear 0.3s infinite;
}
/*Right*/
a span:nth-child(2) {
content: '';
position: absolute;
width: 3px;
height: 100%;
background: red linear-gradient(to bottom, black, red);
top: 0;
right: 0;
animation: animationdown 2s linear 0.3s infinite;
}
/*Bottom*/
a span:nth-child(3) {
content: '';
position: absolute;
width: 100%;
height: 3px;
background: red linear-gradient(to left, black, red);
bottom: 0;
right: 0;
animation: animationright 2s linear 0.3s infinite;
}
/*Left*/
a span:nth-child(4) {
content: '';
position: absolute;
width: 3px;
height: 100%;
background: red linear-gradient(to top, black, red);
top: 0;
left: 0;
animation: animationtop 2s linear 0.3s infinite;
}
@keyframes animationdown {
from {
transform: translateY(-100%);
}
to {
transform: translateY(100%);
}
}
@keyframes animationtop {
from {
transform: translateY(100%);
}
to {
transform: translateY(-100%);
}
}
@keyframes animationleft {
from {
transform: translateX(-100%);
}
to {
transform: translateX(100%);
}
}
@keyframes animationright {
from {
transform: translateX(100%);
}
to {
transform: translateX(-100%);
}
}
</style>
</head>
<body>
<a href="#">
<span></span>
<span></span>
<span></span>
<span></span>
Button
</a>
</body>
</html>