added support for hints under inputs on focus

This commit is contained in:
FezVrasta 2014-11-12 13:22:17 +01:00
parent 3bad268ab5
commit 305b4ea378
9 changed files with 90 additions and 197 deletions

View File

@ -100,6 +100,8 @@ Add `.btn-raised` to a button to add a permanent shadow to it.
Add `.floating-label` to an input field with a `placeholder` to transform the placeholder in a floating label. Add `.floating-label` to an input field with a `placeholder` to transform the placeholder in a floating label.
Add `data-hint="some hint"` to show an hint under the input when the user focus it.
Remember to use the proper HTML markup to get radio and checkboxes styled correctly (choose between *radio* or *checkbox*): Remember to use the proper HTML markup to get radio and checkboxes styled correctly (choose between *radio* or *checkbox*):
<div class="radio/checkbox radio-primary"> <div class="radio/checkbox radio-primary">

View File

@ -2625,8 +2625,7 @@ body .jumbotron-material-lightgrey,
text-transform: uppercase; text-transform: uppercase;
text-decoration: none; text-decoration: none;
color: rgba(255, 255, 255, 0.84); color: rgba(255, 255, 255, 0.84);
-webkit-transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1); transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
outline: none !important; outline: none !important;
} }
.btn:hover:not(.btn-link):not(.btn-flat) { .btn:hover:not(.btn-link):not(.btn-flat) {
@ -2785,8 +2784,7 @@ body .jumbotron-material-lightgrey,
} }
.btn.btn-raised { .btn.btn-raised {
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
-webkit-transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1); transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
} }
.btn.btn-raised:active:not(.btn-link) { .btn.btn-raised:active:not(.btn-link) {
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
@ -3004,8 +3002,7 @@ body .jumbotron-material-lightgrey,
border-radius: 2px; border-radius: 2px;
margin: 10px 1px; margin: 10px 1px;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
-webkit-transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1); transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
} }
.btn-group:active:not(.btn-link), .btn-group:active:not(.btn-link),
.btn-group-vertical:active:not(.btn-link) { .btn-group-vertical:active:not(.btn-link) {
@ -3018,8 +3015,7 @@ body .jumbotron-material-lightgrey,
.btn-group.btn-group-raised, .btn-group.btn-group-raised,
.btn-group-vertical.btn-group-raised { .btn-group-vertical.btn-group-raised {
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
-webkit-transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1); transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
} }
.btn-group.btn-group-raised:active:not(.btn-link), .btn-group.btn-group-raised:active:not(.btn-link),
.btn-group-vertical.btn-group-raised:active:not(.btn-link) { .btn-group-vertical.btn-group-raised:active:not(.btn-link) {
@ -3053,8 +3049,7 @@ body .jumbotron-material-lightgrey,
display: block; display: block;
position: absolute; position: absolute;
left: 0px; left: 0px;
-webkit-transition-duration: 0.2s; transition-duration: 0.2s;
transition-duration: 0.2s;
} }
.checkbox label .ripple { .checkbox label .ripple {
display: block; display: block;
@ -3071,12 +3066,10 @@ body .jumbotron-material-lightgrey,
margin: 0; margin: 0;
} }
.checkbox label input[type=checkbox]:not(:checked) ~ .ripple { .checkbox label input[type=checkbox]:not(:checked) ~ .ripple {
-webkit-animation: rippleOff 500ms; animation: rippleOff 500ms;
animation: rippleOff 500ms;
} }
.checkbox label input[type=checkbox]:checked ~ .ripple { .checkbox label input[type=checkbox]:checked ~ .ripple {
-webkit-animation: rippleOn 500ms; animation: rippleOn 500ms;
animation: rippleOn 500ms;
} }
.checkbox label .check { .checkbox label .check {
display: inline-block; display: inline-block;
@ -3107,9 +3100,7 @@ body .jumbotron-material-lightgrey,
.checkbox label .check:before { .checkbox label .check:before {
position: absolute; position: absolute;
content: ""; content: "";
-webkit-transform: rotate(45deg); transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
display: block; display: block;
margin-top: -4px; margin-top: -4px;
margin-left: 6px; margin-left: 6px;
@ -3122,8 +3113,7 @@ body .jumbotron-material-lightgrey,
0 0 0 0, 0 0 0 0,
0 0 0 0, 0 0 0 0,
0px 0px 0 0px inset; 0px 0px 0 0px inset;
-webkit-animation: checkbox-off 0.3s linear forwards; animation: checkbox-off 0.3s linear forwards;
animation: checkbox-off 0.3s linear forwards;
} }
.checkbox input[type=checkbox] { .checkbox input[type=checkbox] {
opacity: 0; opacity: 0;
@ -3133,21 +3123,17 @@ body .jumbotron-material-lightgrey,
} }
.checkbox input[type=checkbox]:checked ~ .check:before { .checkbox input[type=checkbox]:checked ~ .check:before {
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; 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;
-webkit-animation: checkbox-on 0.3s linear forwards; animation: checkbox-on 0.3s linear forwards;
animation: checkbox-on 0.3s linear forwards;
} }
.checkbox input[type=checkbox]:not(:checked) ~ .check:after { .checkbox input[type=checkbox]:not(:checked) ~ .check:after {
-webkit-animation: rippleOff 500ms linear forwards; animation: rippleOff 500ms linear forwards;
animation: rippleOff 500ms linear forwards;
} }
.checkbox input[type=checkbox]:checked ~ .check:after { .checkbox input[type=checkbox]:checked ~ .check:after {
-webkit-animation: rippleOn 500ms linear forwards; animation: rippleOn 500ms linear forwards;
animation: rippleOn 500ms linear forwards;
} }
.checkbox:not(:hover) input[type=checkbox] ~ .check:before, .checkbox:not(:hover) input[type=checkbox] ~ .check:before,
.checkbox:not(:hover) input[type=checkbox] ~ .check:after { .checkbox:not(:hover) input[type=checkbox] ~ .check:after {
-webkit-animation-duration: 1ms; animation-duration: 1ms;
animation-duration: 1ms;
} }
.checkbox input[type=checkbox][disabled]:not(:checked) ~ .check:before, .checkbox input[type=checkbox][disabled]:not(:checked) ~ .check:before,
.checkbox input[type=checkbox][disabled] ~ .circle { .checkbox input[type=checkbox][disabled] ~ .circle {
@ -3155,9 +3141,7 @@ body .jumbotron-material-lightgrey,
} }
.checkbox input[type=checkbox][disabled] ~ .check:after { .checkbox input[type=checkbox][disabled] ~ .check:after {
background-color: rgba(0, 0, 0, 0.84); background-color: rgba(0, 0, 0, 0.84);
-webkit-transform: rotate(-45deg); transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
transform: rotate(-45deg);
} }
.checkbox input[type=checkbox]:checked ~ .check:after, .checkbox input[type=checkbox]:checked ~ .check:after,
.checkbox-default input[type=checkbox]:checked ~ .check:after { .checkbox-default input[type=checkbox]:checked ~ .check:after {
@ -3369,17 +3353,6 @@ body .jumbotron-material-lightgrey,
.checkbox-material-lightgrey input[type=checkbox]:checked ~ .check { .checkbox-material-lightgrey input[type=checkbox]:checked ~ .check {
color: #ececec; color: #ececec;
} }
@-webkit-keyframes checkbox-on {
0% {
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;
}
50% {
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;
}
100% {
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;
}
}
@keyframes checkbox-on { @keyframes checkbox-on {
0% { 0% {
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; 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;
@ -3391,53 +3364,6 @@ body .jumbotron-material-lightgrey,
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; 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;
} }
} }
@-webkit-keyframes checkbox-off {
0% {
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;
}
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;
}
50% {
-webkit-transform: rotate(45deg);
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;
}
51% {
-webkit-transform: rotate(0deg);
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;
}
100% {
-webkit-transform: rotate(0deg);
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;
}
}
@keyframes checkbox-off { @keyframes checkbox-off {
0% { 0% {
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; 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;
@ -3446,8 +3372,7 @@ body .jumbotron-material-lightgrey,
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; 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;
} }
50% { 50% {
-webkit-transform: rotate(45deg); transform: rotate(45deg);
transform: rotate(45deg);
margin-top: -4px; margin-top: -4px;
margin-left: 6px; margin-left: 6px;
width: 0px; width: 0px;
@ -3455,8 +3380,7 @@ body .jumbotron-material-lightgrey,
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; 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;
} }
51% { 51% {
-webkit-transform: rotate(0deg); transform: rotate(0deg);
transform: rotate(0deg);
margin-top: -2px; margin-top: -2px;
margin-left: -2px; margin-left: -2px;
width: 20px; width: 20px;
@ -3470,8 +3394,7 @@ body .jumbotron-material-lightgrey,
0px 0px 0 10px inset; 0px 0px 0 10px inset;
} }
100% { 100% {
-webkit-transform: rotate(0deg); transform: rotate(0deg);
transform: rotate(0deg);
margin-top: -2px; margin-top: -2px;
margin-left: -2px; margin-left: -2px;
width: 20px; width: 20px;
@ -3485,17 +3408,6 @@ body .jumbotron-material-lightgrey,
0px 0px 0 0px inset; 0px 0px 0 0px inset;
} }
} }
@-webkit-keyframes rippleOn {
0% {
opacity: 0;
}
50% {
opacity: 0.2;
}
100% {
opacity: 0;
}
}
@keyframes rippleOn { @keyframes rippleOn {
0% { 0% {
opacity: 0; opacity: 0;
@ -3507,17 +3419,6 @@ body .jumbotron-material-lightgrey,
opacity: 0; opacity: 0;
} }
} }
@-webkit-keyframes rippleOff {
0% {
opacity: 0;
}
50% {
opacity: 0.2;
}
100% {
opacity: 0;
}
}
@keyframes rippleOff { @keyframes rippleOff {
0% { 0% {
opacity: 0; opacity: 0;
@ -3542,8 +3443,7 @@ body .jumbotron-material-lightgrey,
position: absolute; position: absolute;
left: 10px; left: 10px;
top: 2px; top: 2px;
-webkit-transition-duration: 0.2s; transition-duration: 0.2s;
transition-duration: 0.2s;
} }
.radio label .circle { .radio label .circle {
border: 2px solid rgba(0, 0, 0, 0.84); border: 2px solid rgba(0, 0, 0, 0.84);
@ -3556,9 +3456,7 @@ body .jumbotron-material-lightgrey,
width: 15px; width: 15px;
border-radius: 100%; border-radius: 100%;
background-color: rgba(0, 0, 0, 0.84); background-color: rgba(0, 0, 0, 0.84);
-webkit-transform: scale(0); transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
} }
.radio label .check:after { .radio label .check:after {
display: block; display: block;
@ -3573,17 +3471,13 @@ body .jumbotron-material-lightgrey,
z-index: 1; z-index: 1;
opacity: 0; opacity: 0;
margin: 0; margin: 0;
-webkit-transform: scale(1.5); transform: scale(1.5);
-ms-transform: scale(1.5);
transform: scale(1.5);
} }
.radio label input[type=radio]:not(:checked) ~ .check:after { .radio label input[type=radio]:not(:checked) ~ .check:after {
-webkit-animation: rippleOff 500ms; animation: rippleOff 500ms;
animation: rippleOff 500ms;
} }
.radio label input[type=radio]:checked ~ .check:after { .radio label input[type=radio]:checked ~ .check:after {
-webkit-animation: rippleOn 500ms; animation: rippleOn 500ms;
animation: rippleOn 500ms;
} }
.radio input[type=radio]:checked ~ .check, .radio input[type=radio]:checked ~ .check,
.radio-default input[type=radio]:checked ~ .check { .radio-default input[type=radio]:checked ~ .check {
@ -3733,9 +3627,7 @@ body .jumbotron-material-lightgrey,
display: none; display: none;
} }
.radio input[type=radio]:checked ~ .check { .radio input[type=radio]:checked ~ .check {
-webkit-transform: scale(0.55); transform: scale(0.55);
-ms-transform: scale(0.55);
transform: scale(0.55);
} }
.radio input[type=radio][disabled] ~ .circle { .radio input[type=radio][disabled] ~ .circle {
border-color: rgba(0, 0, 0, 0.84); border-color: rgba(0, 0, 0, 0.84);
@ -3814,7 +3706,6 @@ select[multiple].form-control.focus {
} }
.form-control-wrapper { .form-control-wrapper {
position: relative; position: relative;
/* active state */
} }
.form-control-wrapper .form-control:focus, .form-control-wrapper .form-control:focus,
.form-control-wrapper .form-control.focus { .form-control-wrapper .form-control.focus {
@ -3827,8 +3718,7 @@ select[multiple].form-control.focus {
pointer-events: none; pointer-events: none;
left: 0px; left: 0px;
top: 5px; top: 5px;
-webkit-transition: 0.2s ease all; transition: 0.2s ease all;
transition: 0.2s ease all;
opacity: 0; opacity: 0;
} }
.form-control-wrapper .form-control:not(.empty) ~ .floating-label { .form-control-wrapper .form-control:not(.empty) ~ .floating-label {
@ -3861,19 +3751,13 @@ select[multiple].form-control.focus {
height: 2px; height: 2px;
background-color: #4285f4; background-color: #4285f4;
bottom: -1px; bottom: -1px;
-webkit-transform: scaleX(0); transform: scaleX(0);
-ms-transform: scaleX(0); transition: transform 0s;
transform: scaleX(0);
-webkit-transition: -webkit-transform 0s;
transition: transform 0s;
} }
.form-control-wrapper .form-control:focus ~ .material-input:before, .form-control-wrapper .form-control:focus ~ .material-input:before,
.form-control-wrapper .form-control.focus ~ .material-input:before { .form-control-wrapper .form-control.focus ~ .material-input:before {
-webkit-transform: scaleX(1); transform: scaleX(1);
-ms-transform: scaleX(1); transition: transform 0.2s ease-out;
transform: scaleX(1);
-webkit-transition: -webkit-transform 0.2s ease-out;
transition: transform 0.2s ease-out;
} }
.form-control-wrapper .material-input:after { .form-control-wrapper .material-input:after {
content: ""; content: "";
@ -3885,9 +3769,7 @@ select[multiple].form-control.focus {
left: 0; left: 0;
pointer-events: none; pointer-events: none;
opacity: 0.9; opacity: 0.9;
-webkit-transform-origin: left; transform-origin: left;
-ms-transform-origin: left;
transform-origin: left;
} }
.form-control-wrapper .input-lg ~ .material-input:after { .form-control-wrapper .input-lg ~ .material-input:after {
height: 26px; height: 26px;
@ -3900,12 +3782,19 @@ select[multiple].form-control.focus {
} }
.form-control-wrapper .form-control:focus ~ .material-input:after, .form-control-wrapper .form-control:focus ~ .material-input:after,
.form-control-wrapper .form-control.focus ~ .material-input:after { .form-control-wrapper .form-control.focus ~ .material-input:after {
-webkit-animation: input-highlight 0.3s ease; animation: input-highlight 0.3s ease;
animation: input-highlight 0.3s ease; animation-fill-mode: forwards;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
opacity: 0; opacity: 0;
} }
.form-control-wrapper .hint {
position: absolute;
font-size: 80%;
display: none;
}
.form-control-wrapper .form-control:focus ~ .hint,
.form-control-wrapper .form-control.focus ~ .hint {
display: block;
}
.form-control-wrapper select ~ .material-input:after { .form-control-wrapper select ~ .material-input:after {
display: none; display: none;
} }
@ -4321,31 +4210,13 @@ select.form-control.focus {
box-shadow: none; box-shadow: none;
border-color: #757575; border-color: #757575;
} }
@-webkit-keyframes input-highlight {
0% {
left: 20%;
-webkit-transform: scaleX(20%);
transform: scaleX(20%);
}
99% {
-webkit-transform: scaleX(0);
transform: scaleX(0);
left: 0;
opacity: 1;
}
100% {
opacity: 0;
}
}
@keyframes input-highlight { @keyframes input-highlight {
0% { 0% {
left: 20%; left: 20%;
-webkit-transform: scaleX(20%); transform: scaleX(20%);
transform: scaleX(20%);
} }
99% { 99% {
-webkit-transform: scaleX(0); transform: scaleX(0);
transform: scaleX(0);
left: 0; left: 0;
opacity: 1; opacity: 1;
} }
@ -5327,21 +5198,15 @@ icon-material-lightgrey {
border-radius: 2px; border-radius: 2px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
height: 0; height: 0;
-webkit-transition: -webkit-transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0 linear 0.2s, padding 0 linear 0.2s, height 0 linear 0.2s; transition: transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0 linear 0.2s, padding 0 linear 0.2s, height 0 linear 0.2s;
transition: transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0 linear 0.2s, padding 0 linear 0.2s, height 0 linear 0.2s; transform: translateY(200%);
-webkit-transform: translateY(200%);
-ms-transform: translateY(200%);
transform: translateY(200%);
} }
.snackbar.snackbar-opened { .snackbar.snackbar-opened {
padding: 14px 15px; padding: 14px 15px;
margin-bottom: 20px; margin-bottom: 20px;
height: auto; height: auto;
-webkit-transition: -webkit-transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0 linear 0.2s, height 0 linear 0.2s; transition: transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0 linear 0.2s, height 0 linear 0.2s;
transition: transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0 linear 0.2s, height 0 linear 0.2s; transform: none;
-webkit-transform: none;
-ms-transform: none;
transform: none;
} }
.snackbar.toast { .snackbar.toast {
border-radius: 200px; border-radius: 200px;
@ -5350,10 +5215,7 @@ icon-material-lightgrey {
.noUi-target * { .noUi-target * {
-webkit-touch-callout: none; -webkit-touch-callout: none;
-ms-touch-action: none; -ms-touch-action: none;
-webkit-user-select: none; user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
box-sizing: border-box; box-sizing: border-box;
} }
.noUi-base { .noUi-base {
@ -5380,8 +5242,7 @@ icon-material-lightgrey {
*z-index: -1; *z-index: -1;
} }
.noUi-state-tap .noUi-origin { .noUi-state-tap .noUi-origin {
-webkit-transition: left 0.3s, top 0.3s; transition: left 0.3s, top 0.3s;
transition: left 0.3s, top 0.3s;
} }
.noUi-state-drag * { .noUi-state-drag * {
cursor: inherit !important; cursor: inherit !important;
@ -5397,8 +5258,7 @@ icon-material-lightgrey {
top: -5px; top: -5px;
cursor: ew-resize; cursor: ew-resize;
border-radius: 100%; border-radius: 100%;
-webkit-transition: all 0.2s ease-out; transition: all 0.2s ease-out;
transition: all 0.2s ease-out;
border: 1px solid; border: 1px solid;
} }
.noUi-vertical .noUi-handle { .noUi-vertical .noUi-handle {
@ -5442,9 +5302,7 @@ icon-material-lightgrey {
display: inline-block; display: inline-block;
} }
.noUi-handle.noUi-active { .noUi-handle.noUi-active {
-webkit-transform: scale(2.5); transform: scale(2.5);
-ms-transform: scale(2.5);
transform: scale(2.5);
} }
[disabled].noUi-slider { [disabled].noUi-slider {
opacity: 0.5; opacity: 0.5;

File diff suppressed because one or more lines are too long

10
dist/css/material.css vendored
View File

@ -3699,7 +3699,6 @@ select[multiple].form-control.focus {
} }
.form-control-wrapper { .form-control-wrapper {
position: relative; position: relative;
/* active state */
} }
.form-control-wrapper .form-control:focus, .form-control-wrapper .form-control:focus,
.form-control-wrapper .form-control.focus { .form-control-wrapper .form-control.focus {
@ -3780,6 +3779,15 @@ select[multiple].form-control.focus {
animation-fill-mode: forwards; animation-fill-mode: forwards;
opacity: 0; opacity: 0;
} }
.form-control-wrapper .hint {
position: absolute;
font-size: 80%;
display: none;
}
.form-control-wrapper .form-control:focus ~ .hint,
.form-control-wrapper .form-control.focus ~ .hint {
display: block;
}
.form-control-wrapper select ~ .material-input:after { .form-control-wrapper select ~ .material-input:after {
display: none; display: none;
} }

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
!function(a){function b(a){return"undefined"==typeof a.which?!0:"number"==typeof a.which&&a.which>0?!a.ctrlKey&&!a.metaKey&&!a.altKey&&8!=a.which:!1}a.expr[":"].notmdproc=function(b){return a(b).data("mdproc")?!1:!0},a.material={options:{withRipples:[".btn:not(.btn-link)",".card-image",".navbar a:not(.withoutripple)",".dropdown-menu a",".nav-tabs a:not(.withoutripple)",".withripple"].join(","),inputElements:"input.form-control, textarea.form-control, select.form-control",checkboxElements:".checkbox > label > input[type=checkbox]",radioElements:".radio > label > input[type=radio]"},checkbox:function(b){a(b?b:this.options.checkboxElements).filter(":notmdproc").data("mdproc",!0).after("<span class=ripple></span><span class=check></span>")},radio:function(b){a(b?b:this.options.radioElements).filter(":notmdproc").data("mdproc",!0).after("<span class=circle></span><span class=check></span>")},input:function(c){a(c?c:this.options.inputElements).filter(":notmdproc").data("mdproc",!0).each(function(){var b=a(this);if(b.wrap("<div class=form-control-wrapper></div>"),b.after("<span class=material-input></span>"),b.hasClass("floating-label")){var c=b.attr("placeholder");b.attr("placeholder",null).removeClass("floating-label"),b.after("<div class=floating-label>"+c+"</div>")}if((null===b.val()||"undefined"==b.val()||""===b.val())&&b.addClass("empty"),b.parent().next().is("[type=file]")){b.parent().addClass("fileinput");var d=b.parent().next().detach();b.after(d)}}),a(document).on("change",".checkbox input[type=checkbox]",function(){a(this).blur()}).on("keydown paste",".form-control",function(c){b(c)&&a(this).removeClass("empty")}).on("keyup change",".form-control",function(){var b=a(this);""===b.val()?b.addClass("empty"):b.removeClass("empty")}).on("focus",".form-control-wrapper.fileinput",function(){a(this).find("input").addClass("focus")}).on("blur",".form-control-wrapper.fileinput",function(){a(this).find("input").removeClass("focus")}).on("change",".form-control-wrapper.fileinput [type=file]",function(){var b="";a.each(a(this)[0].files,function(a,c){console.log(c),b+=c.name+", "}),b=b.substring(0,b.length-2),b?a(this).prev().removeClass("empty"):a(this).prev().addClass("empty"),a(this).prev().val(b)})},ripples:function(a){ripples.init(a?a:this.options.withRipples)},init:function(){this.ripples(),this.input(),this.checkbox(),this.radio(),document.arrive&&document.arrive("input, textarea, select",function(){a.material.init()}),function(){var b=setInterval(function(){a("input").each(function(){a(this).val()!==a(this).attr("value")&&a(this).trigger("change")})},100);setTimeout(function(){clearInterval(b)},1e4);var c;a(document).on("focus","input",function(){var b=a(this).parents("form").find("input");c=setInterval(function(){b.each(function(){a(this).val()!==a(this).attr("value")&&a(this).trigger("change")})},100)}).on("blur","input",function(){clearInterval(c)})}()}}}(jQuery); !function(a){function b(a){return"undefined"==typeof a.which?!0:"number"==typeof a.which&&a.which>0?!a.ctrlKey&&!a.metaKey&&!a.altKey&&8!=a.which:!1}a.expr[":"].notmdproc=function(b){return a(b).data("mdproc")?!1:!0},a.material={options:{withRipples:[".btn:not(.btn-link)",".card-image",".navbar a:not(.withoutripple)",".dropdown-menu a",".nav-tabs a:not(.withoutripple)",".withripple"].join(","),inputElements:"input.form-control, textarea.form-control, select.form-control",checkboxElements:".checkbox > label > input[type=checkbox]",radioElements:".radio > label > input[type=radio]"},checkbox:function(b){a(b?b:this.options.checkboxElements).filter(":notmdproc").data("mdproc",!0).after("<span class=ripple></span><span class=check></span>")},radio:function(b){a(b?b:this.options.radioElements).filter(":notmdproc").data("mdproc",!0).after("<span class=circle></span><span class=check></span>")},input:function(c){a(c?c:this.options.inputElements).filter(":notmdproc").data("mdproc",!0).each(function(){var b=a(this);if(b.wrap("<div class=form-control-wrapper></div>"),b.after("<span class=material-input></span>"),b.hasClass("floating-label")){var c=b.attr("placeholder");b.attr("placeholder",null).removeClass("floating-label"),b.after("<div class=floating-label>"+c+"</div>")}if(b.attr("data-hint")&&b.after("<div class=hint>"+b.attr("data-hint")+"</div>"),(null===b.val()||"undefined"==b.val()||""===b.val())&&b.addClass("empty"),b.parent().next().is("[type=file]")){b.parent().addClass("fileinput");var d=b.parent().next().detach();b.after(d)}}),a(document).on("change",".checkbox input[type=checkbox]",function(){a(this).blur()}).on("keydown paste",".form-control",function(c){b(c)&&a(this).removeClass("empty")}).on("keyup change",".form-control",function(){var b=a(this);""===b.val()?b.addClass("empty"):b.removeClass("empty")}).on("focus",".form-control-wrapper.fileinput",function(){a(this).find("input").addClass("focus")}).on("blur",".form-control-wrapper.fileinput",function(){a(this).find("input").removeClass("focus")}).on("change",".form-control-wrapper.fileinput [type=file]",function(){var b="";a.each(a(this)[0].files,function(a,c){console.log(c),b+=c.name+", "}),b=b.substring(0,b.length-2),b?a(this).prev().removeClass("empty"):a(this).prev().addClass("empty"),a(this).prev().val(b)})},ripples:function(a){ripples.init(a?a:this.options.withRipples)},init:function(){this.ripples(),this.input(),this.checkbox(),this.radio(),document.arrive&&document.arrive("input, textarea, select",function(){a.material.init()}),function(){var b=setInterval(function(){a("input").each(function(){a(this).val()!==a(this).attr("value")&&a(this).trigger("change")})},100);setTimeout(function(){clearInterval(b)},1e4);var c;a(document).on("focus","input",function(){var b=a(this).parents("form").find("input");c=setInterval(function(){b.each(function(){a(this).val()!==a(this).attr("value")&&a(this).trigger("change")})},100)}).on("blur","input",function(){clearInterval(c)})}()}}}(jQuery);

View File

@ -1520,6 +1520,10 @@
<input class="form-control floating-label" id="focusedInput" type="text" placeholder="Write something to make the label float"> <input class="form-control floating-label" id="focusedInput" type="text" placeholder="Write something to make the label float">
</div> </div>
<div class="form-group">
<input class="form-control floating-label" id="focusedInput" type="text" placeholder="Focus to show the hint" data-hint="You should really write something here">
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label" for="disabledInput">Disabled input</label> <label class="control-label" for="disabledInput">Disabled input</label>
<input class="form-control" id="disabledInput" type="text" placeholder="Disabled input here..." disabled=""> <input class="form-control" id="disabledInput" type="text" placeholder="Disabled input here..." disabled="">

View File

@ -95,13 +95,23 @@ select[multiple].form-control {
margin-top: -11px; margin-top: -11px;
} }
/* active state */ // active state
.form-control:focus ~ .material-input:after, .form-control.focus ~ .material-input:after { .form-control:focus ~ .material-input:after, .form-control.focus ~ .material-input:after {
animation: input-highlight 0.3s ease; animation: input-highlight 0.3s ease;
animation-fill-mode: forwards; animation-fill-mode: forwards;
opacity: 0; opacity: 0;
} }
// Hints
.hint {
position: absolute;
font-size: 80%;
display: none;
}
.form-control:focus ~ .hint, .form-control.focus ~ .hint {
display: block;
}
select ~ .material-input:after { select ~ .material-input:after {
display: none; display: none;
} }

View File

@ -55,14 +55,25 @@
var $this = $(this); var $this = $(this);
$this.wrap("<div class=form-control-wrapper></div>"); $this.wrap("<div class=form-control-wrapper></div>");
$this.after("<span class=material-input></span>"); $this.after("<span class=material-input></span>");
// Add floating label if required
if ($this.hasClass("floating-label")) { if ($this.hasClass("floating-label")) {
var placeholder = $this.attr("placeholder"); var placeholder = $this.attr("placeholder");
$this.attr("placeholder", null).removeClass("floating-label"); $this.attr("placeholder", null).removeClass("floating-label");
$this.after("<div class=floating-label>" + placeholder + "</div>"); $this.after("<div class=floating-label>" + placeholder + "</div>");
} }
// Add hint label if required
if ($this.attr("data-hint")) {
$this.after("<div class=hint>" + $this.attr("data-hint") + "</div>");
}
// Set as empty if is empty (damn I must improve this...)
if ($this.val() === null || $this.val() == "undefined" || $this.val() === "") { if ($this.val() === null || $this.val() == "undefined" || $this.val() === "") {
$this.addClass("empty"); $this.addClass("empty");
} }
// Support for file input
if ($this.parent().next().is("[type=file]")) { if ($this.parent().next().is("[type=file]")) {
$this.parent().addClass("fileinput"); $this.parent().addClass("fileinput");
var $input = $this.parent().next().detach(); var $input = $this.parent().next().detach();