-
Notifications
You must be signed in to change notification settings - Fork 0
/
button.css
193 lines (184 loc) · 4.52 KB
/
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
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
@import url(https://fonts.googleapis.com/css?family=Open+Sans);
*, *::before, *::after {
box-sizing: border-box;
}
body {
background: #FDFDFD;
margin: 25px 0;
}
span.title {
margin: 0 auto;
color: #BBB;
font-family: 'Open Sans', sans-serif;
font-size: 0.85rem;
text-align: center;
display: block;
}
.basicBox, .swiggleBox, .checkBox {
width: 130px;
height: 65px;
margin: 15px auto;
color: #4274D3;
font-family: 'Open Sans', sans-serif;
font-size: 1.15rem;
line-height: 65px;
text-transform: uppercase;
text-align: center;
position: relative;
cursor: pointer;
}
svg {
position: absolute;
top: 0;
left: 0;
}
svg rect, svg path, svg polyline {
fill: none;
stroke: #4274D3;
stroke-width: 1;
}
.basicBox:hover svg rect, .swiggleBox:hover svg path, .checkBox:hover svg polyline {
stroke: #4274D3;
}
/* Basic Box */
svg rect {
stroke-dasharray: 400, 0;
-webkit-transition: all 0.8s ease-in-out;
-moz-transition: all 0.8s ease-in-out;
-ms-transition: all 0.8s ease-in-out;
-o-transition: all 0.8s ease-in-out;
}
.basicBox:hover svg rect {
stroke-width: 3;
stroke-dasharray: 35, 245;
stroke-dashoffset: 38;
-webkit-transition: all 0.8s ease-in-out;
-moz-transition: all 0.8s ease-in-out;
-ms-transition: all 0.8s ease-in-out;
-o-transition: all 0.8s ease-in-out;
}
/* Swiggle Box */
svg path {
stroke-dasharray: 265, 0;
-webkit-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
-ms-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
}
.swiggleBox:hover svg path {
stroke-width: 3;
stroke-dasharray: 0, 350;
stroke-dashoffset: 20;
-webkit-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
-ms-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
}
/* Check Box */
.checkBox {
/* Add Padding Left To Center Text */
}
.checkBox svg {
/* Presentation Purposes */
margin-left: -10px;
}
.checkBox svg rect, .checkBox svg polyline {
fill: none;
stroke: #4274D3;
stroke-width: 1;
-webkit-transition: all 0.8s ease-in-out;
-moz-transition: all 0.8s ease-in-out;
-ms-transition: all 0.8s ease-in-out;
-o-transition: all 0.8s ease-in-out;
}
.checkBox:hover svg rect {
stroke-width: 2;
-webkit-transition: all 0.8s ease-in-out;
-moz-transition: all 0.8s ease-in-out;
-ms-transition: all 0.8s ease-in-out;
-o-transition: all 0.8s ease-in-out;
}
.checkBox:hover svg polyline {
stroke-width: 2;
-webkit-transition: all 0.8s ease-in-out;
-moz-transition: all 0.8s ease-in-out;
-ms-transition: all 0.8s ease-in-out;
-o-transition: all 0.8s ease-in-out;
}
.checkBox svg .button {
stroke-dasharray: 400px, 0;
}
.checkBox:hover svg .button {
stroke-dasharray: 0, 400px;
stroke-dashoffset: 33px;
}
/* Check Mark Effect */
.box, .checkMark {
opacity: 0;
}
.checkBox:hover .box {
-webkit-animation: boxDisplay 0.2s forwards;
-moz-animation: boxDisplay 0.2s forwards;
-ms-animation: boxDisplay 0.2s forwards;
-o-animation: boxDisplay 0.2s forwards;
animation: boxDisplay 0.2s forwards;
-webkit-animation-delay: 0.65s;
-moz-animation-delay: 0.65s;
-ms-animation-delay: 0.65s;
-o-animation-delay: 0.65s;
animation-delay: 0.65s;
}
.checkBox:hover .checkMark {
-webkit-animation: checkDisplay 0.2s forwards;
-moz-animation: checkDisplay 0.2s forwards;
-ms-animation: checkDisplay 0.2s forwards;
-o-animation: checkDisplay 0.2s forwards;
animation: checkDisplay 0.2s forwards;
-webkit-animation-delay: 1s;
-moz-animation-delay: 1s;
-ms-animation-delay: 1s;
-o-animation-delay: 1s;
animation-delay: 1s;
}
/* Check Box Display */
@-webkit-keyframes boxDisplay {
0% { opacity: 0; }
100% { opacity: 1; }
}
@-moz-keyframes boxDisplay {
0% { opacity: 0; }
100% { opacity: 1; }
}
@-ms-keyframes boxDisplay {
0% { opacity: 0; }
100% { opacity: 1; }
}
@-o-keyframes boxDisplay {
0% { opacity: 0; }
100% { opacity: 1; }
}
@keyframes boxDisplay {
0% { opacity: 0; }
100% { opacity: 1; }
}
/* Check Mark Display */
@-webkit-keyframes checkDisplay {
0% { opacity: 0; }
100% { opacity: 1; }
}
@-moz-keyframes checkDisplay {
0% { opacity: 0; }
100% { opacity: 1; }
}
@-ms-keyframes checkDisplay {
0% { opacity: 0; }
100% { opacity: 1; }
}
@-o-keyframes checkDisplay {
0% { opacity: 0; }
100% { opacity: 1; }
}
@keyframes checkDisplay {
0% { opacity: 0; }
100% { opacity: 1; }
}