Merge upstream/develop into card

This commit is contained in:
Phuc Nguyen 2014-10-13 18:01:22 +07:00
commit 140347a464
18 changed files with 1117 additions and 801 deletions

View File

@ -1902,15 +1902,17 @@ body .jumbotron-material-lightgrey,
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
outline: none !important;
}
.btn:hover {
color: rgba(255, 255, 255, 0.84);
}
.btn:hover:not(.btn-link) {
.btn:hover:not(.btn-link):not(.btn-flat) {
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2), 0 3px 6px rgba(0, 0, 0, 0.28);
}
.btn:active:not(.btn-link) {
.btn:active:not(.btn-link):not(.btn-flat) {
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
}
.btn:disabled:not(.btn-link):not(.btn-flat) {
color: #a8a8a8 !important;
background-color: #eaeaea !important;
box-shadow: none;
}
.btn:not(.btn-link),
.btn-default:not(.btn-link) {
background-color: transparent;
@ -1981,6 +1983,156 @@ body .jumbotron-material-lightgrey,
.btn-material-lightgrey:not(.btn-link) {
background-color: #ececec;
}
.btn.btn-flat {
background: none;
box-shadow: none;
font-weight: 500;
}
.btn.btn-flat:disabled {
color: #a8a8a8 !important;
}
.btn.btn-flat.btn-primary {
color: #4285f4;
}
.btn.btn-flat.btn-success {
color: #0f9d58;
}
.btn.btn-flat.btn-info {
color: #03a9f4;
}
.btn.btn-flat.btn-warning {
color: #ff5722;
}
.btn.btn-flat.btn-danger {
color: #f44336;
}
.btn.btn-raised {
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);
}
.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);
}
.btn.btn-fab {
margin: 0;
padding: 15px;
font-size: 26px;
width: 56px;
height: 56px;
}
.btn.btn-fab,
.btn.btn-fab:hover {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}
.btn.btn-fab,
.btn.btn-fab:hover,
.btn.btn-fab-default,
.btn.btn-fab:hover-default {
background-color: transparent;
}
.btn.btn-fab-primary,
.btn.btn-fab:hover-primary {
background-color: #4285f4;
}
.btn.btn-fab-success,
.btn.btn-fab:hover-success {
background-color: #0f9d58;
}
.btn.btn-fab-info,
.btn.btn-fab:hover-info {
background-color: #03a9f4;
}
.btn.btn-fab-warning,
.btn.btn-fab:hover-warning {
background-color: #ff5722;
}
.btn.btn-fab-danger,
.btn.btn-fab:hover-danger {
background-color: #f44336;
}
.btn.btn-fab-material-red,
.btn.btn-fab:hover-material-red {
background-color: #f44336;
}
.btn.btn-fab-material-pink,
.btn.btn-fab:hover-material-pink {
background-color: #e91e63;
}
.btn.btn-fab-material-purple,
.btn.btn-fab:hover-material-purple {
background-color: #9c27b0;
}
.btn.btn-fab-material-deeppurple,
.btn.btn-fab:hover-material-deeppurple {
background-color: #673ab7;
}
.btn.btn-fab-material-indigo,
.btn.btn-fab:hover-material-indigo {
background-color: #3f51b5;
}
.btn.btn-fab-material-lightblue,
.btn.btn-fab:hover-material-lightblue {
background-color: #03a9f4;
}
.btn.btn-fab-material-cyan,
.btn.btn-fab:hover-material-cyan {
background-color: #00bcd4;
}
.btn.btn-fab-material-teal,
.btn.btn-fab:hover-material-teal {
background-color: #009688;
}
.btn.btn-fab-material-lightgreen,
.btn.btn-fab:hover-material-lightgreen {
background-color: #8bc34a;
}
.btn.btn-fab-material-lime,
.btn.btn-fab:hover-material-lime {
background-color: #cddc39;
}
.btn.btn-fab-material-lightyellow,
.btn.btn-fab:hover-material-lightyellow {
background-color: #ffeb3b;
}
.btn.btn-fab-material-orange,
.btn.btn-fab:hover-material-orange {
background-color: #ff9800;
}
.btn.btn-fab-material-deeporange,
.btn.btn-fab:hover-material-deeporange {
background-color: #ff5722;
}
.btn.btn-fab-material-grey,
.btn.btn-fab:hover-material-grey {
background-color: #9e9e9e;
}
.btn.btn-fab-material-bluegrey,
.btn.btn-fab:hover-material-bluegrey {
background-color: #607d8b;
}
.btn.btn-fab-material-brown,
.btn.btn-fab:hover-material-brown {
background-color: #795548;
}
.btn.btn-fab-material-lightgrey,
.btn.btn-fab:hover-material-lightgrey {
background-color: #ececec;
}
.btn.btn-fab,
.btn.btn-fab .ripple-wrapper {
border-radius: 100%;
}
.btn.btn-fab.btn-fab-mini {
width: 40px;
height: 40px;
padding: 13px;
font-size: 15px;
}
.btn.btn-fab i {
position: relative;
top: -5px;
}
.btn-link,
.btn:not([class^="btn btn-"]),
.btn-default {
@ -1995,14 +2147,6 @@ body .jumbotron-material-lightgrey,
.btn-default:hover {
background-color: rgba(255, 255, 255, 0.5);
}
.btn-raised {
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);
}
.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);
}
.open > .dropdown-toggle.btn,
.open > .dropdown-toggle.btn-default {
background-color: transparent;
@ -2073,12 +2217,6 @@ body .jumbotron-material-lightgrey,
.open > .dropdown-toggle.btn-material-lightgrey {
background-color: #ececec;
}
.btn-flat {
box-shadow: none !important;
}
.btn-flat.btn-default:hover {
background: none;
}
.btn-group,
.btn-group-vertical {
position: relative;
@ -2122,121 +2260,6 @@ body .jumbotron-material-lightgrey,
.btn-group-flat {
box-shadow: none !important;
}
.btn-fab {
margin: 0;
padding: 15px;
font-size: 26px;
width: 56px;
height: 56px;
}
.btn-fab,
.btn-fab:hover {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}
.btn-fab,
.btn-fab:hover,
.btn-fab-default,
.btn-fab:hover-default {
background-color: transparent;
}
.btn-fab-primary,
.btn-fab:hover-primary {
background-color: #4285f4;
}
.btn-fab-success,
.btn-fab:hover-success {
background-color: #0f9d58;
}
.btn-fab-info,
.btn-fab:hover-info {
background-color: #03a9f4;
}
.btn-fab-warning,
.btn-fab:hover-warning {
background-color: #ff5722;
}
.btn-fab-danger,
.btn-fab:hover-danger {
background-color: #f44336;
}
.btn-fab-material-red,
.btn-fab:hover-material-red {
background-color: #f44336;
}
.btn-fab-material-pink,
.btn-fab:hover-material-pink {
background-color: #e91e63;
}
.btn-fab-material-purple,
.btn-fab:hover-material-purple {
background-color: #9c27b0;
}
.btn-fab-material-deeppurple,
.btn-fab:hover-material-deeppurple {
background-color: #673ab7;
}
.btn-fab-material-indigo,
.btn-fab:hover-material-indigo {
background-color: #3f51b5;
}
.btn-fab-material-lightblue,
.btn-fab:hover-material-lightblue {
background-color: #03a9f4;
}
.btn-fab-material-cyan,
.btn-fab:hover-material-cyan {
background-color: #00bcd4;
}
.btn-fab-material-teal,
.btn-fab:hover-material-teal {
background-color: #009688;
}
.btn-fab-material-lightgreen,
.btn-fab:hover-material-lightgreen {
background-color: #8bc34a;
}
.btn-fab-material-lime,
.btn-fab:hover-material-lime {
background-color: #cddc39;
}
.btn-fab-material-lightyellow,
.btn-fab:hover-material-lightyellow {
background-color: #ffeb3b;
}
.btn-fab-material-orange,
.btn-fab:hover-material-orange {
background-color: #ff9800;
}
.btn-fab-material-deeporange,
.btn-fab:hover-material-deeporange {
background-color: #ff5722;
}
.btn-fab-material-grey,
.btn-fab:hover-material-grey {
background-color: #9e9e9e;
}
.btn-fab-material-bluegrey,
.btn-fab:hover-material-bluegrey {
background-color: #607d8b;
}
.btn-fab-material-brown,
.btn-fab:hover-material-brown {
background-color: #795548;
}
.btn-fab-material-lightgrey,
.btn-fab:hover-material-lightgrey {
background-color: #ececec;
}
.btn-fab,
.btn-fab .ripple-wrapper {
border-radius: 100%;
}
.btn-fab.btn-mini {
width: 40px;
height: 40px;
padding: 13px;
font-size: 15px;
}
.form-horizontal .checkbox {
padding-top: 20px;
}
@ -3500,20 +3523,6 @@ select.form-control.focus {
legend {
border-bottom: 0;
}
.modal-content {
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
border-radius: 0;
border: 0;
}
.modal-content .modal-header {
border-bottom: 0;
}
.modal-content .modal-footer {
border-top: 0;
}
.modal-content .modal-footer .btn + .btn {
margin-bottom: 10px;
}
.list-group {
border-radius: 0;
}
@ -4249,6 +4258,43 @@ fieldset[disabled] .navbar .btn-link:focus {
.card .card-footer button:first-child {
left: -15px;
}
.modal-content {
box-shadow: 0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22);
margin-top: 10em;
border-radius: 2px;
border: none;
}
.modal-content .modal-header {
border-bottom: none;
padding: 24px;
padding-bottom: 0;
}
.modal-content .modal-body {
padding: 24px;
padding-bottom: 0;
}
.modal-content .modal-footer {
border-top: none;
padding: 24px;
}
.modal-content .modal-footer button {
margin: 0;
padding-left: 16px;
padding-right: 16px;
width: auto;
}
.modal-content .modal-footer button.pull-left {
padding-left: 5px;
padding-right: 5px;
position: relative;
left: -5px;
}
.modal-content .modal-footer button + button {
margin-bottom: 16px;
}
.modal-backdrop {
display: none;
}
.snackbar {
background-color: #323232;
color: rgba(255, 255, 255, 0.84);

File diff suppressed because one or more lines are too long

342
dist/css/material.css vendored
View File

@ -1901,15 +1901,17 @@ body .jumbotron-material-lightgrey,
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
outline: none !important;
}
.btn:hover {
color: rgba(255, 255, 255, 0.84);
}
.btn:hover:not(.btn-link) {
.btn:hover:not(.btn-link):not(.btn-flat) {
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2), 0 3px 6px rgba(0, 0, 0, 0.28);
}
.btn:active:not(.btn-link) {
.btn:active:not(.btn-link):not(.btn-flat) {
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
}
.btn:disabled:not(.btn-link):not(.btn-flat) {
color: #a8a8a8 !important;
background-color: #eaeaea !important;
box-shadow: none;
}
.btn:not(.btn-link),
.btn-default:not(.btn-link) {
background-color: transparent;
@ -1980,6 +1982,156 @@ body .jumbotron-material-lightgrey,
.btn-material-lightgrey:not(.btn-link) {
background-color: #ececec;
}
.btn.btn-flat {
background: none;
box-shadow: none;
font-weight: 500;
}
.btn.btn-flat:disabled {
color: #a8a8a8 !important;
}
.btn.btn-flat.btn-primary {
color: #4285f4;
}
.btn.btn-flat.btn-success {
color: #0f9d58;
}
.btn.btn-flat.btn-info {
color: #03a9f4;
}
.btn.btn-flat.btn-warning {
color: #ff5722;
}
.btn.btn-flat.btn-danger {
color: #f44336;
}
.btn.btn-raised {
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);
}
.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);
}
.btn.btn-fab {
margin: 0;
padding: 15px;
font-size: 26px;
width: 56px;
height: 56px;
}
.btn.btn-fab,
.btn.btn-fab:hover {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}
.btn.btn-fab,
.btn.btn-fab:hover,
.btn.btn-fab-default,
.btn.btn-fab:hover-default {
background-color: transparent;
}
.btn.btn-fab-primary,
.btn.btn-fab:hover-primary {
background-color: #4285f4;
}
.btn.btn-fab-success,
.btn.btn-fab:hover-success {
background-color: #0f9d58;
}
.btn.btn-fab-info,
.btn.btn-fab:hover-info {
background-color: #03a9f4;
}
.btn.btn-fab-warning,
.btn.btn-fab:hover-warning {
background-color: #ff5722;
}
.btn.btn-fab-danger,
.btn.btn-fab:hover-danger {
background-color: #f44336;
}
.btn.btn-fab-material-red,
.btn.btn-fab:hover-material-red {
background-color: #f44336;
}
.btn.btn-fab-material-pink,
.btn.btn-fab:hover-material-pink {
background-color: #e91e63;
}
.btn.btn-fab-material-purple,
.btn.btn-fab:hover-material-purple {
background-color: #9c27b0;
}
.btn.btn-fab-material-deeppurple,
.btn.btn-fab:hover-material-deeppurple {
background-color: #673ab7;
}
.btn.btn-fab-material-indigo,
.btn.btn-fab:hover-material-indigo {
background-color: #3f51b5;
}
.btn.btn-fab-material-lightblue,
.btn.btn-fab:hover-material-lightblue {
background-color: #03a9f4;
}
.btn.btn-fab-material-cyan,
.btn.btn-fab:hover-material-cyan {
background-color: #00bcd4;
}
.btn.btn-fab-material-teal,
.btn.btn-fab:hover-material-teal {
background-color: #009688;
}
.btn.btn-fab-material-lightgreen,
.btn.btn-fab:hover-material-lightgreen {
background-color: #8bc34a;
}
.btn.btn-fab-material-lime,
.btn.btn-fab:hover-material-lime {
background-color: #cddc39;
}
.btn.btn-fab-material-lightyellow,
.btn.btn-fab:hover-material-lightyellow {
background-color: #ffeb3b;
}
.btn.btn-fab-material-orange,
.btn.btn-fab:hover-material-orange {
background-color: #ff9800;
}
.btn.btn-fab-material-deeporange,
.btn.btn-fab:hover-material-deeporange {
background-color: #ff5722;
}
.btn.btn-fab-material-grey,
.btn.btn-fab:hover-material-grey {
background-color: #9e9e9e;
}
.btn.btn-fab-material-bluegrey,
.btn.btn-fab:hover-material-bluegrey {
background-color: #607d8b;
}
.btn.btn-fab-material-brown,
.btn.btn-fab:hover-material-brown {
background-color: #795548;
}
.btn.btn-fab-material-lightgrey,
.btn.btn-fab:hover-material-lightgrey {
background-color: #ececec;
}
.btn.btn-fab,
.btn.btn-fab .ripple-wrapper {
border-radius: 100%;
}
.btn.btn-fab.btn-fab-mini {
width: 40px;
height: 40px;
padding: 13px;
font-size: 15px;
}
.btn.btn-fab i {
position: relative;
top: -5px;
}
.btn-link,
.btn:not([class^="btn btn-"]),
.btn-default {
@ -1994,14 +2146,6 @@ body .jumbotron-material-lightgrey,
.btn-default:hover {
background-color: rgba(255, 255, 255, 0.5);
}
.btn-raised {
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);
}
.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);
}
.open > .dropdown-toggle.btn,
.open > .dropdown-toggle.btn-default {
background-color: transparent;
@ -2072,12 +2216,6 @@ body .jumbotron-material-lightgrey,
.open > .dropdown-toggle.btn-material-lightgrey {
background-color: #ececec;
}
.btn-flat {
box-shadow: none !important;
}
.btn-flat.btn-default:hover {
background: none;
}
.btn-group,
.btn-group-vertical {
position: relative;
@ -2121,121 +2259,6 @@ body .jumbotron-material-lightgrey,
.btn-group-flat {
box-shadow: none !important;
}
.btn-fab {
margin: 0;
padding: 15px;
font-size: 26px;
width: 56px;
height: 56px;
}
.btn-fab,
.btn-fab:hover {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}
.btn-fab,
.btn-fab:hover,
.btn-fab-default,
.btn-fab:hover-default {
background-color: transparent;
}
.btn-fab-primary,
.btn-fab:hover-primary {
background-color: #4285f4;
}
.btn-fab-success,
.btn-fab:hover-success {
background-color: #0f9d58;
}
.btn-fab-info,
.btn-fab:hover-info {
background-color: #03a9f4;
}
.btn-fab-warning,
.btn-fab:hover-warning {
background-color: #ff5722;
}
.btn-fab-danger,
.btn-fab:hover-danger {
background-color: #f44336;
}
.btn-fab-material-red,
.btn-fab:hover-material-red {
background-color: #f44336;
}
.btn-fab-material-pink,
.btn-fab:hover-material-pink {
background-color: #e91e63;
}
.btn-fab-material-purple,
.btn-fab:hover-material-purple {
background-color: #9c27b0;
}
.btn-fab-material-deeppurple,
.btn-fab:hover-material-deeppurple {
background-color: #673ab7;
}
.btn-fab-material-indigo,
.btn-fab:hover-material-indigo {
background-color: #3f51b5;
}
.btn-fab-material-lightblue,
.btn-fab:hover-material-lightblue {
background-color: #03a9f4;
}
.btn-fab-material-cyan,
.btn-fab:hover-material-cyan {
background-color: #00bcd4;
}
.btn-fab-material-teal,
.btn-fab:hover-material-teal {
background-color: #009688;
}
.btn-fab-material-lightgreen,
.btn-fab:hover-material-lightgreen {
background-color: #8bc34a;
}
.btn-fab-material-lime,
.btn-fab:hover-material-lime {
background-color: #cddc39;
}
.btn-fab-material-lightyellow,
.btn-fab:hover-material-lightyellow {
background-color: #ffeb3b;
}
.btn-fab-material-orange,
.btn-fab:hover-material-orange {
background-color: #ff9800;
}
.btn-fab-material-deeporange,
.btn-fab:hover-material-deeporange {
background-color: #ff5722;
}
.btn-fab-material-grey,
.btn-fab:hover-material-grey {
background-color: #9e9e9e;
}
.btn-fab-material-bluegrey,
.btn-fab:hover-material-bluegrey {
background-color: #607d8b;
}
.btn-fab-material-brown,
.btn-fab:hover-material-brown {
background-color: #795548;
}
.btn-fab-material-lightgrey,
.btn-fab:hover-material-lightgrey {
background-color: #ececec;
}
.btn-fab,
.btn-fab .ripple-wrapper {
border-radius: 100%;
}
.btn-fab.btn-mini {
width: 40px;
height: 40px;
padding: 13px;
font-size: 15px;
}
.form-horizontal .checkbox {
padding-top: 20px;
}
@ -3499,20 +3522,6 @@ select.form-control.focus {
legend {
border-bottom: 0;
}
.modal-content {
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
border-radius: 0;
border: 0;
}
.modal-content .modal-header {
border-bottom: 0;
}
.modal-content .modal-footer {
border-top: 0;
}
.modal-content .modal-footer .btn + .btn {
margin-bottom: 10px;
}
.list-group {
border-radius: 0;
}
@ -4248,6 +4257,43 @@ fieldset[disabled] .navbar .btn-link:focus {
.card .card-footer button:first-child {
left: -15px;
}
.modal-content {
box-shadow: 0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22);
margin-top: 10em;
border-radius: 2px;
border: none;
}
.modal-content .modal-header {
border-bottom: none;
padding: 24px;
padding-bottom: 0;
}
.modal-content .modal-body {
padding: 24px;
padding-bottom: 0;
}
.modal-content .modal-footer {
border-top: none;
padding: 24px;
}
.modal-content .modal-footer button {
margin: 0;
padding-left: 16px;
padding-right: 16px;
width: auto;
}
.modal-content .modal-footer button.pull-left {
padding-left: 5px;
padding-right: 5px;
position: relative;
left: -5px;
}
.modal-content .modal-footer button + button {
margin-bottom: 16px;
}
.modal-backdrop {
display: none;
}
.snackbar {
background-color: #323232;
color: rgba(255, 255, 255, 0.84);

File diff suppressed because one or more lines are too long

120
dist/js/ripples.js vendored
View File

@ -1,15 +1,17 @@
/* Copyright 2014+, Federico Zivolo, LICENSE at https://github.com/FezVrasta/bootstrap-material-design/blob/master/LICENSE.md */
/* globals CustomEvent */
/*jshint maxlen: 500 */
window.ripples = {
init : function(withRipple) {
"use strict";
// Cross browser matches function
function matchesSelector(domElement, selector) {
var matches = domElement.matches || domElement.matchesSelector || domElement.webkitMatchesSelector ||
var matches = domElement.matches ||
domElement.matchesSelector ||
domElement.webkitMatchesSelector ||
domElement.mozMatchesSelector ||
domElement.msMatchesSelector || domElement.oMatchesSelector;
domElement.msMatchesSelector ||
domElement.oMatchesSelector;
return matches.call(domElement, selector);
}
@ -18,49 +20,56 @@ window.ripples = {
rippleStartTime = 500;
// Helper to bind events on dynamically created elements
var bind = function(event, selector, callback) {
document.addEventListener(event, function(e) {
var target = (typeof e.detail !== "number") ? e.detail : e.target;
var bind = function(events, selector, callback) {
if (typeof events === "string") {
events = [events];
}
events.forEach(function(event) {
document.addEventListener(event, function(e) {
var target = (typeof e.detail !== "number") ? e.detail : e.target;
if (matchesSelector(target, selector)) {
callback(e, target);
}
if (matchesSelector(target, selector)) {
callback(e, target);
}
});
});
};
var rippleStart = function(e, target) {
var rippleStart = function(e, target, callback) {
// Init variables
var $rippleWrapper = target,
$el = $rippleWrapper.parentNode,
$ripple = document.createElement("div"),
elPos = $el.getBoundingClientRect(),
mousePos = {x: e.clientX - elPos.left, y: e.clientY - elPos.top},
scale = "transform:scale(" + Math.round($rippleWrapper.offsetWidth / 5) + ")",
rippleEnd = new CustomEvent("rippleEnd", {detail: $ripple}),
__rippleOpacity__ = 0.05,
targetColor,
rgbArr,
var $rippleWrapper = target,
$el = $rippleWrapper.parentNode,
$ripple = document.createElement("div"),
elPos = $el.getBoundingClientRect(),
// Mouse pos in most cases
mousePos = {x: e.clientX - elPos.left, y: ((window.ontouchstart) ? e.clientY - window.scrollY: e.clientY) - elPos.top},
scale = "scale(" + Math.round($rippleWrapper.offsetWidth / 5) + ")",
rippleEnd = new CustomEvent("rippleEnd", {detail: $ripple}),
_rippleOpacity = 0.1,
refreshElementStyle;
// If multitouch is detected or some other black magic suff is happening...
if (e.touches) {
mousePos = {x: e.touches[0].clientX - elPos.left, y: e.touches[0].clientY - elPos.top};
}
console.log(mousePos);
$ripplecache = $ripple;
// Set ripple class
$ripple.className = "ripple";
$ripple.className = "ripple";
// Move ripple to the mouse position
$ripple.setAttribute("style", "left:" + mousePos.x + "px; top:" + mousePos.y + "px;");
// Get the clicked targets text color, this will be applied to the ripple as background-color.
targetColor = window.getComputedStyle($el).color;
// This changes the alpha value of the rgba (opacity) to the constant __rippleOpacity__
// Not sure if regexp is quicker...
rgbArr = targetColor.split(",");
rgbArr.pop();
rgbArr.push(" " + __rippleOpacity__ + ")");
targetColor = rgbArr.join(",");
// Get the clicked target's text color, this will be applied to the ripple as background-color.
var targetColor = window.getComputedStyle($el).color;
// Convert the rgb color to an rgba color with opacity set to __rippleOpacity__
targetColor = targetColor.replace("rgb", "rgba").replace(")", ", " + _rippleOpacity + ")");
// Insert new ripple into ripple wrapper
$rippleWrapper.appendChild($ripple);
@ -70,11 +79,22 @@ window.ripples = {
// Let other funtions know that this element is animating
$ripple.dataset.animating = 1;
// + "background-color: " + targetColor + ";"
// Set scale value, background-color and opacity to ripple and animate it
$ripple.className = "ripple ripple-on";
$ripple.setAttribute("style", $ripple.getAttribute("style") + "background-color: " + targetColor + ";" + ["-ms-" + scale,"-moz-" + scale,"-webkit-" + scale,scale].join(";"));
// Prepare the style of the ripple
var rippleStyle = [
$ripple.getAttribute("style"),
"background-color: " + targetColor,
"-ms-transform: " + scale,
"-moz-transform" + scale,
"-webkit-transform" + scale,
"transform: " + scale
];
// Apply the style
$ripple.setAttribute("style", rippleStyle.join(";"));
// This function is called when the animation is finished
setTimeout(function() {
@ -82,6 +102,9 @@ window.ripples = {
// Let know to other functions that this element has finished the animation
$ripple.dataset.animating = 0;
document.dispatchEvent(rippleEnd);
if (callback) {
callback();
}
}, rippleStartTime);
@ -99,39 +122,43 @@ window.ripples = {
// Helper, need to know if mouse is up or down
var mouseDown = false;
document.body.onmousedown = function() {
bind(["mousedown", "touchstart"], "*", function() {
mouseDown = true;
};
document.body.onmouseup = function() {
});
bind(["mouseup", "touchend"], "*", function() {
mouseDown = false;
};
});
// Append ripple wrapper if not exists already
var rippleInit = function(e, target) {
if (target.getElementsByClassName("ripple-wrapper").length === 0) {
target.className += " withripple";
var $rippleWrapper = document.createElement("div");
$rippleWrapper.className = "ripple-wrapper";
target.appendChild($rippleWrapper);
if (window.ontouchstart === null) {
rippleStart(e, $rippleWrapper, function() {
// FIXME: ugly fix for first touchstart event on mobile devices...
$rippleWrapper.getElementsByClassName("ripple")[0].remove();
});
}
}
};
var $ripplecache;
// Events handler
// init RippleJS and start ripple effect on mousedown
bind("mouseover", withRipple, rippleInit);
bind(["mouseover", "touchstart"], withRipple, rippleInit);
// start ripple effect on mousedown
bind("mousedown", ".ripple-wrapper", function(e, $ripple) {
// Start ripple only on left or middle mouse click
if (e.which === 1 || e.which === 2) {
bind(["mousedown", "touchstart"], ".ripple-wrapper", function(e, $ripple) {
// Start ripple only on left or middle mouse click and touch click
if (e.which === 0 || e.which === 1 || e.which === 2) {
rippleStart(e, $ripple);
}
});
// if animation ends and user is not holding mouse then destroy the ripple
bind("rippleEnd", ".ripple-wrapper .ripple", function(e, $ripple) {
@ -141,8 +168,9 @@ window.ripples = {
rippleOut($ripple);
}
});
// Destroy ripple when mouse is not holded anymore if the ripple still exists
bind("mouseup", ".ripple-wrapper", function() {
bind(["mouseup", "touchend"], ".ripple-wrapper", function() {
var $ripple = $ripplecache;
if ($ripple && $ripple.dataset.animating != 1) {
rippleOut($ripple);

View File

@ -1 +1 @@
window.ripples={init:function(a){"use strict";function b(a,b){var c=a.matches||a.matchesSelector||a.webkitMatchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector;return c.call(a,b)}var c=100,d=500,e=function(a,c,d){document.addEventListener(a,function(a){var e="number"!=typeof a.detail?a.detail:a.target;b(e,c)&&d(a,e)})},f=function(a,b){var c,e,f,g=b,h=g.parentNode,j=document.createElement("div"),k=h.getBoundingClientRect(),l={x:a.clientX-k.left,y:a.clientY-k.top},m="transform:scale("+Math.round(g.offsetWidth/5)+")",n=new CustomEvent("rippleEnd",{detail:j}),o=.05;i=j,j.className="ripple",j.setAttribute("style","left:"+l.x+"px; top:"+l.y+"px;"),c=window.getComputedStyle(h).color,e=c.split(","),e.pop(),e.push(" "+o+")"),c=e.join(","),g.appendChild(j),f=window.getComputedStyle(j).opacity,j.dataset.animating=1,j.className="ripple ripple-on",j.setAttribute("style",j.getAttribute("style")+"background-color: "+c+";"+["-ms-"+m,"-moz-"+m,"-webkit-"+m,m].join(";")),setTimeout(function(){j.dataset.animating=0,document.dispatchEvent(n)},d)},g=function(a){a.className="ripple ripple-on ripple-out",setTimeout(function(){a.remove()},c)},h=!1;document.body.onmousedown=function(){h=!0},document.body.onmouseup=function(){h=!1};var i,j=function(a,b){if(0===b.getElementsByClassName("ripple-wrapper").length){b.className+=" withripple";var c=document.createElement("div");c.className="ripple-wrapper",b.appendChild(c)}};e("mouseover",a,j),e("mousedown",".ripple-wrapper",function(a,b){(1===a.which||2===a.which)&&f(a,b)}),e("rippleEnd",".ripple-wrapper .ripple",function(a,b){var c=b.parentNode.getElementsByClassName("ripple");(!h||c[0]==b&&c.length>1)&&g(b)}),e("mouseup",".ripple-wrapper",function(){var a=i;a&&1!=a.dataset.animating&&g(a)})}};
window.ripples={init:function(a){"use strict";function b(a,b){var c=a.matches||a.matchesSelector||a.webkitMatchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector;return c.call(a,b)}var c=100,d=500,e=function(a,c,d){"string"==typeof a&&(a=[a]),a.forEach(function(a){document.addEventListener(a,function(a){var e="number"!=typeof a.detail?a.detail:a.target;b(e,c)&&d(a,e)})})},f=function(a,b,c){var e,f=b,g=f.parentNode,h=document.createElement("div"),j=g.getBoundingClientRect(),k={x:a.clientX-j.left,y:(window.ontouchstart?a.clientY-window.scrollY:a.clientY)-j.top},l="scale("+Math.round(f.offsetWidth/5)+")",m=new CustomEvent("rippleEnd",{detail:h}),n=.1;a.touches&&(k={x:a.touches[0].clientX-j.left,y:a.touches[0].clientY-j.top}),console.log(k),i=h,h.className="ripple",h.setAttribute("style","left:"+k.x+"px; top:"+k.y+"px;");var o=window.getComputedStyle(g).color;o=o.replace("rgb","rgba").replace(")",", "+n+")"),f.appendChild(h),e=window.getComputedStyle(h).opacity,h.dataset.animating=1,h.className="ripple ripple-on";var p=[h.getAttribute("style"),"background-color: "+o,"-ms-transform: "+l,"-moz-transform"+l,"-webkit-transform"+l,"transform: "+l];h.setAttribute("style",p.join(";")),setTimeout(function(){h.dataset.animating=0,document.dispatchEvent(m),c&&c()},d)},g=function(a){a.className="ripple ripple-on ripple-out",setTimeout(function(){a.remove()},c)},h=!1;e(["mousedown","touchstart"],"*",function(){h=!0}),e(["mouseup","touchend"],"*",function(){h=!1});var i,j=function(a,b){if(0===b.getElementsByClassName("ripple-wrapper").length){b.className+=" withripple";var c=document.createElement("div");c.className="ripple-wrapper",b.appendChild(c),null===window.ontouchstart&&f(a,c,function(){c.getElementsByClassName("ripple")[0].remove()})}};e(["mouseover","touchstart"],a,j),e(["mousedown","touchstart"],".ripple-wrapper",function(a,b){(0===a.which||1===a.which||2===a.which)&&f(a,b)}),e("rippleEnd",".ripple-wrapper .ripple",function(a,b){var c=b.parentNode.getElementsByClassName("ripple");(!h||c[0]==b&&c.length>1)&&g(b)}),e(["mouseup","touchend"],".ripple-wrapper",function(){var a=i;a&&1!=a.dataset.animating&&g(a)})}};

View File

@ -8,6 +8,7 @@
<link href="dist/css/ripples.min.css" rel="stylesheet">
<link href="dist/css/material-wfont.min.css" rel="stylesheet">
<link href="//fezvrasta.github.io/snackbarjs/dist/snackbar.min.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body{padding-top:50px}#banner{border-bottom:none}.page-header h1{font-size:4em}.bs-docs-section{margin-top:8em}.bs-component{position:relative}.bs-component .modal{position:relative;top:auto;right:auto;left:auto;bottom:auto;z-index:1;display:block}.bs-component .modal-dialog{width:90%}.bs-component .popover{position:relative;display:inline-block;width:220px;margin:20px}#source-button{position:absolute;top:0;right:0;z-index:100;font-weight:bold;padding: 5px 10px;}.progress{margin-bottom:10px}footer{margin:5em 0}footer li{float:left;margin-right:1.5em;margin-bottom:1.5em}footer p{clear:left;margin-bottom:0}.splash{padding:4em 0 0;background-color:#141d27;color:#fff;text-align:center}.splash h1{font-size:4em}.splash #social{margin:2em 0}.splash .alert{margin:2em 0}.section-tout{padding:4em 0 3em;border-bottom:1px solid rgba(0,0,0,0.05);background-color:#eaf1f1}.section-tout .fa{margin-right:.5em}.section-tout p{margin-bottom:3em}.section-preview{padding:4em 0 4em}.section-preview .preview{margin-bottom:4em;background-color:#eaf1f1}.section-preview .preview .image{position:relative}.section-preview .preview .image:before{box-shadow:inset 0 0 0 1px rgba(0,0,0,0.1);position:absolute;top:0;left:0;width:100%;height:100%;content:"";pointer-events:none}.section-preview .preview .options{padding:1em 2em 2em;border:1px solid rgba(0,0,0,0.05);border-top:none;text-align:center}.section-preview .preview .options p{margin-bottom:2em}.section-preview .dropdown-menu{text-align:left}.section-preview .lead{margin-bottom:2em}@media (max-width:767px){.section-preview .image img{width:100%}}.sponsor{text-align:center}.sponsor a:hover{text-decoration:none}@media (max-width:767px){#banner{margin-bottom:2em;text-align:center}}
.infobox .btn-sup { color: rgba(0,0,0,0.5); font-weight: bold; font-size: 15px; line-height: 30px; }

View File

@ -1,40 +1,87 @@
// main: material.less
.btn-shadow() {
.shadow-z-2();
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
&:active:not(.btn-link) {
.shadow-z-3();
}
}
.btn {
position: relative;
padding: 8px 30px;
border: 0;
margin: 10px 1px;
cursor: pointer;
border-radius: 2px;
text-transform: uppercase;
text-decoration: none;
color: @darkbg-text;
&:hover {
color: @darkbg-text;
}
&:hover:not(.btn-link) {
&:hover:not(.btn-link):not(.btn-flat) {
.shadow-z-2-hover();
}
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
&:active:not(.btn-link) {
}
&:active:not(.btn-link):not(.btn-flat) {
.shadow-z-3();
}
&:disabled:not(.btn-link):not(.btn-flat) {
color: @text-disabled !important;
background-color: @background-disabled !important;
box-shadow: none;
}
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
outline: none !important;
.variations(~":not(.btn-link)", background-color, @btn-default);
&.btn-flat {
background: none;
box-shadow: none;
font-weight: 500;
&:disabled {
color: @text-disabled !important;
}
&.btn-primary {
color: @primary;
}
&.btn-success {
color: @success;
}
&.btn-info {
color: @info;
}
&.btn-warning {
color: @warning;
}
&.btn-danger {
color: @danger;
}
}
&.btn-raised {
.btn-shadow();
}
&.btn-fab {
margin: 0;
padding: 15px;
font-size: 26px;
width: 56px;
height: 56px;
&, &:hover {
.shadow-z-1();
.variations(~"", background-color, transparent);
}
&, .ripple-wrapper {
border-radius: 100%;
}
&.btn-fab-mini {
width: 40px;
height: 40px;
padding: 13px;
font-size: 15px;
}
i {
position: relative;
top: -5px;
}
}
}
// This is needed to style buttons which has not a variation suffix (they must stiled as btn-default)
.btn-link, .btn:not([class^="btn btn-"]), .btn-default {
color: @lightbg-text;
@ -47,21 +94,9 @@
background-color: rgba(255,255,255,0.5);
}
}
.btn-raised {
.btn-shadow();
}
.open > .dropdown-toggle.btn {
.variations(~"", background-color, @btn-default);
}
.btn-flat {
box-shadow: none !important;
&.btn-default:hover {
background: none;
}
}
.btn-group, .btn-group-vertical {
position: relative;
border-radius: 2px;
@ -84,25 +119,10 @@
box-shadow: none !important;
}
// Floating Action Button (FAB)
.btn-fab {
margin: 0;
padding: 15px;
font-size: 26px;
width: 56px;
height: 56px;
&, &:hover {
.shadow-z-1();
.variations(~"", background-color, transparent);
.btn-shadow() {
.shadow-z-2();
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
&:active:not(.btn-link) {
.shadow-z-3();
}
&, .ripple-wrapper {
border-radius: 100%;
}
&.btn-mini {
width: 40px;
height: 40px;
padding: 13px;
font-size: 15px;
}
}
}

38
less/_dialogs.import.less vendored Normal file
View File

@ -0,0 +1,38 @@
.modal-content {
.shadow-z-5();
margin-top: 10em; //XXX TODO Need a better way to vertically position the dialog
border-radius: 2px;
border: none;
.modal-header {
border-bottom: none;
padding: 24px;
padding-bottom: 0;
}
.modal-body {
padding: 24px;
padding-bottom: 0;
}
.modal-footer {
border-top: none;
padding: 24px;
button {
margin: 0;
padding-left: 16px;
padding-right: 16px;
width: auto;
&.pull-left {
padding-left: 5px;
padding-right: 5px;
position: relative;
left: -5px;
}
}
button+button {
margin-bottom: 16px;
}
}
}
.modal-backdrop {
display: none;
}

View File

@ -104,3 +104,6 @@
@card-body-text: @lightbg-text;
@card-body-background: #fff;
@card-image-headline: #fff;
@text-disabled: #a8a8a8;
@background-disabled: #eaeaea;

View File

@ -47,21 +47,6 @@ legend {
border-bottom: 0;
}
.modal-content {
.shadow-z-2();
border-radius: 0;
border: 0;
.modal-header {
border-bottom: 0;
}
.modal-footer {
border-top: 0;
.btn+.btn {
margin-bottom: 10px;
}
}
}
// Lists
@import "_lists.import.less";
@ -114,6 +99,7 @@ legend {
@import "_cards.import.less";
@import "_dialogs.import.less";
// External plugins
@import "_plugin-snackbarjs.import.less";

View File

@ -1,15 +1,17 @@
/* Copyright 2014+, Federico Zivolo, LICENSE at https://github.com/FezVrasta/bootstrap-material-design/blob/master/LICENSE.md */
/* globals CustomEvent */
/*jshint maxlen: 500 */
window.ripples = {
init : function(withRipple) {
"use strict";
// Cross browser matches function
function matchesSelector(domElement, selector) {
var matches = domElement.matches || domElement.matchesSelector || domElement.webkitMatchesSelector ||
var matches = domElement.matches ||
domElement.matchesSelector ||
domElement.webkitMatchesSelector ||
domElement.mozMatchesSelector ||
domElement.msMatchesSelector || domElement.oMatchesSelector;
domElement.msMatchesSelector ||
domElement.oMatchesSelector;
return matches.call(domElement, selector);
}
@ -18,49 +20,56 @@ window.ripples = {
rippleStartTime = 500;
// Helper to bind events on dynamically created elements
var bind = function(event, selector, callback) {
document.addEventListener(event, function(e) {
var target = (typeof e.detail !== "number") ? e.detail : e.target;
var bind = function(events, selector, callback) {
if (typeof events === "string") {
events = [events];
}
events.forEach(function(event) {
document.addEventListener(event, function(e) {
var target = (typeof e.detail !== "number") ? e.detail : e.target;
if (matchesSelector(target, selector)) {
callback(e, target);
}
if (matchesSelector(target, selector)) {
callback(e, target);
}
});
});
};
var rippleStart = function(e, target) {
var rippleStart = function(e, target, callback) {
// Init variables
var $rippleWrapper = target,
$el = $rippleWrapper.parentNode,
$ripple = document.createElement("div"),
elPos = $el.getBoundingClientRect(),
mousePos = {x: e.clientX - elPos.left, y: e.clientY - elPos.top},
scale = "transform:scale(" + Math.round($rippleWrapper.offsetWidth / 5) + ")",
rippleEnd = new CustomEvent("rippleEnd", {detail: $ripple}),
__rippleOpacity__ = 0.05,
targetColor,
rgbArr,
var $rippleWrapper = target,
$el = $rippleWrapper.parentNode,
$ripple = document.createElement("div"),
elPos = $el.getBoundingClientRect(),
// Mouse pos in most cases
mousePos = {x: e.clientX - elPos.left, y: ((window.ontouchstart) ? e.clientY - window.scrollY: e.clientY) - elPos.top},
scale = "scale(" + Math.round($rippleWrapper.offsetWidth / 5) + ")",
rippleEnd = new CustomEvent("rippleEnd", {detail: $ripple}),
_rippleOpacity = 0.1,
refreshElementStyle;
// If multitouch is detected or some other black magic suff is happening...
if (e.touches) {
mousePos = {x: e.touches[0].clientX - elPos.left, y: e.touches[0].clientY - elPos.top};
}
console.log(mousePos);
$ripplecache = $ripple;
// Set ripple class
$ripple.className = "ripple";
$ripple.className = "ripple";
// Move ripple to the mouse position
$ripple.setAttribute("style", "left:" + mousePos.x + "px; top:" + mousePos.y + "px;");
// Get the clicked targets text color, this will be applied to the ripple as background-color.
targetColor = window.getComputedStyle($el).color;
// This changes the alpha value of the rgba (opacity) to the constant __rippleOpacity__
// Not sure if regexp is quicker...
rgbArr = targetColor.split(",");
rgbArr.pop();
rgbArr.push(" " + __rippleOpacity__ + ")");
targetColor = rgbArr.join(",");
// Get the clicked target's text color, this will be applied to the ripple as background-color.
var targetColor = window.getComputedStyle($el).color;
// Convert the rgb color to an rgba color with opacity set to __rippleOpacity__
targetColor = targetColor.replace("rgb", "rgba").replace(")", ", " + _rippleOpacity + ")");
// Insert new ripple into ripple wrapper
$rippleWrapper.appendChild($ripple);
@ -70,11 +79,22 @@ window.ripples = {
// Let other funtions know that this element is animating
$ripple.dataset.animating = 1;
// + "background-color: " + targetColor + ";"
// Set scale value, background-color and opacity to ripple and animate it
$ripple.className = "ripple ripple-on";
$ripple.setAttribute("style", $ripple.getAttribute("style") + "background-color: " + targetColor + ";" + ["-ms-" + scale,"-moz-" + scale,"-webkit-" + scale,scale].join(";"));
// Prepare the style of the ripple
var rippleStyle = [
$ripple.getAttribute("style"),
"background-color: " + targetColor,
"-ms-transform: " + scale,
"-moz-transform" + scale,
"-webkit-transform" + scale,
"transform: " + scale
];
// Apply the style
$ripple.setAttribute("style", rippleStyle.join(";"));
// This function is called when the animation is finished
setTimeout(function() {
@ -82,6 +102,9 @@ window.ripples = {
// Let know to other functions that this element has finished the animation
$ripple.dataset.animating = 0;
document.dispatchEvent(rippleEnd);
if (callback) {
callback();
}
}, rippleStartTime);
@ -99,39 +122,43 @@ window.ripples = {
// Helper, need to know if mouse is up or down
var mouseDown = false;
document.body.onmousedown = function() {
bind(["mousedown", "touchstart"], "*", function() {
mouseDown = true;
};
document.body.onmouseup = function() {
});
bind(["mouseup", "touchend"], "*", function() {
mouseDown = false;
};
});
// Append ripple wrapper if not exists already
var rippleInit = function(e, target) {
if (target.getElementsByClassName("ripple-wrapper").length === 0) {
target.className += " withripple";
var $rippleWrapper = document.createElement("div");
$rippleWrapper.className = "ripple-wrapper";
target.appendChild($rippleWrapper);
if (window.ontouchstart === null) {
rippleStart(e, $rippleWrapper, function() {
// FIXME: ugly fix for first touchstart event on mobile devices...
$rippleWrapper.getElementsByClassName("ripple")[0].remove();
});
}
}
};
var $ripplecache;
// Events handler
// init RippleJS and start ripple effect on mousedown
bind("mouseover", withRipple, rippleInit);
bind(["mouseover", "touchstart"], withRipple, rippleInit);
// start ripple effect on mousedown
bind("mousedown", ".ripple-wrapper", function(e, $ripple) {
// Start ripple only on left or middle mouse click
if (e.which === 1 || e.which === 2) {
bind(["mousedown", "touchstart"], ".ripple-wrapper", function(e, $ripple) {
// Start ripple only on left or middle mouse click and touch click
if (e.which === 0 || e.which === 1 || e.which === 2) {
rippleStart(e, $ripple);
}
});
// if animation ends and user is not holding mouse then destroy the ripple
bind("rippleEnd", ".ripple-wrapper .ripple", function(e, $ripple) {
@ -141,8 +168,9 @@ window.ripples = {
rippleOut($ripple);
}
});
// Destroy ripple when mouse is not holded anymore if the ripple still exists
bind("mouseup", ".ripple-wrapper", function() {
bind(["mouseup", "touchend"], ".ripple-wrapper", function() {
var $ripple = $ripplecache;
if ($ripple && $ripple.dataset.animating != 1) {
rippleOut($ripple);

View File

@ -1902,15 +1902,17 @@ body .jumbotron-material-lightgrey,
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
outline: none !important;
}
.btn:hover {
color: rgba(255, 255, 255, 0.84);
}
.btn:hover:not(.btn-link) {
.btn:hover:not(.btn-link):not(.btn-flat) {
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2), 0 3px 6px rgba(0, 0, 0, 0.28);
}
.btn:active:not(.btn-link) {
.btn:active:not(.btn-link):not(.btn-flat) {
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
}
.btn:disabled:not(.btn-link):not(.btn-flat) {
color: #a8a8a8 !important;
background-color: #eaeaea !important;
box-shadow: none;
}
.btn:not(.btn-link),
.btn-default:not(.btn-link) {
background-color: transparent;
@ -1981,6 +1983,156 @@ body .jumbotron-material-lightgrey,
.btn-material-lightgrey:not(.btn-link) {
background-color: #ececec;
}
.btn.btn-flat {
background: none;
box-shadow: none;
font-weight: 500;
}
.btn.btn-flat:disabled {
color: #a8a8a8 !important;
}
.btn.btn-flat.btn-primary {
color: #4285f4;
}
.btn.btn-flat.btn-success {
color: #0f9d58;
}
.btn.btn-flat.btn-info {
color: #03a9f4;
}
.btn.btn-flat.btn-warning {
color: #ff5722;
}
.btn.btn-flat.btn-danger {
color: #f44336;
}
.btn.btn-raised {
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);
}
.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);
}
.btn.btn-fab {
margin: 0;
padding: 15px;
font-size: 26px;
width: 56px;
height: 56px;
}
.btn.btn-fab,
.btn.btn-fab:hover {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}
.btn.btn-fab,
.btn.btn-fab:hover,
.btn.btn-fab-default,
.btn.btn-fab:hover-default {
background-color: transparent;
}
.btn.btn-fab-primary,
.btn.btn-fab:hover-primary {
background-color: #4285f4;
}
.btn.btn-fab-success,
.btn.btn-fab:hover-success {
background-color: #0f9d58;
}
.btn.btn-fab-info,
.btn.btn-fab:hover-info {
background-color: #03a9f4;
}
.btn.btn-fab-warning,
.btn.btn-fab:hover-warning {
background-color: #ff5722;
}
.btn.btn-fab-danger,
.btn.btn-fab:hover-danger {
background-color: #f44336;
}
.btn.btn-fab-material-red,
.btn.btn-fab:hover-material-red {
background-color: #f44336;
}
.btn.btn-fab-material-pink,
.btn.btn-fab:hover-material-pink {
background-color: #e91e63;
}
.btn.btn-fab-material-purple,
.btn.btn-fab:hover-material-purple {
background-color: #9c27b0;
}
.btn.btn-fab-material-deeppurple,
.btn.btn-fab:hover-material-deeppurple {
background-color: #673ab7;
}
.btn.btn-fab-material-indigo,
.btn.btn-fab:hover-material-indigo {
background-color: #3f51b5;
}
.btn.btn-fab-material-lightblue,
.btn.btn-fab:hover-material-lightblue {
background-color: #03a9f4;
}
.btn.btn-fab-material-cyan,
.btn.btn-fab:hover-material-cyan {
background-color: #00bcd4;
}
.btn.btn-fab-material-teal,
.btn.btn-fab:hover-material-teal {
background-color: #009688;
}
.btn.btn-fab-material-lightgreen,
.btn.btn-fab:hover-material-lightgreen {
background-color: #8bc34a;
}
.btn.btn-fab-material-lime,
.btn.btn-fab:hover-material-lime {
background-color: #cddc39;
}
.btn.btn-fab-material-lightyellow,
.btn.btn-fab:hover-material-lightyellow {
background-color: #ffeb3b;
}
.btn.btn-fab-material-orange,
.btn.btn-fab:hover-material-orange {
background-color: #ff9800;
}
.btn.btn-fab-material-deeporange,
.btn.btn-fab:hover-material-deeporange {
background-color: #ff5722;
}
.btn.btn-fab-material-grey,
.btn.btn-fab:hover-material-grey {
background-color: #9e9e9e;
}
.btn.btn-fab-material-bluegrey,
.btn.btn-fab:hover-material-bluegrey {
background-color: #607d8b;
}
.btn.btn-fab-material-brown,
.btn.btn-fab:hover-material-brown {
background-color: #795548;
}
.btn.btn-fab-material-lightgrey,
.btn.btn-fab:hover-material-lightgrey {
background-color: #ececec;
}
.btn.btn-fab,
.btn.btn-fab .ripple-wrapper {
border-radius: 100%;
}
.btn.btn-fab.btn-fab-mini {
width: 40px;
height: 40px;
padding: 13px;
font-size: 15px;
}
.btn.btn-fab i {
position: relative;
top: -5px;
}
.btn-link,
.btn:not([class^="btn btn-"]),
.btn-default {
@ -1995,14 +2147,6 @@ body .jumbotron-material-lightgrey,
.btn-default:hover {
background-color: rgba(255, 255, 255, 0.5);
}
.btn-raised {
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);
}
.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);
}
.open > .dropdown-toggle.btn,
.open > .dropdown-toggle.btn-default {
background-color: transparent;
@ -2073,12 +2217,6 @@ body .jumbotron-material-lightgrey,
.open > .dropdown-toggle.btn-material-lightgrey {
background-color: #ececec;
}
.btn-flat {
box-shadow: none !important;
}
.btn-flat.btn-default:hover {
background: none;
}
.btn-group,
.btn-group-vertical {
position: relative;
@ -2122,121 +2260,6 @@ body .jumbotron-material-lightgrey,
.btn-group-flat {
box-shadow: none !important;
}
.btn-fab {
margin: 0;
padding: 15px;
font-size: 26px;
width: 56px;
height: 56px;
}
.btn-fab,
.btn-fab:hover {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}
.btn-fab,
.btn-fab:hover,
.btn-fab-default,
.btn-fab:hover-default {
background-color: transparent;
}
.btn-fab-primary,
.btn-fab:hover-primary {
background-color: #4285f4;
}
.btn-fab-success,
.btn-fab:hover-success {
background-color: #0f9d58;
}
.btn-fab-info,
.btn-fab:hover-info {
background-color: #03a9f4;
}
.btn-fab-warning,
.btn-fab:hover-warning {
background-color: #ff5722;
}
.btn-fab-danger,
.btn-fab:hover-danger {
background-color: #f44336;
}
.btn-fab-material-red,
.btn-fab:hover-material-red {
background-color: #f44336;
}
.btn-fab-material-pink,
.btn-fab:hover-material-pink {
background-color: #e91e63;
}
.btn-fab-material-purple,
.btn-fab:hover-material-purple {
background-color: #9c27b0;
}
.btn-fab-material-deeppurple,
.btn-fab:hover-material-deeppurple {
background-color: #673ab7;
}
.btn-fab-material-indigo,
.btn-fab:hover-material-indigo {
background-color: #3f51b5;
}
.btn-fab-material-lightblue,
.btn-fab:hover-material-lightblue {
background-color: #03a9f4;
}
.btn-fab-material-cyan,
.btn-fab:hover-material-cyan {
background-color: #00bcd4;
}
.btn-fab-material-teal,
.btn-fab:hover-material-teal {
background-color: #009688;
}
.btn-fab-material-lightgreen,
.btn-fab:hover-material-lightgreen {
background-color: #8bc34a;
}
.btn-fab-material-lime,
.btn-fab:hover-material-lime {
background-color: #cddc39;
}
.btn-fab-material-lightyellow,
.btn-fab:hover-material-lightyellow {
background-color: #ffeb3b;
}
.btn-fab-material-orange,
.btn-fab:hover-material-orange {
background-color: #ff9800;
}
.btn-fab-material-deeporange,
.btn-fab:hover-material-deeporange {
background-color: #ff5722;
}
.btn-fab-material-grey,
.btn-fab:hover-material-grey {
background-color: #9e9e9e;
}
.btn-fab-material-bluegrey,
.btn-fab:hover-material-bluegrey {
background-color: #607d8b;
}
.btn-fab-material-brown,
.btn-fab:hover-material-brown {
background-color: #795548;
}
.btn-fab-material-lightgrey,
.btn-fab:hover-material-lightgrey {
background-color: #ececec;
}
.btn-fab,
.btn-fab .ripple-wrapper {
border-radius: 100%;
}
.btn-fab.btn-mini {
width: 40px;
height: 40px;
padding: 13px;
font-size: 15px;
}
.form-horizontal .checkbox {
padding-top: 20px;
}
@ -3500,20 +3523,6 @@ select.form-control.focus {
legend {
border-bottom: 0;
}
.modal-content {
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
border-radius: 0;
border: 0;
}
.modal-content .modal-header {
border-bottom: 0;
}
.modal-content .modal-footer {
border-top: 0;
}
.modal-content .modal-footer .btn + .btn {
margin-bottom: 10px;
}
.list-group {
border-radius: 0;
}
@ -4249,6 +4258,43 @@ fieldset[disabled] .navbar .btn-link:focus {
.card .card-footer button:first-child {
left: -15px;
}
.modal-content {
box-shadow: 0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22);
margin-top: 10em;
border-radius: 2px;
border: none;
}
.modal-content .modal-header {
border-bottom: none;
padding: 24px;
padding-bottom: 0;
}
.modal-content .modal-body {
padding: 24px;
padding-bottom: 0;
}
.modal-content .modal-footer {
border-top: none;
padding: 24px;
}
.modal-content .modal-footer button {
margin: 0;
padding-left: 16px;
padding-right: 16px;
width: auto;
}
.modal-content .modal-footer button.pull-left {
padding-left: 5px;
padding-right: 5px;
position: relative;
left: -5px;
}
.modal-content .modal-footer button + button {
margin-bottom: 16px;
}
.modal-backdrop {
display: none;
}
.snackbar {
background-color: #323232;
color: rgba(255, 255, 255, 0.84);

File diff suppressed because one or more lines are too long

View File

@ -1901,15 +1901,17 @@ body .jumbotron-material-lightgrey,
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
outline: none !important;
}
.btn:hover {
color: rgba(255, 255, 255, 0.84);
}
.btn:hover:not(.btn-link) {
.btn:hover:not(.btn-link):not(.btn-flat) {
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2), 0 3px 6px rgba(0, 0, 0, 0.28);
}
.btn:active:not(.btn-link) {
.btn:active:not(.btn-link):not(.btn-flat) {
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
}
.btn:disabled:not(.btn-link):not(.btn-flat) {
color: #a8a8a8 !important;
background-color: #eaeaea !important;
box-shadow: none;
}
.btn:not(.btn-link),
.btn-default:not(.btn-link) {
background-color: transparent;
@ -1980,6 +1982,156 @@ body .jumbotron-material-lightgrey,
.btn-material-lightgrey:not(.btn-link) {
background-color: #ececec;
}
.btn.btn-flat {
background: none;
box-shadow: none;
font-weight: 500;
}
.btn.btn-flat:disabled {
color: #a8a8a8 !important;
}
.btn.btn-flat.btn-primary {
color: #4285f4;
}
.btn.btn-flat.btn-success {
color: #0f9d58;
}
.btn.btn-flat.btn-info {
color: #03a9f4;
}
.btn.btn-flat.btn-warning {
color: #ff5722;
}
.btn.btn-flat.btn-danger {
color: #f44336;
}
.btn.btn-raised {
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);
}
.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);
}
.btn.btn-fab {
margin: 0;
padding: 15px;
font-size: 26px;
width: 56px;
height: 56px;
}
.btn.btn-fab,
.btn.btn-fab:hover {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}
.btn.btn-fab,
.btn.btn-fab:hover,
.btn.btn-fab-default,
.btn.btn-fab:hover-default {
background-color: transparent;
}
.btn.btn-fab-primary,
.btn.btn-fab:hover-primary {
background-color: #4285f4;
}
.btn.btn-fab-success,
.btn.btn-fab:hover-success {
background-color: #0f9d58;
}
.btn.btn-fab-info,
.btn.btn-fab:hover-info {
background-color: #03a9f4;
}
.btn.btn-fab-warning,
.btn.btn-fab:hover-warning {
background-color: #ff5722;
}
.btn.btn-fab-danger,
.btn.btn-fab:hover-danger {
background-color: #f44336;
}
.btn.btn-fab-material-red,
.btn.btn-fab:hover-material-red {
background-color: #f44336;
}
.btn.btn-fab-material-pink,
.btn.btn-fab:hover-material-pink {
background-color: #e91e63;
}
.btn.btn-fab-material-purple,
.btn.btn-fab:hover-material-purple {
background-color: #9c27b0;
}
.btn.btn-fab-material-deeppurple,
.btn.btn-fab:hover-material-deeppurple {
background-color: #673ab7;
}
.btn.btn-fab-material-indigo,
.btn.btn-fab:hover-material-indigo {
background-color: #3f51b5;
}
.btn.btn-fab-material-lightblue,
.btn.btn-fab:hover-material-lightblue {
background-color: #03a9f4;
}
.btn.btn-fab-material-cyan,
.btn.btn-fab:hover-material-cyan {
background-color: #00bcd4;
}
.btn.btn-fab-material-teal,
.btn.btn-fab:hover-material-teal {
background-color: #009688;
}
.btn.btn-fab-material-lightgreen,
.btn.btn-fab:hover-material-lightgreen {
background-color: #8bc34a;
}
.btn.btn-fab-material-lime,
.btn.btn-fab:hover-material-lime {
background-color: #cddc39;
}
.btn.btn-fab-material-lightyellow,
.btn.btn-fab:hover-material-lightyellow {
background-color: #ffeb3b;
}
.btn.btn-fab-material-orange,
.btn.btn-fab:hover-material-orange {
background-color: #ff9800;
}
.btn.btn-fab-material-deeporange,
.btn.btn-fab:hover-material-deeporange {
background-color: #ff5722;
}
.btn.btn-fab-material-grey,
.btn.btn-fab:hover-material-grey {
background-color: #9e9e9e;
}
.btn.btn-fab-material-bluegrey,
.btn.btn-fab:hover-material-bluegrey {
background-color: #607d8b;
}
.btn.btn-fab-material-brown,
.btn.btn-fab:hover-material-brown {
background-color: #795548;
}
.btn.btn-fab-material-lightgrey,
.btn.btn-fab:hover-material-lightgrey {
background-color: #ececec;
}
.btn.btn-fab,
.btn.btn-fab .ripple-wrapper {
border-radius: 100%;
}
.btn.btn-fab.btn-fab-mini {
width: 40px;
height: 40px;
padding: 13px;
font-size: 15px;
}
.btn.btn-fab i {
position: relative;
top: -5px;
}
.btn-link,
.btn:not([class^="btn btn-"]),
.btn-default {
@ -1994,14 +2146,6 @@ body .jumbotron-material-lightgrey,
.btn-default:hover {
background-color: rgba(255, 255, 255, 0.5);
}
.btn-raised {
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);
}
.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);
}
.open > .dropdown-toggle.btn,
.open > .dropdown-toggle.btn-default {
background-color: transparent;
@ -2072,12 +2216,6 @@ body .jumbotron-material-lightgrey,
.open > .dropdown-toggle.btn-material-lightgrey {
background-color: #ececec;
}
.btn-flat {
box-shadow: none !important;
}
.btn-flat.btn-default:hover {
background: none;
}
.btn-group,
.btn-group-vertical {
position: relative;
@ -2121,121 +2259,6 @@ body .jumbotron-material-lightgrey,
.btn-group-flat {
box-shadow: none !important;
}
.btn-fab {
margin: 0;
padding: 15px;
font-size: 26px;
width: 56px;
height: 56px;
}
.btn-fab,
.btn-fab:hover {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}
.btn-fab,
.btn-fab:hover,
.btn-fab-default,
.btn-fab:hover-default {
background-color: transparent;
}
.btn-fab-primary,
.btn-fab:hover-primary {
background-color: #4285f4;
}
.btn-fab-success,
.btn-fab:hover-success {
background-color: #0f9d58;
}
.btn-fab-info,
.btn-fab:hover-info {
background-color: #03a9f4;
}
.btn-fab-warning,
.btn-fab:hover-warning {
background-color: #ff5722;
}
.btn-fab-danger,
.btn-fab:hover-danger {
background-color: #f44336;
}
.btn-fab-material-red,
.btn-fab:hover-material-red {
background-color: #f44336;
}
.btn-fab-material-pink,
.btn-fab:hover-material-pink {
background-color: #e91e63;
}
.btn-fab-material-purple,
.btn-fab:hover-material-purple {
background-color: #9c27b0;
}
.btn-fab-material-deeppurple,
.btn-fab:hover-material-deeppurple {
background-color: #673ab7;
}
.btn-fab-material-indigo,
.btn-fab:hover-material-indigo {
background-color: #3f51b5;
}
.btn-fab-material-lightblue,
.btn-fab:hover-material-lightblue {
background-color: #03a9f4;
}
.btn-fab-material-cyan,
.btn-fab:hover-material-cyan {
background-color: #00bcd4;
}
.btn-fab-material-teal,
.btn-fab:hover-material-teal {
background-color: #009688;
}
.btn-fab-material-lightgreen,
.btn-fab:hover-material-lightgreen {
background-color: #8bc34a;
}
.btn-fab-material-lime,
.btn-fab:hover-material-lime {
background-color: #cddc39;
}
.btn-fab-material-lightyellow,
.btn-fab:hover-material-lightyellow {
background-color: #ffeb3b;
}
.btn-fab-material-orange,
.btn-fab:hover-material-orange {
background-color: #ff9800;
}
.btn-fab-material-deeporange,
.btn-fab:hover-material-deeporange {
background-color: #ff5722;
}
.btn-fab-material-grey,
.btn-fab:hover-material-grey {
background-color: #9e9e9e;
}
.btn-fab-material-bluegrey,
.btn-fab:hover-material-bluegrey {
background-color: #607d8b;
}
.btn-fab-material-brown,
.btn-fab:hover-material-brown {
background-color: #795548;
}
.btn-fab-material-lightgrey,
.btn-fab:hover-material-lightgrey {
background-color: #ececec;
}
.btn-fab,
.btn-fab .ripple-wrapper {
border-radius: 100%;
}
.btn-fab.btn-mini {
width: 40px;
height: 40px;
padding: 13px;
font-size: 15px;
}
.form-horizontal .checkbox {
padding-top: 20px;
}
@ -3499,20 +3522,6 @@ select.form-control.focus {
legend {
border-bottom: 0;
}
.modal-content {
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
border-radius: 0;
border: 0;
}
.modal-content .modal-header {
border-bottom: 0;
}
.modal-content .modal-footer {
border-top: 0;
}
.modal-content .modal-footer .btn + .btn {
margin-bottom: 10px;
}
.list-group {
border-radius: 0;
}
@ -4248,6 +4257,43 @@ fieldset[disabled] .navbar .btn-link:focus {
.card .card-footer button:first-child {
left: -15px;
}
.modal-content {
box-shadow: 0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22);
margin-top: 10em;
border-radius: 2px;
border: none;
}
.modal-content .modal-header {
border-bottom: none;
padding: 24px;
padding-bottom: 0;
}
.modal-content .modal-body {
padding: 24px;
padding-bottom: 0;
}
.modal-content .modal-footer {
border-top: none;
padding: 24px;
}
.modal-content .modal-footer button {
margin: 0;
padding-left: 16px;
padding-right: 16px;
width: auto;
}
.modal-content .modal-footer button.pull-left {
padding-left: 5px;
padding-right: 5px;
position: relative;
left: -5px;
}
.modal-content .modal-footer button + button {
margin-bottom: 16px;
}
.modal-backdrop {
display: none;
}
.snackbar {
background-color: #323232;
color: rgba(255, 255, 255, 0.84);

File diff suppressed because one or more lines are too long

View File

@ -1,15 +1,17 @@
/* Copyright 2014+, Federico Zivolo, LICENSE at https://github.com/FezVrasta/bootstrap-material-design/blob/master/LICENSE.md */
/* globals CustomEvent */
/*jshint maxlen: 500 */
window.ripples = {
init : function(withRipple) {
"use strict";
// Cross browser matches function
function matchesSelector(domElement, selector) {
var matches = domElement.matches || domElement.matchesSelector || domElement.webkitMatchesSelector ||
var matches = domElement.matches ||
domElement.matchesSelector ||
domElement.webkitMatchesSelector ||
domElement.mozMatchesSelector ||
domElement.msMatchesSelector || domElement.oMatchesSelector;
domElement.msMatchesSelector ||
domElement.oMatchesSelector;
return matches.call(domElement, selector);
}
@ -18,49 +20,56 @@ window.ripples = {
rippleStartTime = 500;
// Helper to bind events on dynamically created elements
var bind = function(event, selector, callback) {
document.addEventListener(event, function(e) {
var target = (typeof e.detail !== "number") ? e.detail : e.target;
var bind = function(events, selector, callback) {
if (typeof events === "string") {
events = [events];
}
events.forEach(function(event) {
document.addEventListener(event, function(e) {
var target = (typeof e.detail !== "number") ? e.detail : e.target;
if (matchesSelector(target, selector)) {
callback(e, target);
}
if (matchesSelector(target, selector)) {
callback(e, target);
}
});
});
};
var rippleStart = function(e, target) {
var rippleStart = function(e, target, callback) {
// Init variables
var $rippleWrapper = target,
$el = $rippleWrapper.parentNode,
$ripple = document.createElement("div"),
elPos = $el.getBoundingClientRect(),
mousePos = {x: e.clientX - elPos.left, y: e.clientY - elPos.top},
scale = "transform:scale(" + Math.round($rippleWrapper.offsetWidth / 5) + ")",
rippleEnd = new CustomEvent("rippleEnd", {detail: $ripple}),
__rippleOpacity__ = 0.05,
targetColor,
rgbArr,
var $rippleWrapper = target,
$el = $rippleWrapper.parentNode,
$ripple = document.createElement("div"),
elPos = $el.getBoundingClientRect(),
// Mouse pos in most cases
mousePos = {x: e.clientX - elPos.left, y: ((window.ontouchstart) ? e.clientY - window.scrollY: e.clientY) - elPos.top},
scale = "scale(" + Math.round($rippleWrapper.offsetWidth / 5) + ")",
rippleEnd = new CustomEvent("rippleEnd", {detail: $ripple}),
_rippleOpacity = 0.1,
refreshElementStyle;
// If multitouch is detected or some other black magic suff is happening...
if (e.touches) {
mousePos = {x: e.touches[0].clientX - elPos.left, y: e.touches[0].clientY - elPos.top};
}
console.log(mousePos);
$ripplecache = $ripple;
// Set ripple class
$ripple.className = "ripple";
$ripple.className = "ripple";
// Move ripple to the mouse position
$ripple.setAttribute("style", "left:" + mousePos.x + "px; top:" + mousePos.y + "px;");
// Get the clicked targets text color, this will be applied to the ripple as background-color.
targetColor = window.getComputedStyle($el).color;
// This changes the alpha value of the rgba (opacity) to the constant __rippleOpacity__
// Not sure if regexp is quicker...
rgbArr = targetColor.split(",");
rgbArr.pop();
rgbArr.push(" " + __rippleOpacity__ + ")");
targetColor = rgbArr.join(",");
// Get the clicked target's text color, this will be applied to the ripple as background-color.
var targetColor = window.getComputedStyle($el).color;
// Convert the rgb color to an rgba color with opacity set to __rippleOpacity__
targetColor = targetColor.replace("rgb", "rgba").replace(")", ", " + _rippleOpacity + ")");
// Insert new ripple into ripple wrapper
$rippleWrapper.appendChild($ripple);
@ -70,11 +79,22 @@ window.ripples = {
// Let other funtions know that this element is animating
$ripple.dataset.animating = 1;
// + "background-color: " + targetColor + ";"
// Set scale value, background-color and opacity to ripple and animate it
$ripple.className = "ripple ripple-on";
$ripple.setAttribute("style", $ripple.getAttribute("style") + "background-color: " + targetColor + ";" + ["-ms-" + scale,"-moz-" + scale,"-webkit-" + scale,scale].join(";"));
// Prepare the style of the ripple
var rippleStyle = [
$ripple.getAttribute("style"),
"background-color: " + targetColor,
"-ms-transform: " + scale,
"-moz-transform" + scale,
"-webkit-transform" + scale,
"transform: " + scale
];
// Apply the style
$ripple.setAttribute("style", rippleStyle.join(";"));
// This function is called when the animation is finished
setTimeout(function() {
@ -82,6 +102,9 @@ window.ripples = {
// Let know to other functions that this element has finished the animation
$ripple.dataset.animating = 0;
document.dispatchEvent(rippleEnd);
if (callback) {
callback();
}
}, rippleStartTime);
@ -99,39 +122,43 @@ window.ripples = {
// Helper, need to know if mouse is up or down
var mouseDown = false;
document.body.onmousedown = function() {
bind(["mousedown", "touchstart"], "*", function() {
mouseDown = true;
};
document.body.onmouseup = function() {
});
bind(["mouseup", "touchend"], "*", function() {
mouseDown = false;
};
});
// Append ripple wrapper if not exists already
var rippleInit = function(e, target) {
if (target.getElementsByClassName("ripple-wrapper").length === 0) {
target.className += " withripple";
var $rippleWrapper = document.createElement("div");
$rippleWrapper.className = "ripple-wrapper";
target.appendChild($rippleWrapper);
if (window.ontouchstart === null) {
rippleStart(e, $rippleWrapper, function() {
// FIXME: ugly fix for first touchstart event on mobile devices...
$rippleWrapper.getElementsByClassName("ripple")[0].remove();
});
}
}
};
var $ripplecache;
// Events handler
// init RippleJS and start ripple effect on mousedown
bind("mouseover", withRipple, rippleInit);
bind(["mouseover", "touchstart"], withRipple, rippleInit);
// start ripple effect on mousedown
bind("mousedown", ".ripple-wrapper", function(e, $ripple) {
// Start ripple only on left or middle mouse click
if (e.which === 1 || e.which === 2) {
bind(["mousedown", "touchstart"], ".ripple-wrapper", function(e, $ripple) {
// Start ripple only on left or middle mouse click and touch click
if (e.which === 0 || e.which === 1 || e.which === 2) {
rippleStart(e, $ripple);
}
});
// if animation ends and user is not holding mouse then destroy the ripple
bind("rippleEnd", ".ripple-wrapper .ripple", function(e, $ripple) {
@ -141,8 +168,9 @@ window.ripples = {
rippleOut($ripple);
}
});
// Destroy ripple when mouse is not holded anymore if the ripple still exists
bind("mouseup", ".ripple-wrapper", function() {
bind(["mouseup", "touchend"], ".ripple-wrapper", function() {
var $ripple = $ripplecache;
if ($ripple && $ripple.dataset.animating != 1) {
rippleOut($ripple);

View File

@ -1 +1 @@
window.ripples={init:function(a){"use strict";function b(a,b){var c=a.matches||a.matchesSelector||a.webkitMatchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector;return c.call(a,b)}var c=100,d=500,e=function(a,c,d){document.addEventListener(a,function(a){var e="number"!=typeof a.detail?a.detail:a.target;b(e,c)&&d(a,e)})},f=function(a,b){var c,e,f,g=b,h=g.parentNode,j=document.createElement("div"),k=h.getBoundingClientRect(),l={x:a.clientX-k.left,y:a.clientY-k.top},m="transform:scale("+Math.round(g.offsetWidth/5)+")",n=new CustomEvent("rippleEnd",{detail:j}),o=.05;i=j,j.className="ripple",j.setAttribute("style","left:"+l.x+"px; top:"+l.y+"px;"),c=window.getComputedStyle(h).color,e=c.split(","),e.pop(),e.push(" "+o+")"),c=e.join(","),g.appendChild(j),f=window.getComputedStyle(j).opacity,j.dataset.animating=1,j.className="ripple ripple-on",j.setAttribute("style",j.getAttribute("style")+"background-color: "+c+";"+["-ms-"+m,"-moz-"+m,"-webkit-"+m,m].join(";")),setTimeout(function(){j.dataset.animating=0,document.dispatchEvent(n)},d)},g=function(a){a.className="ripple ripple-on ripple-out",setTimeout(function(){a.remove()},c)},h=!1;document.body.onmousedown=function(){h=!0},document.body.onmouseup=function(){h=!1};var i,j=function(a,b){if(0===b.getElementsByClassName("ripple-wrapper").length){b.className+=" withripple";var c=document.createElement("div");c.className="ripple-wrapper",b.appendChild(c)}};e("mouseover",a,j),e("mousedown",".ripple-wrapper",function(a,b){(1===a.which||2===a.which)&&f(a,b)}),e("rippleEnd",".ripple-wrapper .ripple",function(a,b){var c=b.parentNode.getElementsByClassName("ripple");(!h||c[0]==b&&c.length>1)&&g(b)}),e("mouseup",".ripple-wrapper",function(){var a=i;a&&1!=a.dataset.animating&&g(a)})}};
window.ripples={init:function(a){"use strict";function b(a,b){var c=a.matches||a.matchesSelector||a.webkitMatchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector;return c.call(a,b)}var c=100,d=500,e=function(a,c,d){"string"==typeof a&&(a=[a]),a.forEach(function(a){document.addEventListener(a,function(a){var e="number"!=typeof a.detail?a.detail:a.target;b(e,c)&&d(a,e)})})},f=function(a,b,c){var e,f=b,g=f.parentNode,h=document.createElement("div"),j=g.getBoundingClientRect(),k={x:a.clientX-j.left,y:(window.ontouchstart?a.clientY-window.scrollY:a.clientY)-j.top},l="scale("+Math.round(f.offsetWidth/5)+")",m=new CustomEvent("rippleEnd",{detail:h}),n=.1;a.touches&&(k={x:a.touches[0].clientX-j.left,y:a.touches[0].clientY-j.top}),console.log(k),i=h,h.className="ripple",h.setAttribute("style","left:"+k.x+"px; top:"+k.y+"px;");var o=window.getComputedStyle(g).color;o=o.replace("rgb","rgba").replace(")",", "+n+")"),f.appendChild(h),e=window.getComputedStyle(h).opacity,h.dataset.animating=1,h.className="ripple ripple-on";var p=[h.getAttribute("style"),"background-color: "+o,"-ms-transform: "+l,"-moz-transform"+l,"-webkit-transform"+l,"transform: "+l];h.setAttribute("style",p.join(";")),setTimeout(function(){h.dataset.animating=0,document.dispatchEvent(m),c&&c()},d)},g=function(a){a.className="ripple ripple-on ripple-out",setTimeout(function(){a.remove()},c)},h=!1;e(["mousedown","touchstart"],"*",function(){h=!0}),e(["mouseup","touchend"],"*",function(){h=!1});var i,j=function(a,b){if(0===b.getElementsByClassName("ripple-wrapper").length){b.className+=" withripple";var c=document.createElement("div");c.className="ripple-wrapper",b.appendChild(c),null===window.ontouchstart&&f(a,c,function(){c.getElementsByClassName("ripple")[0].remove()})}};e(["mouseover","touchstart"],a,j),e(["mousedown","touchstart"],".ripple-wrapper",function(a,b){(0===a.which||1===a.which||2===a.which)&&f(a,b)}),e("rippleEnd",".ripple-wrapper .ripple",function(a,b){var c=b.parentNode.getElementsByClassName("ripple");(!h||c[0]==b&&c.length>1)&&g(b)}),e(["mouseup","touchend"],".ripple-wrapper",function(){var a=i;a&&1!=a.dataset.animating&&g(a)})}};