2014-08-18 18:25:33 +04:00
|
|
|
|
|
|
|
.form-horizontal .checkbox {
|
2014-10-05 19:37:10 +04:00
|
|
|
padding-top: 20px;
|
2014-08-18 18:25:33 +04:00
|
|
|
}
|
|
|
|
.checkbox {
|
|
|
|
label {
|
2014-10-05 19:37:10 +04:00
|
|
|
padding-left: 10px;
|
2014-08-18 18:25:33 +04:00
|
|
|
cursor: pointer;
|
|
|
|
position: relative;
|
|
|
|
span {
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
2014-09-17 12:56:21 +04:00
|
|
|
left: 0px;
|
2014-08-18 18:25:33 +04:00
|
|
|
transition-duration: 0.2s;
|
|
|
|
}
|
2014-10-05 19:37:10 +04:00
|
|
|
.check {
|
|
|
|
display: inline-block;
|
|
|
|
width: 20px;
|
|
|
|
height: 20px;
|
|
|
|
border: 2px solid;
|
|
|
|
border-radius: 2px;
|
|
|
|
overflow: hidden;
|
|
|
|
position: relative;
|
|
|
|
top: 5px;
|
|
|
|
left: -3px;
|
|
|
|
}
|
2014-09-17 12:56:21 +04:00
|
|
|
.check:after {
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
content: "";
|
2014-08-20 14:53:26 +04:00
|
|
|
background-color: @lightbg-text;
|
2014-09-07 14:59:27 +04:00
|
|
|
left: -5px;
|
|
|
|
top: -15px;
|
|
|
|
height: 50px;
|
|
|
|
width: 50px;
|
2014-08-18 18:25:33 +04:00
|
|
|
border-radius: 100%;
|
|
|
|
z-index: 1;
|
2014-09-07 14:59:27 +04:00
|
|
|
opacity: 0;
|
2014-08-20 14:53:26 +04:00
|
|
|
margin: 0;
|
2014-08-18 18:25:33 +04:00
|
|
|
}
|
2014-09-17 12:56:21 +04:00
|
|
|
.check:before {
|
2014-10-05 19:37:10 +04:00
|
|
|
position: absolute;
|
2014-09-17 12:56:21 +04:00
|
|
|
content: "";
|
2014-10-05 19:37:10 +04:00
|
|
|
transform: rotate(45deg);
|
|
|
|
display: block;
|
|
|
|
margin-top: -4px;
|
|
|
|
margin-left: 6px;
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
box-shadow:
|
|
|
|
0 0 0 0,
|
|
|
|
0 0 0 0,
|
|
|
|
0 0 0 0,
|
|
|
|
0 0 0 0,
|
|
|
|
0 0 0 0,
|
|
|
|
0 0 0 0,
|
|
|
|
0px 0px 0 0px inset;
|
|
|
|
animation: checkbox-off 0.3s linear forwards;
|
2014-08-18 18:25:33 +04:00
|
|
|
}
|
2014-08-20 14:53:26 +04:00
|
|
|
}
|
2014-09-07 14:59:27 +04:00
|
|
|
|
2014-08-18 18:25:33 +04:00
|
|
|
|
2014-09-07 14:59:27 +04:00
|
|
|
// Hide native checkbox
|
2014-09-29 11:19:20 +04:00
|
|
|
input[type=checkbox] { opacity: 0; }
|
2014-09-07 14:59:27 +04:00
|
|
|
|
2014-09-29 11:19:20 +04:00
|
|
|
|
|
|
|
input[type=checkbox]:focus ~ .check:after {
|
|
|
|
opacity: 0.2;
|
|
|
|
}
|
2014-09-07 14:59:27 +04:00
|
|
|
|
2014-10-05 19:37:10 +04:00
|
|
|
input[type=checkbox]:checked ~ .check {
|
|
|
|
}
|
2014-09-17 12:56:21 +04:00
|
|
|
input[type=checkbox]:checked ~ .check:before {
|
2014-10-05 19:37:10 +04:00
|
|
|
box-shadow:
|
|
|
|
0 0 0 10px,
|
|
|
|
10px -10px 0 10px,
|
|
|
|
32px 0px 0 20px,
|
|
|
|
0px 32px 0 20px,
|
|
|
|
-5px 5px 0 10px,
|
|
|
|
20px -12px 0 11px;
|
|
|
|
animation: checkbox-on 0.3s linear forwards;
|
2014-09-07 14:59:27 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Ripple effect on click
|
2014-09-17 12:56:21 +04:00
|
|
|
input[type=checkbox]:not(:checked) ~ .check:after {
|
2014-10-02 13:36:05 +04:00
|
|
|
animation: rippleOff 500ms linear forwards;
|
2014-09-07 14:59:27 +04:00
|
|
|
}
|
2014-09-17 12:56:21 +04:00
|
|
|
input[type=checkbox]:checked ~ .check:after {
|
2014-10-02 13:36:05 +04:00
|
|
|
animation: rippleOn 500ms linear forwards;
|
2014-10-01 09:57:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Make animate quickly when not hover
|
|
|
|
&:not(:hover) input[type=checkbox] ~ .check {
|
2014-10-02 13:36:05 +04:00
|
|
|
&:before, &:after {
|
|
|
|
animation-duration: 1ms;
|
|
|
|
}
|
2014-09-07 14:59:27 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Style for disabled inputs
|
2014-09-17 12:56:21 +04:00
|
|
|
input[type=checkbox][disabled]:not(:checked) ~ .check:before {
|
2014-08-20 14:53:26 +04:00
|
|
|
opacity: 0.5;
|
|
|
|
}
|
2014-09-17 12:56:21 +04:00
|
|
|
input[type=checkbox][disabled] ~ .check:after {
|
2014-09-07 14:59:27 +04:00
|
|
|
background-color: @lightbg-text;
|
2014-09-17 12:56:21 +04:00
|
|
|
transform: rotate(-45deg);
|
2014-08-18 18:25:33 +04:00
|
|
|
}
|
2014-09-07 14:59:27 +04:00
|
|
|
|
2014-09-17 12:56:21 +04:00
|
|
|
.variations(~" input[type=checkbox]:checked ~ .check:after", background-color, @success);
|
2014-10-05 19:37:10 +04:00
|
|
|
.variations(~" input[type=checkbox]:checked ~ .check:before", color, #4caf50);
|
|
|
|
.variations(~" input[type=checkbox]:checked ~ .check", color, #4caf50);
|
2014-09-07 14:59:27 +04:00
|
|
|
}
|
|
|
|
|
2014-10-05 19:37:10 +04:00
|
|
|
|
|
|
|
@keyframes checkbox-on {
|
2014-09-07 14:59:27 +04:00
|
|
|
0% {
|
2014-10-05 19:37:10 +04:00
|
|
|
box-shadow:
|
|
|
|
0 0 0 10px,
|
|
|
|
10px -10px 0 10px,
|
|
|
|
32px 0px 0 20px,
|
|
|
|
0px 32px 0 20px,
|
|
|
|
-5px 5px 0 10px,
|
|
|
|
15px 2px 0 11px;
|
2014-09-07 14:59:27 +04:00
|
|
|
}
|
|
|
|
50% {
|
2014-10-05 19:37:10 +04:00
|
|
|
box-shadow:
|
|
|
|
0 0 0 10px,
|
|
|
|
10px -10px 0 10px,
|
|
|
|
32px 0px 0 20px,
|
|
|
|
0px 32px 0 20px,
|
|
|
|
-5px 5px 0 10px,
|
|
|
|
20px 2px 0 11px;
|
2014-09-07 14:59:27 +04:00
|
|
|
}
|
|
|
|
100% {
|
2014-10-05 19:37:10 +04:00
|
|
|
box-shadow:
|
|
|
|
0 0 0 10px,
|
|
|
|
10px -10px 0 10px,
|
|
|
|
32px 0px 0 20px,
|
|
|
|
0px 32px 0 20px,
|
|
|
|
-5px 5px 0 10px,
|
|
|
|
20px -12px 0 11px;
|
2014-08-18 18:25:33 +04:00
|
|
|
}
|
2014-09-07 14:59:27 +04:00
|
|
|
}
|
2014-10-05 19:37:10 +04:00
|
|
|
@keyframes checkbox-off {
|
2014-09-07 14:59:27 +04:00
|
|
|
0% {
|
2014-10-05 19:37:10 +04:00
|
|
|
box-shadow:
|
|
|
|
0 0 0 10px,
|
|
|
|
10px -10px 0 10px,
|
|
|
|
32px 0px 0 20px,
|
|
|
|
0px 32px 0 20px,
|
|
|
|
-5px 5px 0 10px,
|
|
|
|
20px -12px 0 11px,
|
|
|
|
0 0 0 0 inset;
|
2014-09-07 14:59:27 +04:00
|
|
|
}
|
2014-09-30 15:57:49 +04:00
|
|
|
|
2014-10-05 19:37:10 +04:00
|
|
|
25% {
|
|
|
|
box-shadow:
|
|
|
|
0 0 0 10px,
|
|
|
|
10px -10px 0 10px,
|
|
|
|
32px 0px 0 20px,
|
|
|
|
0px 32px 0 20px,
|
|
|
|
-5px 5px 0 10px,
|
|
|
|
20px -12px 0 11px,
|
|
|
|
0 0 0 0 inset;
|
2014-09-07 14:59:27 +04:00
|
|
|
}
|
|
|
|
50% {
|
2014-10-05 19:37:10 +04:00
|
|
|
transform: rotate(45deg);
|
|
|
|
margin-top: -4px;
|
|
|
|
margin-left: 6px;
|
|
|
|
width: 0px;
|
|
|
|
height: 0px;
|
|
|
|
box-shadow:
|
|
|
|
0 0 0 10px,
|
|
|
|
10px -10px 0 10px,
|
|
|
|
32px 0px 0 20px,
|
|
|
|
0px 32px 0 20px,
|
|
|
|
-5px 5px 0 10px,
|
|
|
|
15px 2px 0 11px,
|
|
|
|
0 0 0 0 inset;
|
2014-10-02 13:36:05 +04:00
|
|
|
}
|
2014-10-05 19:37:10 +04:00
|
|
|
51% {
|
|
|
|
transform: rotate(0deg);
|
|
|
|
margin-top: -2px;
|
|
|
|
margin-left: -2px;
|
|
|
|
width: 20px;
|
|
|
|
height: 20px;
|
|
|
|
box-shadow:
|
|
|
|
0 0 0 0,
|
|
|
|
0 0 0 0,
|
|
|
|
0 0 0 0,
|
|
|
|
0 0 0 0,
|
|
|
|
0 0 0 0,
|
|
|
|
0 0 0 0,
|
|
|
|
0px 0px 0 10px inset;
|
2014-10-02 13:36:05 +04:00
|
|
|
}
|
|
|
|
100% {
|
2014-10-05 19:37:10 +04:00
|
|
|
transform: rotate(0deg);
|
|
|
|
margin-top: -2px;
|
|
|
|
margin-left: -2px;
|
|
|
|
width: 20px;
|
|
|
|
height: 20px;
|
|
|
|
box-shadow:
|
|
|
|
0 0 0 0,
|
|
|
|
0 0 0 0,
|
|
|
|
0 0 0 0,
|
|
|
|
0 0 0 0,
|
|
|
|
0 0 0 0,
|
|
|
|
0 0 0 0,
|
|
|
|
0px 0px 0 0px inset;
|
2014-10-02 13:36:05 +04:00
|
|
|
}
|
|
|
|
}
|