materialize-rails 0.97.5.custom1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +22 -0
- data/README.md +63 -0
- data/Rakefile +1 -0
- data/lib/materialize-rails.rb +25 -0
- data/lib/materialize-rails/engine.rb +14 -0
- data/lib/materialize-rails/version.rb +3 -0
- data/materialize-rails.gemspec +25 -0
- data/vendor/assets/fonts/materialize/material-design-icons/LICENSE.txt +428 -0
- data/vendor/assets/fonts/materialize/material-design-icons/Material-Design-Icons.eot +0 -0
- data/vendor/assets/fonts/materialize/material-design-icons/Material-Design-Icons.svg +769 -0
- data/vendor/assets/fonts/materialize/material-design-icons/Material-Design-Icons.ttf +0 -0
- data/vendor/assets/fonts/materialize/material-design-icons/Material-Design-Icons.woff +0 -0
- data/vendor/assets/fonts/materialize/material-design-icons/Material-Design-Icons.woff2 +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Bold.eot +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Bold.ttf +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Bold.woff +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Bold.woff2 +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Light.eot +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Light.ttf +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Light.woff +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Light.woff2 +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Medium.eot +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Medium.ttf +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Medium.woff +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Medium.woff2 +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Regular.eot +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Regular.ttf +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Regular.woff +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Regular.woff2 +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Thin.eot +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Thin.ttf +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Thin.woff +0 -0
- data/vendor/assets/fonts/materialize/roboto/Roboto-Thin.woff2 +0 -0
- data/vendor/assets/javascripts/materialize.js +30 -0
- data/vendor/assets/javascripts/materialize/animation.js +9 -0
- data/vendor/assets/javascripts/materialize/buttons.js +91 -0
- data/vendor/assets/javascripts/materialize/cards.js +29 -0
- data/vendor/assets/javascripts/materialize/carousel.js +350 -0
- data/vendor/assets/javascripts/materialize/character_counter.js +59 -0
- data/vendor/assets/javascripts/materialize/chips.js +9 -0
- data/vendor/assets/javascripts/materialize/collapsible.js +137 -0
- data/vendor/assets/javascripts/materialize/date_picker/picker.date.js +1430 -0
- data/vendor/assets/javascripts/materialize/date_picker/picker.js +1123 -0
- data/vendor/assets/javascripts/materialize/dropdown.js +228 -0
- data/vendor/assets/javascripts/materialize/forms.js +581 -0
- data/vendor/assets/javascripts/materialize/global.js +45 -0
- data/vendor/assets/javascripts/materialize/hammer.min.js +1 -0
- data/vendor/assets/javascripts/materialize/initial.js +11 -0
- data/vendor/assets/javascripts/materialize/jquery.easing.1.3.js +205 -0
- data/vendor/assets/javascripts/materialize/jquery.hammer.js +33 -0
- data/vendor/assets/javascripts/materialize/leanModal.js +178 -0
- data/vendor/assets/javascripts/materialize/materialbox.js +269 -0
- data/vendor/assets/javascripts/materialize/parallax.js +58 -0
- data/vendor/assets/javascripts/materialize/pushpin.js +62 -0
- data/vendor/assets/javascripts/materialize/scrollFire.js +44 -0
- data/vendor/assets/javascripts/materialize/scrollspy.js +285 -0
- data/vendor/assets/javascripts/materialize/sideNav.js +315 -0
- data/vendor/assets/javascripts/materialize/slider.js +321 -0
- data/vendor/assets/javascripts/materialize/tabs.js +129 -0
- data/vendor/assets/javascripts/materialize/toasts.js +136 -0
- data/vendor/assets/javascripts/materialize/tooltip.js +203 -0
- data/vendor/assets/javascripts/materialize/transitions.js +154 -0
- data/vendor/assets/javascripts/materialize/velocity.min.js +5 -0
- data/vendor/assets/javascripts/materialize/waves.js +338 -0
- data/vendor/assets/stylesheets/components/_buttons.scss +181 -0
- data/vendor/assets/stylesheets/components/_cards.scss +134 -0
- data/vendor/assets/stylesheets/components/_carousel.scss +34 -0
- data/vendor/assets/stylesheets/components/_chips.scss +27 -0
- data/vendor/assets/stylesheets/components/_collapsible.scss +85 -0
- data/vendor/assets/stylesheets/components/_color.scss +412 -0
- data/vendor/assets/stylesheets/components/_dropdown.scss +57 -0
- data/vendor/assets/stylesheets/components/_form.scss +918 -0
- data/vendor/assets/stylesheets/components/_global.scss +766 -0
- data/vendor/assets/stylesheets/components/_grid.scss +146 -0
- data/vendor/assets/stylesheets/components/_icons-material-design.scss +3263 -0
- data/vendor/assets/stylesheets/components/_materialbox.scss +42 -0
- data/vendor/assets/stylesheets/components/_mixins.scss +5 -0
- data/vendor/assets/stylesheets/components/_modal.scss +90 -0
- data/vendor/assets/stylesheets/components/_navbar.scss +171 -0
- data/vendor/assets/stylesheets/components/_normalize.scss +427 -0
- data/vendor/assets/stylesheets/components/_prefixer.scss +384 -0
- data/vendor/assets/stylesheets/components/_preloader.scss +334 -0
- data/vendor/assets/stylesheets/components/_roboto.scss +49 -0
- data/vendor/assets/stylesheets/components/_sideNav.scss +112 -0
- data/vendor/assets/stylesheets/components/_slider.scss +92 -0
- data/vendor/assets/stylesheets/components/_table_of_contents.scss +33 -0
- data/vendor/assets/stylesheets/components/_tabs.scss +56 -0
- data/vendor/assets/stylesheets/components/_toast.scss +65 -0
- data/vendor/assets/stylesheets/components/_tooltip.scss +33 -0
- data/vendor/assets/stylesheets/components/_typography.scss +61 -0
- data/vendor/assets/stylesheets/components/_variables.scss +161 -0
- data/vendor/assets/stylesheets/components/_waves.scss +173 -0
- data/vendor/assets/stylesheets/components/date_picker/_default.date.scss +435 -0
- data/vendor/assets/stylesheets/components/date_picker/_default.scss +201 -0
- data/vendor/assets/stylesheets/components/date_picker/_default.time.scss +125 -0
- data/vendor/assets/stylesheets/materialize.scss +40 -0
- metadata +199 -0
@@ -0,0 +1,154 @@
|
|
1
|
+
(function ($) {
|
2
|
+
// Image transition function
|
3
|
+
Materialize.fadeInImage = function(selector){
|
4
|
+
var element = $(selector);
|
5
|
+
element.css({opacity: 0});
|
6
|
+
$(element).velocity({opacity: 1}, {
|
7
|
+
duration: 650,
|
8
|
+
queue: false,
|
9
|
+
easing: 'easeOutSine'
|
10
|
+
});
|
11
|
+
$(element).velocity({opacity: 1}, {
|
12
|
+
duration: 1300,
|
13
|
+
queue: false,
|
14
|
+
easing: 'swing',
|
15
|
+
step: function(now, fx) {
|
16
|
+
fx.start = 100;
|
17
|
+
var grayscale_setting = now/100;
|
18
|
+
var brightness_setting = 150 - (100 - now)/1.75;
|
19
|
+
|
20
|
+
if (brightness_setting < 100) {
|
21
|
+
brightness_setting = 100;
|
22
|
+
}
|
23
|
+
if (now >= 0) {
|
24
|
+
$(this).css({
|
25
|
+
"-webkit-filter": "grayscale("+grayscale_setting+")" + "brightness("+brightness_setting+"%)",
|
26
|
+
"filter": "grayscale("+grayscale_setting+")" + "brightness("+brightness_setting+"%)"
|
27
|
+
});
|
28
|
+
}
|
29
|
+
}
|
30
|
+
});
|
31
|
+
};
|
32
|
+
|
33
|
+
// Horizontal staggered list
|
34
|
+
Materialize.showStaggeredList = function(selector) {
|
35
|
+
var time = 0;
|
36
|
+
$(selector).find('li').velocity(
|
37
|
+
{ translateX: "-100px"},
|
38
|
+
{ duration: 0 });
|
39
|
+
|
40
|
+
$(selector).find('li').each(function() {
|
41
|
+
$(this).velocity(
|
42
|
+
{ opacity: "1", translateX: "0"},
|
43
|
+
{ duration: 800, delay: time, easing: [60, 10] });
|
44
|
+
time += 120;
|
45
|
+
});
|
46
|
+
};
|
47
|
+
|
48
|
+
|
49
|
+
$(document).ready(function() {
|
50
|
+
// Hardcoded .staggered-list scrollFire
|
51
|
+
// var staggeredListOptions = [];
|
52
|
+
// $('ul.staggered-list').each(function (i) {
|
53
|
+
|
54
|
+
// var label = 'scrollFire-' + i;
|
55
|
+
// $(this).addClass(label);
|
56
|
+
// staggeredListOptions.push(
|
57
|
+
// {selector: 'ul.staggered-list.' + label,
|
58
|
+
// offset: 200,
|
59
|
+
// callback: 'showStaggeredList("ul.staggered-list.' + label + '")'});
|
60
|
+
// });
|
61
|
+
// scrollFire(staggeredListOptions);
|
62
|
+
|
63
|
+
// HammerJS, Swipe navigation
|
64
|
+
|
65
|
+
// Touch Event
|
66
|
+
var swipeLeft = false;
|
67
|
+
var swipeRight = false;
|
68
|
+
|
69
|
+
|
70
|
+
// Dismissible Collections
|
71
|
+
$('.dismissable').each(function() {
|
72
|
+
$(this).hammer({
|
73
|
+
prevent_default: false
|
74
|
+
}).bind('pan', function(e) {
|
75
|
+
if (e.gesture.pointerType === "touch") {
|
76
|
+
var $this = $(this);
|
77
|
+
var direction = e.gesture.direction;
|
78
|
+
var x = e.gesture.deltaX;
|
79
|
+
var velocityX = e.gesture.velocityX;
|
80
|
+
|
81
|
+
$this.velocity({ translateX: x
|
82
|
+
}, {duration: 50, queue: false, easing: 'easeOutQuad'});
|
83
|
+
|
84
|
+
// Swipe Left
|
85
|
+
if (direction === 4 && (x > ($this.innerWidth() / 2) || velocityX < -0.75)) {
|
86
|
+
swipeLeft = true;
|
87
|
+
}
|
88
|
+
|
89
|
+
// Swipe Right
|
90
|
+
if (direction === 2 && (x < (-1 * $this.innerWidth() / 2) || velocityX > 0.75)) {
|
91
|
+
swipeRight = true;
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}).bind('panend', function(e) {
|
95
|
+
// Reset if collection is moved back into original position
|
96
|
+
if (Math.abs(e.gesture.deltaX) < ($(this).innerWidth() / 2)) {
|
97
|
+
swipeRight = false;
|
98
|
+
swipeLeft = false;
|
99
|
+
}
|
100
|
+
|
101
|
+
if (e.gesture.pointerType === "touch") {
|
102
|
+
var $this = $(this);
|
103
|
+
if (swipeLeft || swipeRight) {
|
104
|
+
var fullWidth;
|
105
|
+
if (swipeLeft) { fullWidth = $this.innerWidth(); }
|
106
|
+
else { fullWidth = -1 * $this.innerWidth(); }
|
107
|
+
|
108
|
+
$this.velocity({ translateX: fullWidth,
|
109
|
+
}, {duration: 100, queue: false, easing: 'easeOutQuad', complete:
|
110
|
+
function() {
|
111
|
+
$this.css('border', 'none');
|
112
|
+
$this.velocity({ height: 0, padding: 0,
|
113
|
+
}, {duration: 200, queue: false, easing: 'easeOutQuad', complete:
|
114
|
+
function() { $this.remove(); }
|
115
|
+
});
|
116
|
+
}
|
117
|
+
});
|
118
|
+
}
|
119
|
+
else {
|
120
|
+
$this.velocity({ translateX: 0,
|
121
|
+
}, {duration: 100, queue: false, easing: 'easeOutQuad'});
|
122
|
+
}
|
123
|
+
swipeLeft = false;
|
124
|
+
swipeRight = false;
|
125
|
+
}
|
126
|
+
});
|
127
|
+
|
128
|
+
});
|
129
|
+
|
130
|
+
|
131
|
+
// time = 0
|
132
|
+
// // Vertical Staggered list
|
133
|
+
// $('ul.staggered-list.vertical li').velocity(
|
134
|
+
// { translateY: "100px"},
|
135
|
+
// { duration: 0 });
|
136
|
+
|
137
|
+
// $('ul.staggered-list.vertical li').each(function() {
|
138
|
+
// $(this).velocity(
|
139
|
+
// { opacity: "1", translateY: "0"},
|
140
|
+
// { duration: 800, delay: time, easing: [60, 25] });
|
141
|
+
// time += 120;
|
142
|
+
// });
|
143
|
+
|
144
|
+
// // Fade in and Scale
|
145
|
+
// $('.fade-in.scale').velocity(
|
146
|
+
// { scaleX: .4, scaleY: .4, translateX: -600},
|
147
|
+
// { duration: 0});
|
148
|
+
// $('.fade-in').each(function() {
|
149
|
+
// $(this).velocity(
|
150
|
+
// { opacity: "1", scaleX: 1, scaleY: 1, translateX: 0},
|
151
|
+
// { duration: 800, easing: [60, 10] });
|
152
|
+
// });
|
153
|
+
});
|
154
|
+
}( jQuery ));
|
@@ -0,0 +1,5 @@
|
|
1
|
+
/*! VelocityJS.org (1.2.3). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */
|
2
|
+
/*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */
|
3
|
+
/*! Note that this has been modified by Materialize to confirm that Velocity is not already being imported. */
|
4
|
+
jQuery.Velocity?console.log("Velocity is already loaded. You may be needlessly importing Velocity again; note that Materialize includes Velocity."):(!function(e){function t(e){var t=e.length,a=r.type(e);return"function"===a||r.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===a||0===t||"number"==typeof t&&t>0&&t-1 in e}if(!e.jQuery){var r=function(e,t){return new r.fn.init(e,t)};r.isWindow=function(e){return null!=e&&e==e.window},r.type=function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e},r.isArray=Array.isArray||function(e){return"array"===r.type(e)},r.isPlainObject=function(e){var t;if(!e||"object"!==r.type(e)||e.nodeType||r.isWindow(e))return!1;try{if(e.constructor&&!o.call(e,"constructor")&&!o.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(a){return!1}for(t in e);return void 0===t||o.call(e,t)},r.each=function(e,r,a){var n,o=0,i=e.length,s=t(e);if(a){if(s)for(;i>o&&(n=r.apply(e[o],a),n!==!1);o++);else for(o in e)if(n=r.apply(e[o],a),n===!1)break}else if(s)for(;i>o&&(n=r.call(e[o],o,e[o]),n!==!1);o++);else for(o in e)if(n=r.call(e[o],o,e[o]),n===!1)break;return e},r.data=function(e,t,n){if(void 0===n){var o=e[r.expando],i=o&&a[o];if(void 0===t)return i;if(i&&t in i)return i[t]}else if(void 0!==t){var o=e[r.expando]||(e[r.expando]=++r.uuid);return a[o]=a[o]||{},a[o][t]=n,n}},r.removeData=function(e,t){var n=e[r.expando],o=n&&a[n];o&&r.each(t,function(e,t){delete o[t]})},r.extend=function(){var e,t,a,n,o,i,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[l]||{},l++),"object"!=typeof s&&"function"!==r.type(s)&&(s={}),l===u&&(s=this,l--);u>l;l++)if(null!=(o=arguments[l]))for(n in o)e=s[n],a=o[n],s!==a&&(c&&a&&(r.isPlainObject(a)||(t=r.isArray(a)))?(t?(t=!1,i=e&&r.isArray(e)?e:[]):i=e&&r.isPlainObject(e)?e:{},s[n]=r.extend(c,i,a)):void 0!==a&&(s[n]=a));return s},r.queue=function(e,a,n){function o(e,r){var a=r||[];return null!=e&&(t(Object(e))?!function(e,t){for(var r=+t.length,a=0,n=e.length;r>a;)e[n++]=t[a++];if(r!==r)for(;void 0!==t[a];)e[n++]=t[a++];return e.length=n,e}(a,"string"==typeof e?[e]:e):[].push.call(a,e)),a}if(e){a=(a||"fx")+"queue";var i=r.data(e,a);return n?(!i||r.isArray(n)?i=r.data(e,a,o(n)):i.push(n),i):i||[]}},r.dequeue=function(e,t){r.each(e.nodeType?[e]:e,function(e,a){t=t||"fx";var n=r.queue(a,t),o=n.shift();"inprogress"===o&&(o=n.shift()),o&&("fx"===t&&n.unshift("inprogress"),o.call(a,function(){r.dequeue(a,t)}))})},r.fn=r.prototype={init:function(e){if(e.nodeType)return this[0]=e,this;throw new Error("Not a DOM node.")},offset:function(){var t=this[0].getBoundingClientRect?this[0].getBoundingClientRect():{top:0,left:0};return{top:t.top+(e.pageYOffset||document.scrollTop||0)-(document.clientTop||0),left:t.left+(e.pageXOffset||document.scrollLeft||0)-(document.clientLeft||0)}},position:function(){function e(){for(var e=this.offsetParent||document;e&&"html"===!e.nodeType.toLowerCase&&"static"===e.style.position;)e=e.offsetParent;return e||document}var t=this[0],e=e.apply(t),a=this.offset(),n=/^(?:body|html)$/i.test(e.nodeName)?{top:0,left:0}:r(e).offset();return a.top-=parseFloat(t.style.marginTop)||0,a.left-=parseFloat(t.style.marginLeft)||0,e.style&&(n.top+=parseFloat(e.style.borderTopWidth)||0,n.left+=parseFloat(e.style.borderLeftWidth)||0),{top:a.top-n.top,left:a.left-n.left}}};var a={};r.expando="velocity"+(new Date).getTime(),r.uuid=0;for(var n={},o=n.hasOwnProperty,i=n.toString,s="Boolean Number String Function Array Date RegExp Object Error".split(" "),l=0;l<s.length;l++)n["[object "+s[l]+"]"]=s[l].toLowerCase();r.fn.init.prototype=r.fn,e.Velocity={Utilities:r}}}(window),function(e){"object"==typeof module&&"object"==typeof module.exports?module.exports=e():"function"==typeof define&&define.amd?define(e):e()}(function(){return function(e,t,r,a){function n(e){for(var t=-1,r=e?e.length:0,a=[];++t<r;){var n=e[t];n&&a.push(n)}return a}function o(e){return m.isWrapped(e)?e=[].slice.call(e):m.isNode(e)&&(e=[e]),e}function i(e){var t=f.data(e,"velocity");return null===t?a:t}function s(e){return function(t){return Math.round(t*e)*(1/e)}}function l(e,r,a,n){function o(e,t){return 1-3*t+3*e}function i(e,t){return 3*t-6*e}function s(e){return 3*e}function l(e,t,r){return((o(t,r)*e+i(t,r))*e+s(t))*e}function u(e,t,r){return 3*o(t,r)*e*e+2*i(t,r)*e+s(t)}function c(t,r){for(var n=0;m>n;++n){var o=u(r,e,a);if(0===o)return r;var i=l(r,e,a)-t;r-=i/o}return r}function p(){for(var t=0;b>t;++t)w[t]=l(t*x,e,a)}function f(t,r,n){var o,i,s=0;do i=r+(n-r)/2,o=l(i,e,a)-t,o>0?n=i:r=i;while(Math.abs(o)>h&&++s<v);return i}function d(t){for(var r=0,n=1,o=b-1;n!=o&&w[n]<=t;++n)r+=x;--n;var i=(t-w[n])/(w[n+1]-w[n]),s=r+i*x,l=u(s,e,a);return l>=y?c(t,s):0==l?s:f(t,r,r+x)}function g(){V=!0,(e!=r||a!=n)&&p()}var m=4,y=.001,h=1e-7,v=10,b=11,x=1/(b-1),S="Float32Array"in t;if(4!==arguments.length)return!1;for(var P=0;4>P;++P)if("number"!=typeof arguments[P]||isNaN(arguments[P])||!isFinite(arguments[P]))return!1;e=Math.min(e,1),a=Math.min(a,1),e=Math.max(e,0),a=Math.max(a,0);var w=S?new Float32Array(b):new Array(b),V=!1,C=function(t){return V||g(),e===r&&a===n?t:0===t?0:1===t?1:l(d(t),r,n)};C.getControlPoints=function(){return[{x:e,y:r},{x:a,y:n}]};var T="generateBezier("+[e,r,a,n]+")";return C.toString=function(){return T},C}function u(e,t){var r=e;return m.isString(e)?b.Easings[e]||(r=!1):r=m.isArray(e)&&1===e.length?s.apply(null,e):m.isArray(e)&&2===e.length?x.apply(null,e.concat([t])):m.isArray(e)&&4===e.length?l.apply(null,e):!1,r===!1&&(r=b.Easings[b.defaults.easing]?b.defaults.easing:v),r}function c(e){if(e){var t=(new Date).getTime(),r=b.State.calls.length;r>1e4&&(b.State.calls=n(b.State.calls));for(var o=0;r>o;o++)if(b.State.calls[o]){var s=b.State.calls[o],l=s[0],u=s[2],d=s[3],g=!!d,y=null;d||(d=b.State.calls[o][3]=t-16);for(var h=Math.min((t-d)/u.duration,1),v=0,x=l.length;x>v;v++){var P=l[v],V=P.element;if(i(V)){var C=!1;if(u.display!==a&&null!==u.display&&"none"!==u.display){if("flex"===u.display){var T=["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex"];f.each(T,function(e,t){S.setPropertyValue(V,"display",t)})}S.setPropertyValue(V,"display",u.display)}u.visibility!==a&&"hidden"!==u.visibility&&S.setPropertyValue(V,"visibility",u.visibility);for(var k in P)if("element"!==k){var A,F=P[k],j=m.isString(F.easing)?b.Easings[F.easing]:F.easing;if(1===h)A=F.endValue;else{var E=F.endValue-F.startValue;if(A=F.startValue+E*j(h,u,E),!g&&A===F.currentValue)continue}if(F.currentValue=A,"tween"===k)y=A;else{if(S.Hooks.registered[k]){var H=S.Hooks.getRoot(k),N=i(V).rootPropertyValueCache[H];N&&(F.rootPropertyValue=N)}var L=S.setPropertyValue(V,k,F.currentValue+(0===parseFloat(A)?"":F.unitType),F.rootPropertyValue,F.scrollData);S.Hooks.registered[k]&&(i(V).rootPropertyValueCache[H]=S.Normalizations.registered[H]?S.Normalizations.registered[H]("extract",null,L[1]):L[1]),"transform"===L[0]&&(C=!0)}}u.mobileHA&&i(V).transformCache.translate3d===a&&(i(V).transformCache.translate3d="(0px, 0px, 0px)",C=!0),C&&S.flushTransformCache(V)}}u.display!==a&&"none"!==u.display&&(b.State.calls[o][2].display=!1),u.visibility!==a&&"hidden"!==u.visibility&&(b.State.calls[o][2].visibility=!1),u.progress&&u.progress.call(s[1],s[1],h,Math.max(0,d+u.duration-t),d,y),1===h&&p(o)}}b.State.isTicking&&w(c)}function p(e,t){if(!b.State.calls[e])return!1;for(var r=b.State.calls[e][0],n=b.State.calls[e][1],o=b.State.calls[e][2],s=b.State.calls[e][4],l=!1,u=0,c=r.length;c>u;u++){var p=r[u].element;if(t||o.loop||("none"===o.display&&S.setPropertyValue(p,"display",o.display),"hidden"===o.visibility&&S.setPropertyValue(p,"visibility",o.visibility)),o.loop!==!0&&(f.queue(p)[1]===a||!/\.velocityQueueEntryFlag/i.test(f.queue(p)[1]))&&i(p)){i(p).isAnimating=!1,i(p).rootPropertyValueCache={};var d=!1;f.each(S.Lists.transforms3D,function(e,t){var r=/^scale/.test(t)?1:0,n=i(p).transformCache[t];i(p).transformCache[t]!==a&&new RegExp("^\\("+r+"[^.]").test(n)&&(d=!0,delete i(p).transformCache[t])}),o.mobileHA&&(d=!0,delete i(p).transformCache.translate3d),d&&S.flushTransformCache(p),S.Values.removeClass(p,"velocity-animating")}if(!t&&o.complete&&!o.loop&&u===c-1)try{o.complete.call(n,n)}catch(g){setTimeout(function(){throw g},1)}s&&o.loop!==!0&&s(n),i(p)&&o.loop===!0&&!t&&(f.each(i(p).tweensContainer,function(e,t){/^rotate/.test(e)&&360===parseFloat(t.endValue)&&(t.endValue=0,t.startValue=360),/^backgroundPosition/.test(e)&&100===parseFloat(t.endValue)&&"%"===t.unitType&&(t.endValue=0,t.startValue=100)}),b(p,"reverse",{loop:!0,delay:o.delay})),o.queue!==!1&&f.dequeue(p,o.queue)}b.State.calls[e]=!1;for(var m=0,y=b.State.calls.length;y>m;m++)if(b.State.calls[m]!==!1){l=!0;break}l===!1&&(b.State.isTicking=!1,delete b.State.calls,b.State.calls=[])}var f,d=function(){if(r.documentMode)return r.documentMode;for(var e=7;e>4;e--){var t=r.createElement("div");if(t.innerHTML="<!--[if IE "+e+"]><span></span><![endif]-->",t.getElementsByTagName("span").length)return t=null,e}return a}(),g=function(){var e=0;return t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||function(t){var r,a=(new Date).getTime();return r=Math.max(0,16-(a-e)),e=a+r,setTimeout(function(){t(a+r)},r)}}(),m={isString:function(e){return"string"==typeof e},isArray:Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},isFunction:function(e){return"[object Function]"===Object.prototype.toString.call(e)},isNode:function(e){return e&&e.nodeType},isNodeList:function(e){return"object"==typeof e&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(e))&&e.length!==a&&(0===e.length||"object"==typeof e[0]&&e[0].nodeType>0)},isWrapped:function(e){return e&&(e.jquery||t.Zepto&&t.Zepto.zepto.isZ(e))},isSVG:function(e){return t.SVGElement&&e instanceof t.SVGElement},isEmptyObject:function(e){for(var t in e)return!1;return!0}},y=!1;if(e.fn&&e.fn.jquery?(f=e,y=!0):f=t.Velocity.Utilities,8>=d&&!y)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(7>=d)return void(jQuery.fn.velocity=jQuery.fn.animate);var h=400,v="swing",b={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isAndroid:/Android/i.test(navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(navigator.userAgent),isChrome:t.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:r.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[]},CSS:{},Utilities:f,Redirects:{},Easings:{},Promise:t.Promise,defaults:{queue:"",duration:h,easing:v,begin:a,complete:a,progress:a,display:a,visibility:a,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0},init:function(e){f.data(e,"velocity",{isSVG:m.isSVG(e),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:2,patch:2},debug:!1};t.pageYOffset!==a?(b.State.scrollAnchor=t,b.State.scrollPropertyLeft="pageXOffset",b.State.scrollPropertyTop="pageYOffset"):(b.State.scrollAnchor=r.documentElement||r.body.parentNode||r.body,b.State.scrollPropertyLeft="scrollLeft",b.State.scrollPropertyTop="scrollTop");var x=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,r,a){var n={x:t.x+a.dx*r,v:t.v+a.dv*r,tension:t.tension,friction:t.friction};return{dx:n.v,dv:e(n)}}function r(r,a){var n={dx:r.v,dv:e(r)},o=t(r,.5*a,n),i=t(r,.5*a,o),s=t(r,a,i),l=1/6*(n.dx+2*(o.dx+i.dx)+s.dx),u=1/6*(n.dv+2*(o.dv+i.dv)+s.dv);return r.x=r.x+l*a,r.v=r.v+u*a,r}return function a(e,t,n){var o,i,s,l={x:-1,v:0,tension:null,friction:null},u=[0],c=0,p=1e-4,f=.016;for(e=parseFloat(e)||500,t=parseFloat(t)||20,n=n||null,l.tension=e,l.friction=t,o=null!==n,o?(c=a(e,t),i=c/n*f):i=f;s=r(s||l,i),u.push(1+s.x),c+=16,Math.abs(s.x)>p&&Math.abs(s.v)>p;);return o?function(e){return u[e*(u.length-1)|0]}:c}}();b.Easings={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},spring:function(e){return 1-Math.cos(4.5*e*Math.PI)*Math.exp(6*-e)}},f.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],function(e,t){b.Easings[t[0]]=l.apply(null,t[1])});var S=b.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"]},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var e=0;e<S.Lists.colors.length;e++){var t="color"===S.Lists.colors[e]?"0 0 0 1":"255 255 255 1";S.Hooks.templates[S.Lists.colors[e]]=["Red Green Blue Alpha",t]}var r,a,n;if(d)for(r in S.Hooks.templates){a=S.Hooks.templates[r],n=a[0].split(" ");var o=a[1].match(S.RegEx.valueSplit);"Color"===n[0]&&(n.push(n.shift()),o.push(o.shift()),S.Hooks.templates[r]=[n.join(" "),o.join(" ")])}for(r in S.Hooks.templates){a=S.Hooks.templates[r],n=a[0].split(" ");for(var e in n){var i=r+n[e],s=e;S.Hooks.registered[i]=[r,s]}}},getRoot:function(e){var t=S.Hooks.registered[e];return t?t[0]:e},cleanRootPropertyValue:function(e,t){return S.RegEx.valueUnwrap.test(t)&&(t=t.match(S.RegEx.valueUnwrap)[1]),S.Values.isCSSNullValue(t)&&(t=S.Hooks.templates[e][1]),t},extractValue:function(e,t){var r=S.Hooks.registered[e];if(r){var a=r[0],n=r[1];return t=S.Hooks.cleanRootPropertyValue(a,t),t.toString().match(S.RegEx.valueSplit)[n]}return t},injectValue:function(e,t,r){var a=S.Hooks.registered[e];if(a){var n,o,i=a[0],s=a[1];return r=S.Hooks.cleanRootPropertyValue(i,r),n=r.toString().match(S.RegEx.valueSplit),n[s]=t,o=n.join(" ")}return r}},Normalizations:{registered:{clip:function(e,t,r){switch(e){case"name":return"clip";case"extract":var a;return S.RegEx.wrappedValueAlreadyExtracted.test(r)?a=r:(a=r.toString().match(S.RegEx.valueUnwrap),a=a?a[1].replace(/,(\s+)?/g," "):r),a;case"inject":return"rect("+r+")"}},blur:function(e,t,r){switch(e){case"name":return b.State.isFirefox?"filter":"-webkit-filter";case"extract":var a=parseFloat(r);if(!a&&0!==a){var n=r.toString().match(/blur\(([0-9]+[A-z]+)\)/i);a=n?n[1]:0}return a;case"inject":return parseFloat(r)?"blur("+r+")":"none"}},opacity:function(e,t,r){if(8>=d)switch(e){case"name":return"filter";case"extract":var a=r.toString().match(/alpha\(opacity=(.*)\)/i);return r=a?a[1]/100:1;case"inject":return t.style.zoom=1,parseFloat(r)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(r),10)+")"}else switch(e){case"name":return"opacity";case"extract":return r;case"inject":return r}}},register:function(){9>=d||b.State.isGingerbread||(S.Lists.transformsBase=S.Lists.transformsBase.concat(S.Lists.transforms3D));for(var e=0;e<S.Lists.transformsBase.length;e++)!function(){var t=S.Lists.transformsBase[e];S.Normalizations.registered[t]=function(e,r,n){switch(e){case"name":return"transform";case"extract":return i(r)===a||i(r).transformCache[t]===a?/^scale/i.test(t)?1:0:i(r).transformCache[t].replace(/[()]/g,"");case"inject":var o=!1;switch(t.substr(0,t.length-1)){case"translate":o=!/(%|px|em|rem|vw|vh|\d)$/i.test(n);break;case"scal":case"scale":b.State.isAndroid&&i(r).transformCache[t]===a&&1>n&&(n=1),o=!/(\d)$/i.test(n);break;case"skew":o=!/(deg|\d)$/i.test(n);break;case"rotate":o=!/(deg|\d)$/i.test(n)}return o||(i(r).transformCache[t]="("+n+")"),i(r).transformCache[t]}}}();for(var e=0;e<S.Lists.colors.length;e++)!function(){var t=S.Lists.colors[e];S.Normalizations.registered[t]=function(e,r,n){switch(e){case"name":return t;case"extract":var o;if(S.RegEx.wrappedValueAlreadyExtracted.test(n))o=n;else{var i,s={black:"rgb(0, 0, 0)",blue:"rgb(0, 0, 255)",gray:"rgb(128, 128, 128)",green:"rgb(0, 128, 0)",red:"rgb(255, 0, 0)",white:"rgb(255, 255, 255)"};/^[A-z]+$/i.test(n)?i=s[n]!==a?s[n]:s.black:S.RegEx.isHex.test(n)?i="rgb("+S.Values.hexToRgb(n).join(" ")+")":/^rgba?\(/i.test(n)||(i=s.black),o=(i||n).toString().match(S.RegEx.valueUnwrap)[1].replace(/,(\s+)?/g," ")}return 8>=d||3!==o.split(" ").length||(o+=" 1"),o;case"inject":return 8>=d?4===n.split(" ").length&&(n=n.split(/\s+/).slice(0,3).join(" ")):3===n.split(" ").length&&(n+=" 1"),(8>=d?"rgb":"rgba")+"("+n.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}()}},Names:{camelCase:function(e){return e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()})},SVGAttribute:function(e){var t="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(d||b.State.isAndroid&&!b.State.isChrome)&&(t+="|transform"),new RegExp("^("+t+")$","i").test(e)},prefixCheck:function(e){if(b.State.prefixMatches[e])return[b.State.prefixMatches[e],!0];for(var t=["","Webkit","Moz","ms","O"],r=0,a=t.length;a>r;r++){var n;if(n=0===r?e:t[r]+e.replace(/^\w/,function(e){return e.toUpperCase()}),m.isString(b.State.prefixElement.style[n]))return b.State.prefixMatches[e]=n,[n,!0]}return[e,!1]}},Values:{hexToRgb:function(e){var t,r=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;return e=e.replace(r,function(e,t,r,a){return t+t+r+r+a+a}),t=a.exec(e),t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:[0,0,0]},isCSSNullValue:function(e){return 0==e||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(e)},getUnitType:function(e){return/^(rotate|skew)/i.test(e)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(e)?"":"px"},getDisplayType:function(e){var t=e&&e.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(t)?"inline":/^(li)$/i.test(t)?"list-item":/^(tr)$/i.test(t)?"table-row":/^(table)$/i.test(t)?"table":/^(tbody)$/i.test(t)?"table-row-group":"block"},addClass:function(e,t){e.classList?e.classList.add(t):e.className+=(e.className.length?" ":"")+t},removeClass:function(e,t){e.classList?e.classList.remove(t):e.className=e.className.toString().replace(new RegExp("(^|\\s)"+t.split(" ").join("|")+"(\\s|$)","gi")," ")}},getPropertyValue:function(e,r,n,o){function s(e,r){function n(){u&&S.setPropertyValue(e,"display","none")}var l=0;if(8>=d)l=f.css(e,r);else{var u=!1;if(/^(width|height)$/.test(r)&&0===S.getPropertyValue(e,"display")&&(u=!0,S.setPropertyValue(e,"display",S.Values.getDisplayType(e))),!o){if("height"===r&&"border-box"!==S.getPropertyValue(e,"boxSizing").toString().toLowerCase()){var c=e.offsetHeight-(parseFloat(S.getPropertyValue(e,"borderTopWidth"))||0)-(parseFloat(S.getPropertyValue(e,"borderBottomWidth"))||0)-(parseFloat(S.getPropertyValue(e,"paddingTop"))||0)-(parseFloat(S.getPropertyValue(e,"paddingBottom"))||0);return n(),c}if("width"===r&&"border-box"!==S.getPropertyValue(e,"boxSizing").toString().toLowerCase()){var p=e.offsetWidth-(parseFloat(S.getPropertyValue(e,"borderLeftWidth"))||0)-(parseFloat(S.getPropertyValue(e,"borderRightWidth"))||0)-(parseFloat(S.getPropertyValue(e,"paddingLeft"))||0)-(parseFloat(S.getPropertyValue(e,"paddingRight"))||0);return n(),p}}var g;g=i(e)===a?t.getComputedStyle(e,null):i(e).computedStyle?i(e).computedStyle:i(e).computedStyle=t.getComputedStyle(e,null),"borderColor"===r&&(r="borderTopColor"),l=9===d&&"filter"===r?g.getPropertyValue(r):g[r],(""===l||null===l)&&(l=e.style[r]),n()}if("auto"===l&&/^(top|right|bottom|left)$/i.test(r)){var m=s(e,"position");("fixed"===m||"absolute"===m&&/top|left/i.test(r))&&(l=f(e).position()[r]+"px")}return l}var l;if(S.Hooks.registered[r]){var u=r,c=S.Hooks.getRoot(u);n===a&&(n=S.getPropertyValue(e,S.Names.prefixCheck(c)[0])),S.Normalizations.registered[c]&&(n=S.Normalizations.registered[c]("extract",e,n)),l=S.Hooks.extractValue(u,n)}else if(S.Normalizations.registered[r]){var p,g;p=S.Normalizations.registered[r]("name",e),"transform"!==p&&(g=s(e,S.Names.prefixCheck(p)[0]),S.Values.isCSSNullValue(g)&&S.Hooks.templates[r]&&(g=S.Hooks.templates[r][1])),l=S.Normalizations.registered[r]("extract",e,g)}if(!/^[\d-]/.test(l))if(i(e)&&i(e).isSVG&&S.Names.SVGAttribute(r))if(/^(height|width)$/i.test(r))try{l=e.getBBox()[r]}catch(m){l=0}else l=e.getAttribute(r);else l=s(e,S.Names.prefixCheck(r)[0]);return S.Values.isCSSNullValue(l)&&(l=0),b.debug>=2&&console.log("Get "+r+": "+l),l},setPropertyValue:function(e,r,a,n,o){var s=r;if("scroll"===r)o.container?o.container["scroll"+o.direction]=a:"Left"===o.direction?t.scrollTo(a,o.alternateValue):t.scrollTo(o.alternateValue,a);else if(S.Normalizations.registered[r]&&"transform"===S.Normalizations.registered[r]("name",e))S.Normalizations.registered[r]("inject",e,a),s="transform",a=i(e).transformCache[r];else{if(S.Hooks.registered[r]){var l=r,u=S.Hooks.getRoot(r);n=n||S.getPropertyValue(e,u),a=S.Hooks.injectValue(l,a,n),r=u}if(S.Normalizations.registered[r]&&(a=S.Normalizations.registered[r]("inject",e,a),r=S.Normalizations.registered[r]("name",e)),s=S.Names.prefixCheck(r)[0],8>=d)try{e.style[s]=a}catch(c){b.debug&&console.log("Browser does not support ["+a+"] for ["+s+"]")}else i(e)&&i(e).isSVG&&S.Names.SVGAttribute(r)?e.setAttribute(r,a):e.style[s]=a;b.debug>=2&&console.log("Set "+r+" ("+s+"): "+a)}return[s,a]},flushTransformCache:function(e){function t(t){return parseFloat(S.getPropertyValue(e,t))}var r="";if((d||b.State.isAndroid&&!b.State.isChrome)&&i(e).isSVG){var a={translate:[t("translateX"),t("translateY")],skewX:[t("skewX")],skewY:[t("skewY")],scale:1!==t("scale")?[t("scale"),t("scale")]:[t("scaleX"),t("scaleY")],rotate:[t("rotateZ"),0,0]};f.each(i(e).transformCache,function(e){/^translate/i.test(e)?e="translate":/^scale/i.test(e)?e="scale":/^rotate/i.test(e)&&(e="rotate"),a[e]&&(r+=e+"("+a[e].join(" ")+") ",delete a[e])})}else{var n,o;f.each(i(e).transformCache,function(t){return n=i(e).transformCache[t],"transformPerspective"===t?(o=n,!0):(9===d&&"rotateZ"===t&&(t="rotate"),void(r+=t+n+" "))}),o&&(r="perspective"+o+" "+r)}S.setPropertyValue(e,"transform",r)}};S.Hooks.register(),S.Normalizations.register(),b.hook=function(e,t,r){var n=a;return e=o(e),f.each(e,function(e,o){if(i(o)===a&&b.init(o),r===a)n===a&&(n=b.CSS.getPropertyValue(o,t));else{var s=b.CSS.setPropertyValue(o,t,r);"transform"===s[0]&&b.CSS.flushTransformCache(o),n=s}}),n};var P=function(){function e(){return s?k.promise||null:l}function n(){function e(e){function p(e,t){var r=a,n=a,i=a;return m.isArray(e)?(r=e[0],!m.isArray(e[1])&&/^[\d-]/.test(e[1])||m.isFunction(e[1])||S.RegEx.isHex.test(e[1])?i=e[1]:(m.isString(e[1])&&!S.RegEx.isHex.test(e[1])||m.isArray(e[1]))&&(n=t?e[1]:u(e[1],s.duration),e[2]!==a&&(i=e[2]))):r=e,t||(n=n||s.easing),m.isFunction(r)&&(r=r.call(o,V,w)),m.isFunction(i)&&(i=i.call(o,V,w)),[r||0,n,i]}function d(e,t){var r,a;return a=(t||"0").toString().toLowerCase().replace(/[%A-z]+$/,function(e){return r=e,""}),r||(r=S.Values.getUnitType(e)),[a,r]}function h(){var e={myParent:o.parentNode||r.body,position:S.getPropertyValue(o,"position"),fontSize:S.getPropertyValue(o,"fontSize")},a=e.position===L.lastPosition&&e.myParent===L.lastParent,n=e.fontSize===L.lastFontSize;L.lastParent=e.myParent,L.lastPosition=e.position,L.lastFontSize=e.fontSize;var s=100,l={};if(n&&a)l.emToPx=L.lastEmToPx,l.percentToPxWidth=L.lastPercentToPxWidth,l.percentToPxHeight=L.lastPercentToPxHeight;else{var u=i(o).isSVG?r.createElementNS("http://www.w3.org/2000/svg","rect"):r.createElement("div");b.init(u),e.myParent.appendChild(u),f.each(["overflow","overflowX","overflowY"],function(e,t){b.CSS.setPropertyValue(u,t,"hidden")}),b.CSS.setPropertyValue(u,"position",e.position),b.CSS.setPropertyValue(u,"fontSize",e.fontSize),b.CSS.setPropertyValue(u,"boxSizing","content-box"),f.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],function(e,t){b.CSS.setPropertyValue(u,t,s+"%")}),b.CSS.setPropertyValue(u,"paddingLeft",s+"em"),l.percentToPxWidth=L.lastPercentToPxWidth=(parseFloat(S.getPropertyValue(u,"width",null,!0))||1)/s,l.percentToPxHeight=L.lastPercentToPxHeight=(parseFloat(S.getPropertyValue(u,"height",null,!0))||1)/s,l.emToPx=L.lastEmToPx=(parseFloat(S.getPropertyValue(u,"paddingLeft"))||1)/s,e.myParent.removeChild(u)}return null===L.remToPx&&(L.remToPx=parseFloat(S.getPropertyValue(r.body,"fontSize"))||16),null===L.vwToPx&&(L.vwToPx=parseFloat(t.innerWidth)/100,L.vhToPx=parseFloat(t.innerHeight)/100),l.remToPx=L.remToPx,l.vwToPx=L.vwToPx,l.vhToPx=L.vhToPx,b.debug>=1&&console.log("Unit ratios: "+JSON.stringify(l),o),l}if(s.begin&&0===V)try{s.begin.call(g,g)}catch(x){setTimeout(function(){throw x},1)}if("scroll"===A){var P,C,T,F=/^x$/i.test(s.axis)?"Left":"Top",j=parseFloat(s.offset)||0;s.container?m.isWrapped(s.container)||m.isNode(s.container)?(s.container=s.container[0]||s.container,P=s.container["scroll"+F],T=P+f(o).position()[F.toLowerCase()]+j):s.container=null:(P=b.State.scrollAnchor[b.State["scrollProperty"+F]],C=b.State.scrollAnchor[b.State["scrollProperty"+("Left"===F?"Top":"Left")]],T=f(o).offset()[F.toLowerCase()]+j),l={scroll:{rootPropertyValue:!1,startValue:P,currentValue:P,endValue:T,unitType:"",easing:s.easing,scrollData:{container:s.container,direction:F,alternateValue:C}},element:o},b.debug&&console.log("tweensContainer (scroll): ",l.scroll,o)}else if("reverse"===A){if(!i(o).tweensContainer)return void f.dequeue(o,s.queue);"none"===i(o).opts.display&&(i(o).opts.display="auto"),"hidden"===i(o).opts.visibility&&(i(o).opts.visibility="visible"),i(o).opts.loop=!1,i(o).opts.begin=null,i(o).opts.complete=null,v.easing||delete s.easing,v.duration||delete s.duration,s=f.extend({},i(o).opts,s);var E=f.extend(!0,{},i(o).tweensContainer);for(var H in E)if("element"!==H){var N=E[H].startValue;E[H].startValue=E[H].currentValue=E[H].endValue,E[H].endValue=N,m.isEmptyObject(v)||(E[H].easing=s.easing),b.debug&&console.log("reverse tweensContainer ("+H+"): "+JSON.stringify(E[H]),o)}l=E}else if("start"===A){var E;i(o).tweensContainer&&i(o).isAnimating===!0&&(E=i(o).tweensContainer),f.each(y,function(e,t){if(RegExp("^"+S.Lists.colors.join("$|^")+"$").test(e)){var r=p(t,!0),n=r[0],o=r[1],i=r[2];if(S.RegEx.isHex.test(n)){for(var s=["Red","Green","Blue"],l=S.Values.hexToRgb(n),u=i?S.Values.hexToRgb(i):a,c=0;c<s.length;c++){var f=[l[c]];o&&f.push(o),u!==a&&f.push(u[c]),y[e+s[c]]=f}delete y[e]}}});for(var z in y){var O=p(y[z]),q=O[0],$=O[1],M=O[2];z=S.Names.camelCase(z);var I=S.Hooks.getRoot(z),B=!1;if(i(o).isSVG||"tween"===I||S.Names.prefixCheck(I)[1]!==!1||S.Normalizations.registered[I]!==a){(s.display!==a&&null!==s.display&&"none"!==s.display||s.visibility!==a&&"hidden"!==s.visibility)&&/opacity|filter/.test(z)&&!M&&0!==q&&(M=0),s._cacheValues&&E&&E[z]?(M===a&&(M=E[z].endValue+E[z].unitType),B=i(o).rootPropertyValueCache[I]):S.Hooks.registered[z]?M===a?(B=S.getPropertyValue(o,I),M=S.getPropertyValue(o,z,B)):B=S.Hooks.templates[I][1]:M===a&&(M=S.getPropertyValue(o,z));var W,G,Y,D=!1;if(W=d(z,M),M=W[0],Y=W[1],W=d(z,q),q=W[0].replace(/^([+-\/*])=/,function(e,t){return D=t,""}),G=W[1],M=parseFloat(M)||0,q=parseFloat(q)||0,"%"===G&&(/^(fontSize|lineHeight)$/.test(z)?(q/=100,G="em"):/^scale/.test(z)?(q/=100,G=""):/(Red|Green|Blue)$/i.test(z)&&(q=q/100*255,G="")),/[\/*]/.test(D))G=Y;else if(Y!==G&&0!==M)if(0===q)G=Y;else{n=n||h();var Q=/margin|padding|left|right|width|text|word|letter/i.test(z)||/X$/.test(z)||"x"===z?"x":"y";switch(Y){case"%":M*="x"===Q?n.percentToPxWidth:n.percentToPxHeight;break;case"px":break;default:M*=n[Y+"ToPx"]}switch(G){case"%":M*=1/("x"===Q?n.percentToPxWidth:n.percentToPxHeight);break;case"px":break;default:M*=1/n[G+"ToPx"]}}switch(D){case"+":q=M+q;break;case"-":q=M-q;break;case"*":q=M*q;break;case"/":q=M/q}l[z]={rootPropertyValue:B,startValue:M,currentValue:M,endValue:q,unitType:G,easing:$},b.debug&&console.log("tweensContainer ("+z+"): "+JSON.stringify(l[z]),o)}else b.debug&&console.log("Skipping ["+I+"] due to a lack of browser support.")}l.element=o}l.element&&(S.Values.addClass(o,"velocity-animating"),R.push(l),""===s.queue&&(i(o).tweensContainer=l,i(o).opts=s),i(o).isAnimating=!0,V===w-1?(b.State.calls.push([R,g,s,null,k.resolver]),b.State.isTicking===!1&&(b.State.isTicking=!0,c())):V++)}var n,o=this,s=f.extend({},b.defaults,v),l={};switch(i(o)===a&&b.init(o),parseFloat(s.delay)&&s.queue!==!1&&f.queue(o,s.queue,function(e){b.velocityQueueEntryFlag=!0,i(o).delayTimer={setTimeout:setTimeout(e,parseFloat(s.delay)),next:e}}),s.duration.toString().toLowerCase()){case"fast":s.duration=200;break;case"normal":s.duration=h;break;case"slow":s.duration=600;break;default:s.duration=parseFloat(s.duration)||1}b.mock!==!1&&(b.mock===!0?s.duration=s.delay=1:(s.duration*=parseFloat(b.mock)||1,s.delay*=parseFloat(b.mock)||1)),s.easing=u(s.easing,s.duration),s.begin&&!m.isFunction(s.begin)&&(s.begin=null),s.progress&&!m.isFunction(s.progress)&&(s.progress=null),s.complete&&!m.isFunction(s.complete)&&(s.complete=null),s.display!==a&&null!==s.display&&(s.display=s.display.toString().toLowerCase(),"auto"===s.display&&(s.display=b.CSS.Values.getDisplayType(o))),s.visibility!==a&&null!==s.visibility&&(s.visibility=s.visibility.toString().toLowerCase()),s.mobileHA=s.mobileHA&&b.State.isMobile&&!b.State.isGingerbread,s.queue===!1?s.delay?setTimeout(e,s.delay):e():f.queue(o,s.queue,function(t,r){return r===!0?(k.promise&&k.resolver(g),!0):(b.velocityQueueEntryFlag=!0,void e(t))}),""!==s.queue&&"fx"!==s.queue||"inprogress"===f.queue(o)[0]||f.dequeue(o)}var s,l,d,g,y,v,x=arguments[0]&&(arguments[0].p||f.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||m.isString(arguments[0].properties));if(m.isWrapped(this)?(s=!1,d=0,g=this,l=this):(s=!0,d=1,g=x?arguments[0].elements||arguments[0].e:arguments[0]),g=o(g)){x?(y=arguments[0].properties||arguments[0].p,v=arguments[0].options||arguments[0].o):(y=arguments[d],v=arguments[d+1]);var w=g.length,V=0;if(!/^(stop|finish)$/i.test(y)&&!f.isPlainObject(v)){var C=d+1;v={};for(var T=C;T<arguments.length;T++)m.isArray(arguments[T])||!/^(fast|normal|slow)$/i.test(arguments[T])&&!/^\d/.test(arguments[T])?m.isString(arguments[T])||m.isArray(arguments[T])?v.easing=arguments[T]:m.isFunction(arguments[T])&&(v.complete=arguments[T]):v.duration=arguments[T]}var k={promise:null,resolver:null,rejecter:null};s&&b.Promise&&(k.promise=new b.Promise(function(e,t){k.resolver=e,k.rejecter=t}));var A;switch(y){case"scroll":A="scroll";break;case"reverse":A="reverse";break;case"finish":case"stop":f.each(g,function(e,t){i(t)&&i(t).delayTimer&&(clearTimeout(i(t).delayTimer.setTimeout),i(t).delayTimer.next&&i(t).delayTimer.next(),delete i(t).delayTimer)});var F=[];return f.each(b.State.calls,function(e,t){t&&f.each(t[1],function(r,n){var o=v===a?"":v;return o===!0||t[2].queue===o||v===a&&t[2].queue===!1?void f.each(g,function(r,a){a===n&&((v===!0||m.isString(v))&&(f.each(f.queue(a,m.isString(v)?v:""),function(e,t){
|
5
|
+
m.isFunction(t)&&t(null,!0)}),f.queue(a,m.isString(v)?v:"",[])),"stop"===y?(i(a)&&i(a).tweensContainer&&o!==!1&&f.each(i(a).tweensContainer,function(e,t){t.endValue=t.currentValue}),F.push(e)):"finish"===y&&(t[2].duration=1))}):!0})}),"stop"===y&&(f.each(F,function(e,t){p(t,!0)}),k.promise&&k.resolver(g)),e();default:if(!f.isPlainObject(y)||m.isEmptyObject(y)){if(m.isString(y)&&b.Redirects[y]){var j=f.extend({},v),E=j.duration,H=j.delay||0;return j.backwards===!0&&(g=f.extend(!0,[],g).reverse()),f.each(g,function(e,t){parseFloat(j.stagger)?j.delay=H+parseFloat(j.stagger)*e:m.isFunction(j.stagger)&&(j.delay=H+j.stagger.call(t,e,w)),j.drag&&(j.duration=parseFloat(E)||(/^(callout|transition)/.test(y)?1e3:h),j.duration=Math.max(j.duration*(j.backwards?1-e/w:(e+1)/w),.75*j.duration,200)),b.Redirects[y].call(t,t,j||{},e,w,g,k.promise?k:a)}),e()}var N="Velocity: First argument ("+y+") was not a property map, a known action, or a registered redirect. Aborting.";return k.promise?k.rejecter(new Error(N)):console.log(N),e()}A="start"}var L={lastParent:null,lastPosition:null,lastFontSize:null,lastPercentToPxWidth:null,lastPercentToPxHeight:null,lastEmToPx:null,remToPx:null,vwToPx:null,vhToPx:null},R=[];f.each(g,function(e,t){m.isNode(t)&&n.call(t)});var z,j=f.extend({},b.defaults,v);if(j.loop=parseInt(j.loop),z=2*j.loop-1,j.loop)for(var O=0;z>O;O++){var q={delay:j.delay,progress:j.progress};O===z-1&&(q.display=j.display,q.visibility=j.visibility,q.complete=j.complete),P(g,"reverse",q)}return e()}};b=f.extend(P,b),b.animate=P;var w=t.requestAnimationFrame||g;return b.State.isMobile||r.hidden===a||r.addEventListener("visibilitychange",function(){r.hidden?(w=function(e){return setTimeout(function(){e(!0)},16)},c()):w=t.requestAnimationFrame||g}),e.Velocity=b,e!==t&&(e.fn.velocity=P,e.fn.velocity.defaults=b.defaults),f.each(["Down","Up"],function(e,t){b.Redirects["slide"+t]=function(e,r,n,o,i,s){var l=f.extend({},r),u=l.begin,c=l.complete,p={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""},d={};l.display===a&&(l.display="Down"===t?"inline"===b.CSS.Values.getDisplayType(e)?"inline-block":"block":"none"),l.begin=function(){u&&u.call(i,i);for(var r in p){d[r]=e.style[r];var a=b.CSS.getPropertyValue(e,r);p[r]="Down"===t?[a,0]:[0,a]}d.overflow=e.style.overflow,e.style.overflow="hidden"},l.complete=function(){for(var t in d)e.style[t]=d[t];c&&c.call(i,i),s&&s.resolver(i)},b(e,p,l)}}),f.each(["In","Out"],function(e,t){b.Redirects["fade"+t]=function(e,r,n,o,i,s){var l=f.extend({},r),u={opacity:"In"===t?1:0},c=l.complete;l.complete=n!==o-1?l.begin=null:function(){c&&c.call(i,i),s&&s.resolver(i)},l.display===a&&(l.display="In"===t?"auto":"none"),b(this,u,l)}}),b}(window.jQuery||window.Zepto||window,window,document)}));
|
@@ -0,0 +1,338 @@
|
|
1
|
+
/*!
|
2
|
+
* Waves v0.6.4
|
3
|
+
* http://fian.my.id/Waves
|
4
|
+
*
|
5
|
+
* Copyright 2014 Alfiana E. Sibuea and other contributors
|
6
|
+
* Released under the MIT license
|
7
|
+
* https://github.com/fians/Waves/blob/master/LICENSE
|
8
|
+
*/
|
9
|
+
|
10
|
+
;(function(window) {
|
11
|
+
'use strict';
|
12
|
+
|
13
|
+
var Waves = Waves || {};
|
14
|
+
var $$ = document.querySelectorAll.bind(document);
|
15
|
+
|
16
|
+
// Find exact position of element
|
17
|
+
function isWindow(obj) {
|
18
|
+
return obj !== null && obj === obj.window;
|
19
|
+
}
|
20
|
+
|
21
|
+
function getWindow(elem) {
|
22
|
+
return isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView;
|
23
|
+
}
|
24
|
+
|
25
|
+
function offset(elem) {
|
26
|
+
var docElem, win,
|
27
|
+
box = {top: 0, left: 0},
|
28
|
+
doc = elem && elem.ownerDocument;
|
29
|
+
|
30
|
+
docElem = doc.documentElement;
|
31
|
+
|
32
|
+
if (typeof elem.getBoundingClientRect !== typeof undefined) {
|
33
|
+
box = elem.getBoundingClientRect();
|
34
|
+
}
|
35
|
+
win = getWindow(doc);
|
36
|
+
return {
|
37
|
+
top: box.top + win.pageYOffset - docElem.clientTop,
|
38
|
+
left: box.left + win.pageXOffset - docElem.clientLeft
|
39
|
+
};
|
40
|
+
}
|
41
|
+
|
42
|
+
function convertStyle(obj) {
|
43
|
+
var style = '';
|
44
|
+
|
45
|
+
for (var a in obj) {
|
46
|
+
if (obj.hasOwnProperty(a)) {
|
47
|
+
style += (a + ':' + obj[a] + ';');
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
return style;
|
52
|
+
}
|
53
|
+
|
54
|
+
var Effect = {
|
55
|
+
|
56
|
+
// Effect delay
|
57
|
+
duration: 750,
|
58
|
+
|
59
|
+
show: function(e, element) {
|
60
|
+
|
61
|
+
// Disable right click
|
62
|
+
if (e.button === 2) {
|
63
|
+
return false;
|
64
|
+
}
|
65
|
+
|
66
|
+
var el = element || this;
|
67
|
+
|
68
|
+
// Create ripple
|
69
|
+
var ripple = document.createElement('div');
|
70
|
+
ripple.className = 'waves-ripple';
|
71
|
+
el.appendChild(ripple);
|
72
|
+
|
73
|
+
// Get click coordinate and element witdh
|
74
|
+
var pos = offset(el);
|
75
|
+
var relativeY = (e.pageY - pos.top);
|
76
|
+
var relativeX = (e.pageX - pos.left);
|
77
|
+
var scale = 'scale('+((el.clientWidth / 100) * 10)+')';
|
78
|
+
|
79
|
+
// Support for touch devices
|
80
|
+
if ('touches' in e) {
|
81
|
+
relativeY = (e.touches[0].pageY - pos.top);
|
82
|
+
relativeX = (e.touches[0].pageX - pos.left);
|
83
|
+
}
|
84
|
+
|
85
|
+
// Attach data to element
|
86
|
+
ripple.setAttribute('data-hold', Date.now());
|
87
|
+
ripple.setAttribute('data-scale', scale);
|
88
|
+
ripple.setAttribute('data-x', relativeX);
|
89
|
+
ripple.setAttribute('data-y', relativeY);
|
90
|
+
|
91
|
+
// Set ripple position
|
92
|
+
var rippleStyle = {
|
93
|
+
'top': relativeY+'px',
|
94
|
+
'left': relativeX+'px'
|
95
|
+
};
|
96
|
+
|
97
|
+
ripple.className = ripple.className + ' waves-notransition';
|
98
|
+
ripple.setAttribute('style', convertStyle(rippleStyle));
|
99
|
+
ripple.className = ripple.className.replace('waves-notransition', '');
|
100
|
+
|
101
|
+
// Scale the ripple
|
102
|
+
rippleStyle['-webkit-transform'] = scale;
|
103
|
+
rippleStyle['-moz-transform'] = scale;
|
104
|
+
rippleStyle['-ms-transform'] = scale;
|
105
|
+
rippleStyle['-o-transform'] = scale;
|
106
|
+
rippleStyle.transform = scale;
|
107
|
+
rippleStyle.opacity = '1';
|
108
|
+
|
109
|
+
rippleStyle['-webkit-transition-duration'] = Effect.duration + 'ms';
|
110
|
+
rippleStyle['-moz-transition-duration'] = Effect.duration + 'ms';
|
111
|
+
rippleStyle['-o-transition-duration'] = Effect.duration + 'ms';
|
112
|
+
rippleStyle['transition-duration'] = Effect.duration + 'ms';
|
113
|
+
|
114
|
+
rippleStyle['-webkit-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';
|
115
|
+
rippleStyle['-moz-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';
|
116
|
+
rippleStyle['-o-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';
|
117
|
+
rippleStyle['transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';
|
118
|
+
|
119
|
+
ripple.setAttribute('style', convertStyle(rippleStyle));
|
120
|
+
},
|
121
|
+
|
122
|
+
hide: function(e) {
|
123
|
+
TouchHandler.touchup(e);
|
124
|
+
|
125
|
+
var el = this;
|
126
|
+
var width = el.clientWidth * 1.4;
|
127
|
+
|
128
|
+
// Get first ripple
|
129
|
+
var ripple = null;
|
130
|
+
var ripples = el.getElementsByClassName('waves-ripple');
|
131
|
+
if (ripples.length > 0) {
|
132
|
+
ripple = ripples[ripples.length - 1];
|
133
|
+
} else {
|
134
|
+
return false;
|
135
|
+
}
|
136
|
+
|
137
|
+
var relativeX = ripple.getAttribute('data-x');
|
138
|
+
var relativeY = ripple.getAttribute('data-y');
|
139
|
+
var scale = ripple.getAttribute('data-scale');
|
140
|
+
|
141
|
+
// Get delay beetween mousedown and mouse leave
|
142
|
+
var diff = Date.now() - Number(ripple.getAttribute('data-hold'));
|
143
|
+
var delay = 350 - diff;
|
144
|
+
|
145
|
+
if (delay < 0) {
|
146
|
+
delay = 0;
|
147
|
+
}
|
148
|
+
|
149
|
+
// Fade out ripple after delay
|
150
|
+
setTimeout(function() {
|
151
|
+
var style = {
|
152
|
+
'top': relativeY+'px',
|
153
|
+
'left': relativeX+'px',
|
154
|
+
'opacity': '0',
|
155
|
+
|
156
|
+
// Duration
|
157
|
+
'-webkit-transition-duration': Effect.duration + 'ms',
|
158
|
+
'-moz-transition-duration': Effect.duration + 'ms',
|
159
|
+
'-o-transition-duration': Effect.duration + 'ms',
|
160
|
+
'transition-duration': Effect.duration + 'ms',
|
161
|
+
'-webkit-transform': scale,
|
162
|
+
'-moz-transform': scale,
|
163
|
+
'-ms-transform': scale,
|
164
|
+
'-o-transform': scale,
|
165
|
+
'transform': scale,
|
166
|
+
};
|
167
|
+
|
168
|
+
ripple.setAttribute('style', convertStyle(style));
|
169
|
+
|
170
|
+
setTimeout(function() {
|
171
|
+
try {
|
172
|
+
el.removeChild(ripple);
|
173
|
+
} catch(e) {
|
174
|
+
return false;
|
175
|
+
}
|
176
|
+
}, Effect.duration);
|
177
|
+
}, delay);
|
178
|
+
},
|
179
|
+
|
180
|
+
// Little hack to make <input> can perform waves effect
|
181
|
+
wrapInput: function(elements) {
|
182
|
+
for (var a = 0; a < elements.length; a++) {
|
183
|
+
var el = elements[a];
|
184
|
+
|
185
|
+
if (el.tagName.toLowerCase() === 'input') {
|
186
|
+
var parent = el.parentNode;
|
187
|
+
|
188
|
+
// If input already have parent just pass through
|
189
|
+
if (parent.tagName.toLowerCase() === 'i' && parent.className.indexOf('waves-effect') !== -1) {
|
190
|
+
continue;
|
191
|
+
}
|
192
|
+
|
193
|
+
// Put element class and style to the specified parent
|
194
|
+
var wrapper = document.createElement('i');
|
195
|
+
wrapper.className = el.className + ' waves-input-wrapper';
|
196
|
+
|
197
|
+
var elementStyle = el.getAttribute('style');
|
198
|
+
|
199
|
+
if (!elementStyle) {
|
200
|
+
elementStyle = '';
|
201
|
+
}
|
202
|
+
|
203
|
+
wrapper.setAttribute('style', elementStyle);
|
204
|
+
|
205
|
+
el.className = 'waves-button-input';
|
206
|
+
el.removeAttribute('style');
|
207
|
+
|
208
|
+
// Put element as child
|
209
|
+
parent.replaceChild(wrapper, el);
|
210
|
+
wrapper.appendChild(el);
|
211
|
+
}
|
212
|
+
}
|
213
|
+
}
|
214
|
+
};
|
215
|
+
|
216
|
+
|
217
|
+
/**
|
218
|
+
* Disable mousedown event for 500ms during and after touch
|
219
|
+
*/
|
220
|
+
var TouchHandler = {
|
221
|
+
/* uses an integer rather than bool so there's no issues with
|
222
|
+
* needing to clear timeouts if another touch event occurred
|
223
|
+
* within the 500ms. Cannot mouseup between touchstart and
|
224
|
+
* touchend, nor in the 500ms after touchend. */
|
225
|
+
touches: 0,
|
226
|
+
allowEvent: function(e) {
|
227
|
+
var allow = true;
|
228
|
+
|
229
|
+
if (e.type === 'touchstart') {
|
230
|
+
TouchHandler.touches += 1; //push
|
231
|
+
} else if (e.type === 'touchend' || e.type === 'touchcancel') {
|
232
|
+
setTimeout(function() {
|
233
|
+
if (TouchHandler.touches > 0) {
|
234
|
+
TouchHandler.touches -= 1; //pop after 500ms
|
235
|
+
}
|
236
|
+
}, 500);
|
237
|
+
} else if (e.type === 'mousedown' && TouchHandler.touches > 0) {
|
238
|
+
allow = false;
|
239
|
+
}
|
240
|
+
|
241
|
+
return allow;
|
242
|
+
},
|
243
|
+
touchup: function(e) {
|
244
|
+
TouchHandler.allowEvent(e);
|
245
|
+
}
|
246
|
+
};
|
247
|
+
|
248
|
+
|
249
|
+
/**
|
250
|
+
* Delegated click handler for .waves-effect element.
|
251
|
+
* returns null when .waves-effect element not in "click tree"
|
252
|
+
*/
|
253
|
+
function getWavesEffectElement(e) {
|
254
|
+
if (TouchHandler.allowEvent(e) === false) {
|
255
|
+
return null;
|
256
|
+
}
|
257
|
+
|
258
|
+
var element = null;
|
259
|
+
var target = e.target || e.srcElement;
|
260
|
+
|
261
|
+
while (target.parentElement !== null) {
|
262
|
+
if (!(target instanceof SVGElement) && target.className.indexOf('waves-effect') !== -1) {
|
263
|
+
element = target;
|
264
|
+
break;
|
265
|
+
} else if (target.classList.contains('waves-effect')) {
|
266
|
+
element = target;
|
267
|
+
break;
|
268
|
+
}
|
269
|
+
target = target.parentElement;
|
270
|
+
}
|
271
|
+
|
272
|
+
return element;
|
273
|
+
}
|
274
|
+
|
275
|
+
/**
|
276
|
+
* Bubble the click and show effect if .waves-effect elem was found
|
277
|
+
*/
|
278
|
+
function showEffect(e) {
|
279
|
+
var element = getWavesEffectElement(e);
|
280
|
+
|
281
|
+
if (element !== null) {
|
282
|
+
Effect.show(e, element);
|
283
|
+
|
284
|
+
if ('ontouchstart' in window) {
|
285
|
+
element.addEventListener('touchend', Effect.hide, false);
|
286
|
+
element.addEventListener('touchcancel', Effect.hide, false);
|
287
|
+
}
|
288
|
+
|
289
|
+
element.addEventListener('mouseup', Effect.hide, false);
|
290
|
+
element.addEventListener('mouseleave', Effect.hide, false);
|
291
|
+
}
|
292
|
+
}
|
293
|
+
|
294
|
+
Waves.displayEffect = function(options) {
|
295
|
+
options = options || {};
|
296
|
+
|
297
|
+
if ('duration' in options) {
|
298
|
+
Effect.duration = options.duration;
|
299
|
+
}
|
300
|
+
|
301
|
+
//Wrap input inside <i> tag
|
302
|
+
Effect.wrapInput($$('.waves-effect'));
|
303
|
+
|
304
|
+
if ('ontouchstart' in window) {
|
305
|
+
document.body.addEventListener('touchstart', showEffect, false);
|
306
|
+
}
|
307
|
+
|
308
|
+
document.body.addEventListener('mousedown', showEffect, false);
|
309
|
+
};
|
310
|
+
|
311
|
+
/**
|
312
|
+
* Attach Waves to an input element (or any element which doesn't
|
313
|
+
* bubble mouseup/mousedown events).
|
314
|
+
* Intended to be used with dynamically loaded forms/inputs, or
|
315
|
+
* where the user doesn't want a delegated click handler.
|
316
|
+
*/
|
317
|
+
Waves.attach = function(element) {
|
318
|
+
//FUTURE: automatically add waves classes and allow users
|
319
|
+
// to specify them with an options param? Eg. light/classic/button
|
320
|
+
if (element.tagName.toLowerCase() === 'input') {
|
321
|
+
Effect.wrapInput([element]);
|
322
|
+
element = element.parentElement;
|
323
|
+
}
|
324
|
+
|
325
|
+
if ('ontouchstart' in window) {
|
326
|
+
element.addEventListener('touchstart', showEffect, false);
|
327
|
+
}
|
328
|
+
|
329
|
+
element.addEventListener('mousedown', showEffect, false);
|
330
|
+
};
|
331
|
+
|
332
|
+
window.Waves = Waves;
|
333
|
+
|
334
|
+
document.addEventListener('DOMContentLoaded', function() {
|
335
|
+
Waves.displayEffect();
|
336
|
+
}, false);
|
337
|
+
|
338
|
+
})(window);
|