-
Notifications
You must be signed in to change notification settings - Fork 0
/
glass_button.css
107 lines (94 loc) · 1.76 KB
/
glass_button.css
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
body {
margin: 0;
padding: 0;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background: linear-gradient(-30deg, #1ec4e9 0%, #673ab7 50%, #262626 50%, #607d8b 100%);
}
a {
position: relative;
padding: 25px 50px;
text-decoration: none;
color: #fff;
font-size: 2em;
text-transform: uppercase;
font-family: sans-serif;
letter-spacing: 4px;
overflow: hidden;
background: rgba(255, 255, 255, .1);
box-shadow: 0 5px 5px rgba(0, 0, 0, .2);
}
a:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient();
}
a:after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .4), transparent);
transition: 0.5s;
transition-delay: 0.1s;
}
a:hover:after {
left: 100%;
}
a span {
position: absolute;
display: block;
transition: 0.5s ease;
}
a span:nth-child(1) {
top: 0;
left: 0;
width: 0;
height: 1px;
background: #fff;
}
a:hover span:nth-child(1) {
width: 100%;
transform: translateX(100%);
}
a span:nth-child(3) {
bottom: 0;
right: 0;
width: 0;
height: 1px;
background: #fff;
}
a:hover span:nth-child(3) {
width: 100%;
transform: translateX(-100%);
}
a span:nth-child(2) {
top: 0;
left: 0;
width: 1px;
height: 0;
background: #fff;
}
a:hover span:nth-child(2) {
height: 100%;
transform: translateY(100%);
}
a span:nth-child(4) {
bottom: 0;
right: 0;
width: 1px;
height: 0;
background: #fff;
}
a:hover span:nth-child(4) {
height: 100%;
transform: translateY(-100%);
}