materialize-sass 0.95.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +50 -0
- data/Rakefile +1 -0
- data/app/assets/fonts/material-design-icons/LICENSE.txt +428 -0
- data/app/assets/fonts/material-design-icons/Material-Design-Icons.eot +0 -0
- data/app/assets/fonts/material-design-icons/Material-Design-Icons.svg +751 -0
- data/app/assets/fonts/material-design-icons/Material-Design-Icons.ttf +0 -0
- data/app/assets/fonts/material-design-icons/Material-Design-Icons.woff +0 -0
- data/app/assets/fonts/roboto/Roboto-Bold.ttf +0 -0
- data/app/assets/fonts/roboto/Roboto-Light.ttf +0 -0
- data/app/assets/fonts/roboto/Roboto-Medium.ttf +0 -0
- data/app/assets/fonts/roboto/Roboto-Regular.ttf +0 -0
- data/app/assets/fonts/roboto/Roboto-Thin.ttf +0 -0
- data/app/assets/javascripts/materialize-sprokets.js +21 -0
- data/app/assets/javascripts/materialize.js +5327 -0
- data/app/assets/javascripts/materialize/cards.js +19 -0
- data/app/assets/javascripts/materialize/collapsible.js +87 -0
- data/app/assets/javascripts/materialize/date_picker/picker.date.js +1427 -0
- data/app/assets/javascripts/materialize/date_picker/picker.js +1123 -0
- data/app/assets/javascripts/materialize/dropdown.js +168 -0
- data/app/assets/javascripts/materialize/forms.js +245 -0
- data/app/assets/javascripts/materialize/hammer.min.js +1 -0
- data/app/assets/javascripts/materialize/init.js +152 -0
- data/app/assets/javascripts/materialize/jquery.easing.1.3.js +205 -0
- data/app/assets/javascripts/materialize/jquery.hammer.js +33 -0
- data/app/assets/javascripts/materialize/jquery.timeago.min.js +1 -0
- data/app/assets/javascripts/materialize/leanModal.js +96 -0
- data/app/assets/javascripts/materialize/materialbox.js +237 -0
- data/app/assets/javascripts/materialize/parallax.js +50 -0
- data/app/assets/javascripts/materialize/prism.js +8 -0
- data/app/assets/javascripts/materialize/pushpin.js +87 -0
- data/app/assets/javascripts/materialize/scrollspy.js +287 -0
- data/app/assets/javascripts/materialize/sideNav.js +278 -0
- data/app/assets/javascripts/materialize/slider.js +257 -0
- data/app/assets/javascripts/materialize/tabs.js +130 -0
- data/app/assets/javascripts/materialize/toasts.js +100 -0
- data/app/assets/javascripts/materialize/tooltip.js +167 -0
- data/app/assets/javascripts/materialize/velocity.min.js +4 -0
- data/app/assets/javascripts/materialize/waves.js +335 -0
- data/app/assets/stylesheets/components/_buttons.scss +111 -0
- data/app/assets/stylesheets/components/_cards.scss +121 -0
- data/app/assets/stylesheets/components/_collapsible.scss +78 -0
- data/app/assets/stylesheets/components/_color.scss +411 -0
- data/app/assets/stylesheets/components/_dropdown.scss +31 -0
- data/app/assets/stylesheets/components/_form.scss +641 -0
- data/app/assets/stylesheets/components/_global.scss +582 -0
- data/app/assets/stylesheets/components/_grid.scss +119 -0
- data/app/assets/stylesheets/components/_icons-material-design.scss +2247 -0
- data/app/assets/stylesheets/components/_materialbox.scss +42 -0
- data/app/assets/stylesheets/components/_mixins.scss +5 -0
- data/app/assets/stylesheets/components/_modal.scss +50 -0
- data/app/assets/stylesheets/components/_navbar.scss +129 -0
- data/app/assets/stylesheets/components/_normalize.scss +427 -0
- data/app/assets/stylesheets/components/_prefixer.scss +417 -0
- data/app/assets/stylesheets/components/_preloader.scss +320 -0
- data/app/assets/stylesheets/components/_roboto.scss +28 -0
- data/app/assets/stylesheets/components/_sideNav.scss +143 -0
- data/app/assets/stylesheets/components/_slider.scss +87 -0
- data/app/assets/stylesheets/components/_table_of_contents.scss +33 -0
- data/app/assets/stylesheets/components/_tabs.scss +43 -0
- data/app/assets/stylesheets/components/_toast.scss +64 -0
- data/app/assets/stylesheets/components/_tooltip.scss +34 -0
- data/app/assets/stylesheets/components/_typography.scss +55 -0
- data/app/assets/stylesheets/components/_variables.scss +128 -0
- data/app/assets/stylesheets/components/_waves.scss +167 -0
- data/app/assets/stylesheets/components/date_picker/_default.date.scss +431 -0
- data/app/assets/stylesheets/components/date_picker/_default.scss +201 -0
- data/app/assets/stylesheets/components/date_picker/_default.time.scss +125 -0
- data/app/assets/stylesheets/materialize.scss +38 -0
- data/lib/materialize-sass.rb +8 -0
- data/lib/materialize-sass/version.rb +6 -0
- data/materialize-sass.gemspec +23 -0
- metadata +146 -0
@@ -0,0 +1,205 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
3
|
+
*
|
4
|
+
* Uses the built in easing capabilities added In jQuery 1.1
|
5
|
+
* to offer multiple easing options
|
6
|
+
*
|
7
|
+
* TERMS OF USE - jQuery Easing
|
8
|
+
*
|
9
|
+
* Open source under the BSD License.
|
10
|
+
*
|
11
|
+
* Copyright © 2008 George McGinley Smith
|
12
|
+
* All rights reserved.
|
13
|
+
*
|
14
|
+
* Redistribution and use in source and binary forms, with or without modification,
|
15
|
+
* are permitted provided that the following conditions are met:
|
16
|
+
*
|
17
|
+
* Redistributions of source code must retain the above copyright notice, this list of
|
18
|
+
* conditions and the following disclaimer.
|
19
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list
|
20
|
+
* of conditions and the following disclaimer in the documentation and/or other materials
|
21
|
+
* provided with the distribution.
|
22
|
+
*
|
23
|
+
* Neither the name of the author nor the names of contributors may be used to endorse
|
24
|
+
* or promote products derived from this software without specific prior written permission.
|
25
|
+
*
|
26
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
27
|
+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
28
|
+
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
29
|
+
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
30
|
+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
31
|
+
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
32
|
+
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
33
|
+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
34
|
+
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
35
|
+
*
|
36
|
+
*/
|
37
|
+
|
38
|
+
// t: current time, b: begInnIng value, c: change In value, d: duration
|
39
|
+
jQuery.easing['jswing'] = jQuery.easing['swing'];
|
40
|
+
|
41
|
+
jQuery.extend( jQuery.easing,
|
42
|
+
{
|
43
|
+
def: 'easeOutQuad',
|
44
|
+
swing: function (x, t, b, c, d) {
|
45
|
+
//alert(jQuery.easing.default);
|
46
|
+
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
|
47
|
+
},
|
48
|
+
easeInQuad: function (x, t, b, c, d) {
|
49
|
+
return c*(t/=d)*t + b;
|
50
|
+
},
|
51
|
+
easeOutQuad: function (x, t, b, c, d) {
|
52
|
+
return -c *(t/=d)*(t-2) + b;
|
53
|
+
},
|
54
|
+
easeInOutQuad: function (x, t, b, c, d) {
|
55
|
+
if ((t/=d/2) < 1) return c/2*t*t + b;
|
56
|
+
return -c/2 * ((--t)*(t-2) - 1) + b;
|
57
|
+
},
|
58
|
+
easeInCubic: function (x, t, b, c, d) {
|
59
|
+
return c*(t/=d)*t*t + b;
|
60
|
+
},
|
61
|
+
easeOutCubic: function (x, t, b, c, d) {
|
62
|
+
return c*((t=t/d-1)*t*t + 1) + b;
|
63
|
+
},
|
64
|
+
easeInOutCubic: function (x, t, b, c, d) {
|
65
|
+
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
66
|
+
return c/2*((t-=2)*t*t + 2) + b;
|
67
|
+
},
|
68
|
+
easeInQuart: function (x, t, b, c, d) {
|
69
|
+
return c*(t/=d)*t*t*t + b;
|
70
|
+
},
|
71
|
+
easeOutQuart: function (x, t, b, c, d) {
|
72
|
+
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
73
|
+
},
|
74
|
+
easeInOutQuart: function (x, t, b, c, d) {
|
75
|
+
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
76
|
+
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
77
|
+
},
|
78
|
+
easeInQuint: function (x, t, b, c, d) {
|
79
|
+
return c*(t/=d)*t*t*t*t + b;
|
80
|
+
},
|
81
|
+
easeOutQuint: function (x, t, b, c, d) {
|
82
|
+
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
83
|
+
},
|
84
|
+
easeInOutQuint: function (x, t, b, c, d) {
|
85
|
+
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
86
|
+
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
87
|
+
},
|
88
|
+
easeInSine: function (x, t, b, c, d) {
|
89
|
+
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
90
|
+
},
|
91
|
+
easeOutSine: function (x, t, b, c, d) {
|
92
|
+
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
93
|
+
},
|
94
|
+
easeInOutSine: function (x, t, b, c, d) {
|
95
|
+
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
96
|
+
},
|
97
|
+
easeInExpo: function (x, t, b, c, d) {
|
98
|
+
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
99
|
+
},
|
100
|
+
easeOutExpo: function (x, t, b, c, d) {
|
101
|
+
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
102
|
+
},
|
103
|
+
easeInOutExpo: function (x, t, b, c, d) {
|
104
|
+
if (t==0) return b;
|
105
|
+
if (t==d) return b+c;
|
106
|
+
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
107
|
+
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
108
|
+
},
|
109
|
+
easeInCirc: function (x, t, b, c, d) {
|
110
|
+
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
111
|
+
},
|
112
|
+
easeOutCirc: function (x, t, b, c, d) {
|
113
|
+
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
114
|
+
},
|
115
|
+
easeInOutCirc: function (x, t, b, c, d) {
|
116
|
+
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
117
|
+
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
118
|
+
},
|
119
|
+
easeInElastic: function (x, t, b, c, d) {
|
120
|
+
var s=1.70158;var p=0;var a=c;
|
121
|
+
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
122
|
+
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
123
|
+
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
124
|
+
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
125
|
+
},
|
126
|
+
easeOutElastic: function (x, t, b, c, d) {
|
127
|
+
var s=1.70158;var p=0;var a=c;
|
128
|
+
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
129
|
+
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
130
|
+
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
131
|
+
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
132
|
+
},
|
133
|
+
easeInOutElastic: function (x, t, b, c, d) {
|
134
|
+
var s=1.70158;var p=0;var a=c;
|
135
|
+
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
136
|
+
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
137
|
+
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
138
|
+
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
139
|
+
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
140
|
+
},
|
141
|
+
easeInBack: function (x, t, b, c, d, s) {
|
142
|
+
if (s == undefined) s = 1.70158;
|
143
|
+
return c*(t/=d)*t*((s+1)*t - s) + b;
|
144
|
+
},
|
145
|
+
easeOutBack: function (x, t, b, c, d, s) {
|
146
|
+
if (s == undefined) s = 1.70158;
|
147
|
+
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
148
|
+
},
|
149
|
+
easeInOutBack: function (x, t, b, c, d, s) {
|
150
|
+
if (s == undefined) s = 1.70158;
|
151
|
+
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
152
|
+
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
153
|
+
},
|
154
|
+
easeInBounce: function (x, t, b, c, d) {
|
155
|
+
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
156
|
+
},
|
157
|
+
easeOutBounce: function (x, t, b, c, d) {
|
158
|
+
if ((t/=d) < (1/2.75)) {
|
159
|
+
return c*(7.5625*t*t) + b;
|
160
|
+
} else if (t < (2/2.75)) {
|
161
|
+
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
162
|
+
} else if (t < (2.5/2.75)) {
|
163
|
+
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
164
|
+
} else {
|
165
|
+
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
166
|
+
}
|
167
|
+
},
|
168
|
+
easeInOutBounce: function (x, t, b, c, d) {
|
169
|
+
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
170
|
+
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
171
|
+
}
|
172
|
+
});
|
173
|
+
|
174
|
+
/*
|
175
|
+
*
|
176
|
+
* TERMS OF USE - EASING EQUATIONS
|
177
|
+
*
|
178
|
+
* Open source under the BSD License.
|
179
|
+
*
|
180
|
+
* Copyright © 2001 Robert Penner
|
181
|
+
* All rights reserved.
|
182
|
+
*
|
183
|
+
* Redistribution and use in source and binary forms, with or without modification,
|
184
|
+
* are permitted provided that the following conditions are met:
|
185
|
+
*
|
186
|
+
* Redistributions of source code must retain the above copyright notice, this list of
|
187
|
+
* conditions and the following disclaimer.
|
188
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list
|
189
|
+
* of conditions and the following disclaimer in the documentation and/or other materials
|
190
|
+
* provided with the distribution.
|
191
|
+
*
|
192
|
+
* Neither the name of the author nor the names of contributors may be used to endorse
|
193
|
+
* or promote products derived from this software without specific prior written permission.
|
194
|
+
*
|
195
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
196
|
+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
197
|
+
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
198
|
+
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
199
|
+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
200
|
+
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
201
|
+
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
202
|
+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
203
|
+
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
204
|
+
*
|
205
|
+
*/
|
@@ -0,0 +1,33 @@
|
|
1
|
+
(function(factory) {
|
2
|
+
if (typeof define === 'function' && define.amd) {
|
3
|
+
define(['jquery', 'hammerjs'], factory);
|
4
|
+
} else if (typeof exports === 'object') {
|
5
|
+
factory(require('jquery'), require('hammerjs'));
|
6
|
+
} else {
|
7
|
+
factory(jQuery, Hammer);
|
8
|
+
}
|
9
|
+
}(function($, Hammer) {
|
10
|
+
function hammerify(el, options) {
|
11
|
+
var $el = $(el);
|
12
|
+
if(!$el.data("hammer")) {
|
13
|
+
$el.data("hammer", new Hammer($el[0], options));
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
$.fn.hammer = function(options) {
|
18
|
+
return this.each(function() {
|
19
|
+
hammerify(this, options);
|
20
|
+
});
|
21
|
+
};
|
22
|
+
|
23
|
+
// extend the emit method to also trigger jQuery events
|
24
|
+
Hammer.Manager.prototype.emit = (function(originalEmit) {
|
25
|
+
return function(type, data) {
|
26
|
+
originalEmit.call(this, type, data);
|
27
|
+
$(this.element).trigger({
|
28
|
+
type: type,
|
29
|
+
gesture: data
|
30
|
+
});
|
31
|
+
};
|
32
|
+
})(Hammer.Manager.prototype.emit);
|
33
|
+
}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){function e(){var e=a(this),o=r.settings;return isNaN(e.datetime)||(0==o.cutoff||Math.abs(n(e.datetime))<o.cutoff)&&t(this).text(i(e.datetime)),this}function a(e){if(e=t(e),!e.data("timeago")){e.data("timeago",{datetime:r.datetime(e)});var a=t.trim(e.text());r.settings.localeTitle?e.attr("title",e.data("timeago").datetime.toLocaleString()):!(a.length>0)||r.isTime(e)&&e.attr("title")||e.attr("title",a)}return e.data("timeago")}function i(t){return r.inWords(n(t))}function n(t){return(new Date).getTime()-t.getTime()}t.timeago=function(e){return i(e instanceof Date?e:"string"==typeof e?t.timeago.parse(e):"number"==typeof e?new Date(e):t.timeago.datetime(e))};var r=t.timeago;t.extend(t.timeago,{settings:{refreshMillis:6e4,allowPast:!0,allowFuture:!1,localeTitle:!1,cutoff:0,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",inPast:"any moment now",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years",wordSeparator:" ",numbers:[]}},inWords:function(e){function a(a,n){var r=t.isFunction(a)?a(n,e):a,o=i.numbers&&i.numbers[n]||n;return r.replace(/%d/i,o)}if(!this.settings.allowPast&&!this.settings.allowFuture)throw"timeago allowPast and allowFuture settings can not both be set to false.";var i=this.settings.strings,n=i.prefixAgo,r=i.suffixAgo;if(this.settings.allowFuture&&0>e&&(n=i.prefixFromNow,r=i.suffixFromNow),!this.settings.allowPast&&e>=0)return this.settings.strings.inPast;var o=Math.abs(e)/1e3,s=o/60,u=s/60,m=u/24,l=m/365,d=45>o&&a(i.seconds,Math.round(o))||90>o&&a(i.minute,1)||45>s&&a(i.minutes,Math.round(s))||90>s&&a(i.hour,1)||24>u&&a(i.hours,Math.round(u))||42>u&&a(i.day,1)||30>m&&a(i.days,Math.round(m))||45>m&&a(i.month,1)||365>m&&a(i.months,Math.round(m/30))||1.5>l&&a(i.year,1)||a(i.years,Math.round(l)),f=i.wordSeparator||"";return void 0===i.wordSeparator&&(f=" "),t.trim([n,d,r].join(f))},parse:function(e){var a=t.trim(e);return a=a.replace(/\.\d+/,""),a=a.replace(/-/,"/").replace(/-/,"/"),a=a.replace(/T/," ").replace(/Z/," UTC"),a=a.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"),a=a.replace(/([\+\-]\d\d)$/," $100"),new Date(a)},datetime:function(e){var a=t(e).attr(r.isTime(e)?"datetime":"title");return r.parse(a)},isTime:function(e){return"time"===t(e).get(0).tagName.toLowerCase()}});var o={init:function(){var a=t.proxy(e,this);a();var i=r.settings;i.refreshMillis>0&&(this._timeagoInterval=setInterval(a,i.refreshMillis))},update:function(a){var i=r.parse(a);t(this).data("timeago",{datetime:i}),r.settings.localeTitle&&t(this).attr("title",i.toLocaleString()),e.apply(this)},updateFromDOM:function(){t(this).data("timeago",{datetime:r.parse(t(this).attr(r.isTime(this)?"datetime":"title"))}),e.apply(this)},dispose:function(){this._timeagoInterval&&(window.clearInterval(this._timeagoInterval),this._timeagoInterval=null)}};t.fn.timeago=function(t,e){var a=t?o[t]:o.init;if(!a)throw new Error("Unknown function name '"+t+"' for timeago");return this.each(function(){a.call(this,e)}),this},document.createElement("abbr"),document.createElement("time")});
|
@@ -0,0 +1,96 @@
|
|
1
|
+
(function($) {
|
2
|
+
$.fn.extend({
|
3
|
+
openModal: function(options) {
|
4
|
+
var modal = this;
|
5
|
+
var overlay = $('<div id="lean-overlay"></div>');
|
6
|
+
$("body").append(overlay);
|
7
|
+
|
8
|
+
var defaults = {
|
9
|
+
opacity: 0.5,
|
10
|
+
in_duration: 300,
|
11
|
+
out_duration: 200,
|
12
|
+
ready: undefined,
|
13
|
+
complete: undefined,
|
14
|
+
dismissible: true
|
15
|
+
}
|
16
|
+
|
17
|
+
// Override defaults
|
18
|
+
options = $.extend(defaults, options);
|
19
|
+
|
20
|
+
if (options.dismissible) {
|
21
|
+
$("#lean-overlay").click(function() {
|
22
|
+
$(modal).closeModal(options);
|
23
|
+
});
|
24
|
+
// Return on ESC
|
25
|
+
$(document).keyup(function(e) {
|
26
|
+
if (e.keyCode === 27) { // ESC key
|
27
|
+
$(modal).closeModal(options);
|
28
|
+
$(this).off();
|
29
|
+
}
|
30
|
+
});
|
31
|
+
}
|
32
|
+
|
33
|
+
$(modal).find(".modal-close").click(function(e) {
|
34
|
+
e.preventDefault();
|
35
|
+
$(modal).closeModal(options);
|
36
|
+
});
|
37
|
+
|
38
|
+
$("#lean-overlay").css({ display : "block", opacity : 0 });
|
39
|
+
|
40
|
+
$(modal).css({
|
41
|
+
display : "block",
|
42
|
+
top: "4%",
|
43
|
+
opacity: 0
|
44
|
+
});
|
45
|
+
|
46
|
+
$("#lean-overlay").velocity({opacity: options.opacity}, {duration: options.in_duration, queue: false, ease: "easeOutCubic"});
|
47
|
+
|
48
|
+
$(modal).velocity({top: "10%", opacity: 1}, {
|
49
|
+
duration: options.in_duration,
|
50
|
+
queue: false,
|
51
|
+
ease: "easeOutCubic",
|
52
|
+
// Handle modal ready callback
|
53
|
+
complete: function() {
|
54
|
+
if (typeof(options.ready) === "function") {
|
55
|
+
options.ready();
|
56
|
+
}
|
57
|
+
}
|
58
|
+
});
|
59
|
+
}
|
60
|
+
});
|
61
|
+
|
62
|
+
$.fn.extend({
|
63
|
+
closeModal: function(options) {
|
64
|
+
var defaults = {
|
65
|
+
out_duration: 200,
|
66
|
+
complete: undefined
|
67
|
+
}
|
68
|
+
var options = $.extend(defaults, options);
|
69
|
+
|
70
|
+
$("#lean-overlay").velocity( { opacity: 0}, {duration: options.out_duration, queue: false, ease: "easeOutQuart"});
|
71
|
+
$(this).fadeOut(options.out_duration, function() {
|
72
|
+
$(this).css({ top: 0});
|
73
|
+
$("#lean-overlay").css({display:"none"});
|
74
|
+
|
75
|
+
// Call complete callback
|
76
|
+
if (typeof(options.complete) === "function") {
|
77
|
+
options.complete();
|
78
|
+
}
|
79
|
+
$('#lean-overlay').remove();
|
80
|
+
});
|
81
|
+
}
|
82
|
+
})
|
83
|
+
|
84
|
+
$.fn.extend({
|
85
|
+
leanModal: function(options) {
|
86
|
+
return this.each(function() {
|
87
|
+
// Close Handlers
|
88
|
+
$(this).click(function(e) {
|
89
|
+
var modal_id = $(this).attr("href");
|
90
|
+
$(modal_id).openModal(options);
|
91
|
+
e.preventDefault();
|
92
|
+
}); // done set on click
|
93
|
+
}); // done return
|
94
|
+
}
|
95
|
+
});
|
96
|
+
})(jQuery);
|
@@ -0,0 +1,237 @@
|
|
1
|
+
(function ($) {
|
2
|
+
|
3
|
+
$.fn.materialbox = function () {
|
4
|
+
|
5
|
+
return this.each(function() {
|
6
|
+
|
7
|
+
if ($(this).hasClass('intialized')) {
|
8
|
+
return;
|
9
|
+
}
|
10
|
+
|
11
|
+
$(this).addClass('intialized');
|
12
|
+
|
13
|
+
var overlayActive = false;
|
14
|
+
var doneAnimating = true;
|
15
|
+
var inDuration = 275;
|
16
|
+
var outDuration = 200;
|
17
|
+
var origin = $(this);
|
18
|
+
var placeholder = $('<div></div>').addClass('material-placeholder');
|
19
|
+
var originalWidth = 0;
|
20
|
+
var originalHeight = 0;
|
21
|
+
|
22
|
+
origin.wrap(placeholder);
|
23
|
+
origin.on('click', function(){
|
24
|
+
|
25
|
+
var placeholder = origin.parent('.material-placeholder');
|
26
|
+
var windowWidth = window.innerWidth;
|
27
|
+
var windowHeight = window.innerHeight;
|
28
|
+
var originalWidth = origin.width();
|
29
|
+
var originalHeight = origin.height();
|
30
|
+
|
31
|
+
// If already modal, return to original
|
32
|
+
if (doneAnimating === false) {
|
33
|
+
return false;
|
34
|
+
}
|
35
|
+
else if (overlayActive && doneAnimating===true) {
|
36
|
+
returnToOriginal();
|
37
|
+
return false;
|
38
|
+
}
|
39
|
+
|
40
|
+
// Set states
|
41
|
+
doneAnimating = false;
|
42
|
+
origin.addClass('active');
|
43
|
+
overlayActive = true;
|
44
|
+
|
45
|
+
// Set positioning for placeholder
|
46
|
+
|
47
|
+
placeholder.css({
|
48
|
+
width: placeholder[0].getBoundingClientRect().width,
|
49
|
+
height: placeholder[0].getBoundingClientRect().height,
|
50
|
+
position: 'relative',
|
51
|
+
top: 0,
|
52
|
+
left: 0
|
53
|
+
})
|
54
|
+
|
55
|
+
// Set css on origin
|
56
|
+
origin.css({position: 'absolute', 'z-index': 1000})
|
57
|
+
.data('width', originalWidth)
|
58
|
+
.data('height', originalHeight);
|
59
|
+
|
60
|
+
// Add overlay
|
61
|
+
var overlay = $('<div id="materialbox-overlay"></div>')
|
62
|
+
.css({
|
63
|
+
opacity: 0
|
64
|
+
})
|
65
|
+
.click(function(){
|
66
|
+
if (doneAnimating === true)
|
67
|
+
returnToOriginal();
|
68
|
+
});
|
69
|
+
// Animate Overlay
|
70
|
+
$('body').append(overlay);
|
71
|
+
overlay.velocity({opacity: 1}, {duration: inDuration, queue: false, easing: 'easeOutQuad'}
|
72
|
+
);
|
73
|
+
|
74
|
+
|
75
|
+
// Add and animate caption if it exists
|
76
|
+
if (origin.data('caption') !== "") {
|
77
|
+
var $photo_caption = $('<div class="materialbox-caption"></div>');
|
78
|
+
$photo_caption.text(origin.data('caption'));
|
79
|
+
$('body').append($photo_caption);
|
80
|
+
$photo_caption.css({ "display": "inline" });
|
81
|
+
$photo_caption.velocity({opacity: 1}, {duration: inDuration, queue: false, easing: 'easeOutQuad'})
|
82
|
+
}
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
// Resize Image
|
87
|
+
var ratio = 0;
|
88
|
+
var widthPercent = originalWidth / windowWidth;
|
89
|
+
var heightPercent = originalHeight / windowHeight;
|
90
|
+
var newWidth = 0;
|
91
|
+
var newHeight = 0;
|
92
|
+
|
93
|
+
if (widthPercent > heightPercent) {
|
94
|
+
ratio = originalHeight / originalWidth;
|
95
|
+
newWidth = windowWidth * 0.9;
|
96
|
+
newHeight = windowWidth * 0.9 * ratio;
|
97
|
+
}
|
98
|
+
else {
|
99
|
+
ratio = originalWidth / originalHeight;
|
100
|
+
newWidth = (windowHeight * 0.9) * ratio;
|
101
|
+
newHeight = windowHeight * 0.9;
|
102
|
+
}
|
103
|
+
|
104
|
+
// Animate image + set z-index
|
105
|
+
if(origin.hasClass('responsive-img')) {
|
106
|
+
origin.velocity({'max-width': newWidth, 'width': originalWidth}, {duration: 0, queue: false,
|
107
|
+
complete: function(){
|
108
|
+
origin.css({left: 0, top: 0})
|
109
|
+
.velocity(
|
110
|
+
{
|
111
|
+
height: newHeight,
|
112
|
+
width: newWidth,
|
113
|
+
left: $(document).scrollLeft() + windowWidth/2 - origin.parent('.material-placeholder').offset().left - newWidth/2,
|
114
|
+
top: $(document).scrollTop() + windowHeight/2 - origin.parent('.material-placeholder').offset().top - newHeight/ 2
|
115
|
+
},
|
116
|
+
{
|
117
|
+
duration: inDuration,
|
118
|
+
queue: false,
|
119
|
+
easing: 'easeOutQuad',
|
120
|
+
complete: function(){doneAnimating = true;}
|
121
|
+
}
|
122
|
+
);
|
123
|
+
} // End Complete
|
124
|
+
}); // End Velocity
|
125
|
+
}
|
126
|
+
else {
|
127
|
+
origin.css('left', 0)
|
128
|
+
.css('top', 0)
|
129
|
+
.velocity(
|
130
|
+
{
|
131
|
+
height: newHeight,
|
132
|
+
width: newWidth,
|
133
|
+
left: $(document).scrollLeft() + windowWidth/2 - origin.parent('.material-placeholder').offset().left - newWidth/2,
|
134
|
+
top: $(document).scrollTop() + windowHeight/2 - origin.parent('.material-placeholder').offset().top - newHeight/ 2
|
135
|
+
},
|
136
|
+
{
|
137
|
+
duration: inDuration,
|
138
|
+
queue: false,
|
139
|
+
easing: 'easeOutQuad',
|
140
|
+
complete: function(){doneAnimating = true;}
|
141
|
+
}
|
142
|
+
); // End Velocity
|
143
|
+
}
|
144
|
+
|
145
|
+
}); // End origin on click
|
146
|
+
|
147
|
+
|
148
|
+
// Return on scroll
|
149
|
+
$(window).scroll(function() {
|
150
|
+
if (overlayActive ) {
|
151
|
+
returnToOriginal();
|
152
|
+
}
|
153
|
+
});
|
154
|
+
|
155
|
+
// Return on ESC
|
156
|
+
$(document).keyup(function(e) {
|
157
|
+
|
158
|
+
if (e.keyCode === 27 && doneAnimating === true) { // ESC key
|
159
|
+
if (overlayActive) {
|
160
|
+
returnToOriginal();
|
161
|
+
}
|
162
|
+
}
|
163
|
+
});
|
164
|
+
|
165
|
+
|
166
|
+
// This function returns the modaled image to the original spot
|
167
|
+
function returnToOriginal() {
|
168
|
+
|
169
|
+
doneAnimating = false;
|
170
|
+
|
171
|
+
var placeholder = origin.parent('.material-placeholder');
|
172
|
+
var windowWidth = window.innerWidth;
|
173
|
+
var windowHeight = window.innerHeight;
|
174
|
+
var originalWidth = origin.data('width');
|
175
|
+
var originalHeight = origin.data('height');
|
176
|
+
|
177
|
+
|
178
|
+
$('#materialbox-overlay').fadeOut(outDuration, function(){
|
179
|
+
// Remove Overlay
|
180
|
+
overlayActive = false;
|
181
|
+
$(this).remove();
|
182
|
+
});
|
183
|
+
|
184
|
+
// Resize Image
|
185
|
+
origin.velocity(
|
186
|
+
{
|
187
|
+
width: originalWidth,
|
188
|
+
height: originalHeight,
|
189
|
+
left: 0,
|
190
|
+
top: 0
|
191
|
+
},
|
192
|
+
{
|
193
|
+
duration: outDuration,
|
194
|
+
queue: false, easing: 'easeOutQuad'
|
195
|
+
}
|
196
|
+
);
|
197
|
+
|
198
|
+
// Remove Caption + reset css settings on image
|
199
|
+
$('.materialbox-caption').velocity({opacity: 0}, {
|
200
|
+
duration: outDuration + 200, // Delay prevents animation overlapping
|
201
|
+
queue: false, easing: 'easeOutQuad',
|
202
|
+
complete: function(){
|
203
|
+
placeholder.css({
|
204
|
+
height: '',
|
205
|
+
width: '',
|
206
|
+
position: '',
|
207
|
+
top: '',
|
208
|
+
left: ''
|
209
|
+
});
|
210
|
+
|
211
|
+
origin.css({
|
212
|
+
height: '',
|
213
|
+
position: '',
|
214
|
+
top: '',
|
215
|
+
left: '',
|
216
|
+
width: '',
|
217
|
+
'max-width': '',
|
218
|
+
position: '',
|
219
|
+
'z-index': ''
|
220
|
+
});
|
221
|
+
|
222
|
+
// Remove class
|
223
|
+
origin.removeClass('active');
|
224
|
+
doneAnimating = true;
|
225
|
+
$(this).remove();
|
226
|
+
}
|
227
|
+
});
|
228
|
+
|
229
|
+
}
|
230
|
+
});
|
231
|
+
};
|
232
|
+
|
233
|
+
$(document).ready(function(){
|
234
|
+
$('.materialboxed').materialbox();
|
235
|
+
});
|
236
|
+
|
237
|
+
}( jQuery ));
|