Netoyage CDN
This commit is contained in:
parent
3fd1fda3ed
commit
3cebe5d0cc
@ -1,13 +1,13 @@
|
|||||||
<!-- jQuery -->
|
<!-- jQuery -->
|
||||||
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
|
<script src="vendor/jquery.min.js"></script>
|
||||||
|
|
||||||
<!-- Bootstrap Core JavaScript -->
|
<!-- Bootstrap Core JavaScript -->
|
||||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
<script src="vendor/bootstrap.min.js"></script>
|
||||||
|
|
||||||
<!-- Plugin JavaScript -->
|
<!-- Plugin JavaScript -->
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
|
<script src="vendor/jquery.easing.min.js"></script>
|
||||||
<script src="https://unpkg.com/scrollreveal@3.3.2/dist/scrollreveal.min.js"></script>
|
<script src="vendor/scrollreveal.min.js"></script>
|
||||||
<script src="https://raw.githubusercontent.com/creativelive/appear/master/dist/appear.min.js"></script>
|
<script src="vendor/appear.min.js"></script>
|
||||||
|
|
||||||
<!-- Theme JavaScript -->
|
<!-- Theme JavaScript -->
|
||||||
<script src="js/creative.min.js"></script>
|
<script src="js/creative.min.js"></script>
|
||||||
|
248
vendor/appear/appear.js
vendored
248
vendor/appear/appear.js
vendored
@ -1,248 +0,0 @@
|
|||||||
/* appear.js 1.0.3 */
|
|
||||||
appear = (function(){
|
|
||||||
'use strict';
|
|
||||||
var scrollLastPos = null, scrollTimer = 0, scroll = {};
|
|
||||||
|
|
||||||
function track(){
|
|
||||||
var newPos = window.scrollY || window.pageYOffset; // pageYOffset for IE9
|
|
||||||
if ( scrollLastPos != null ){
|
|
||||||
scroll.velocity = newPos - scrollLastPos;
|
|
||||||
scroll.delta = (scroll.velocity >= 0) ? scroll.velocity : (-1 * scroll.velocity);
|
|
||||||
|
|
||||||
}
|
|
||||||
scrollLastPos = newPos;
|
|
||||||
if(scrollTimer){
|
|
||||||
clearTimeout(scrollTimer);
|
|
||||||
}
|
|
||||||
scrollTimer = setTimeout(function(){
|
|
||||||
scrollLastPos = null;
|
|
||||||
}, 30);
|
|
||||||
}
|
|
||||||
addEventListener('scroll', track, false);
|
|
||||||
|
|
||||||
// determine if a given element (plus an additional "bounds" area around it) is in the viewport
|
|
||||||
function viewable(el, bounds){
|
|
||||||
var rect = el.getBoundingClientRect();
|
|
||||||
return (
|
|
||||||
(rect.top + rect.height) >= 0 &&
|
|
||||||
(rect.left + rect.width) >= 0 &&
|
|
||||||
(rect.bottom - rect.height) <= ( (window.innerHeight || document.documentElement.clientHeight) + bounds) &&
|
|
||||||
(rect.right - rect.width) <= ( (window.innerWidth || document.documentElement.clientWidth) + bounds)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return function(obj){
|
|
||||||
|
|
||||||
return (function(obj){
|
|
||||||
var initd = false, elements = [], elementsLength, reappear = [],
|
|
||||||
appeared = 0, disappeared = 0, timer, deltaSet, opts = {}, done;
|
|
||||||
|
|
||||||
// handle debouncing a function for better performance on scroll
|
|
||||||
function debounce(fn, delay) {
|
|
||||||
return function () {
|
|
||||||
var self = this, args = arguments;
|
|
||||||
clearTimeout(timer);
|
|
||||||
|
|
||||||
timer = setTimeout(function () {
|
|
||||||
fn.apply(self, args);
|
|
||||||
}, delay);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// called on scroll and resize event, so debounce the actual function that does
|
|
||||||
// the heavy work of determining if an item is viewable and then "appearing" it
|
|
||||||
function checkAppear() {
|
|
||||||
if(scroll.delta < opts.delta.speed) {
|
|
||||||
if(!deltaSet) {
|
|
||||||
deltaSet = true;
|
|
||||||
doCheckAppear();
|
|
||||||
setTimeout(function(){
|
|
||||||
deltaSet = false;
|
|
||||||
}, opts.delta.timeout);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
(debounce(function() {
|
|
||||||
doCheckAppear();
|
|
||||||
}, opts.debounce)());
|
|
||||||
}
|
|
||||||
|
|
||||||
function begin() {
|
|
||||||
// initial appear check before any scroll or resize event
|
|
||||||
doCheckAppear();
|
|
||||||
|
|
||||||
// add relevant listeners
|
|
||||||
addEventListener('scroll', checkAppear, false);
|
|
||||||
addEventListener('resize', checkAppear, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
function end() {
|
|
||||||
elements = [];
|
|
||||||
if(timer) {
|
|
||||||
clearTimeout(timer);
|
|
||||||
}
|
|
||||||
removeListeners();
|
|
||||||
}
|
|
||||||
|
|
||||||
function removeListeners() {
|
|
||||||
|
|
||||||
removeEventListener('scroll', checkAppear, false);
|
|
||||||
removeEventListener('resize', checkAppear, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
function doCheckAppear() {
|
|
||||||
if(done) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
elements.forEach(function(n, i){
|
|
||||||
if(n && viewable(n, opts.bounds)) {
|
|
||||||
// only act if the element is eligible to reappear
|
|
||||||
if(reappear[i]) {
|
|
||||||
// mark this element as not eligible to appear
|
|
||||||
reappear[i] = false;
|
|
||||||
// increment the count of appeared items
|
|
||||||
appeared++;
|
|
||||||
|
|
||||||
// call the appear fn
|
|
||||||
if(opts.appear) {
|
|
||||||
opts.appear(n);
|
|
||||||
}
|
|
||||||
// if not tracking reappears or disappears, need to remove node here
|
|
||||||
if(!opts.disappear && !opts.reappear) {
|
|
||||||
// stop tracking this node, which is now viewable
|
|
||||||
elements[i] = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if(reappear[i] === false) {
|
|
||||||
if(opts.disappear) {
|
|
||||||
opts.disappear(n);
|
|
||||||
}
|
|
||||||
// increment the dissappeared count
|
|
||||||
disappeared++;
|
|
||||||
|
|
||||||
// if not tracking reappears, need to remove node here
|
|
||||||
if(!opts.reappear) {
|
|
||||||
// stop tracking this node, which is now viewable
|
|
||||||
elements[i] = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// element is out of view and eligible to be appeared again
|
|
||||||
reappear[i] = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// remove listeners if all items have (re)appeared
|
|
||||||
if(!opts.reappear && (!opts.appear || opts.appear && appeared === elementsLength) && (!opts.disappear || opts.disappear && disappeared === elementsLength)) {
|
|
||||||
// ensure done is only called once (could be called from a trailing debounce/throttle)
|
|
||||||
done = true;
|
|
||||||
removeListeners();
|
|
||||||
// all items have appeared, so call the done fn
|
|
||||||
if(opts.done){
|
|
||||||
opts.done();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function init() {
|
|
||||||
// make sure we only init once
|
|
||||||
if(initd) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
initd = true;
|
|
||||||
|
|
||||||
// call the obj init fn
|
|
||||||
if(opts.init) {
|
|
||||||
opts.init();
|
|
||||||
}
|
|
||||||
// get the elements to work with
|
|
||||||
var els;
|
|
||||||
if(typeof opts.elements === 'function') {
|
|
||||||
els = opts.elements();
|
|
||||||
} else {
|
|
||||||
els = opts.elements;
|
|
||||||
}
|
|
||||||
if(els) {
|
|
||||||
// put elements into an array object to work with
|
|
||||||
elementsLength = els.length;
|
|
||||||
for(var i = 0; i < elementsLength; i += 1) {
|
|
||||||
elements.push(els[i]);
|
|
||||||
reappear.push(true);
|
|
||||||
}
|
|
||||||
begin();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return function(obj) {
|
|
||||||
obj = obj || {};
|
|
||||||
|
|
||||||
// assign the fn to execute when a node is visible
|
|
||||||
opts = {
|
|
||||||
// a function to be run when the dom is ready (allows for any setup work)
|
|
||||||
init: obj.init,
|
|
||||||
// either an array of elements or a function that will return an htmlCollection
|
|
||||||
elements: obj.elements,
|
|
||||||
// function to call when an element is "viewable", will be passed the element to work with
|
|
||||||
appear: obj.appear,
|
|
||||||
// function to call when an element is no longer "viewable", will be passed the element to work with
|
|
||||||
disappear: obj.disappear,
|
|
||||||
// function to call when all the elements have "appeared"
|
|
||||||
done: obj.done,
|
|
||||||
// keep tracking the elements
|
|
||||||
reappear: obj.reappear,
|
|
||||||
// the extra border around an element to make it viewable outside of the true viewport
|
|
||||||
bounds: obj.bounds || 0,
|
|
||||||
// the debounce timeout
|
|
||||||
debounce: obj.debounce || 50,
|
|
||||||
// appear.js will also check for items on continuous slow scrolling
|
|
||||||
// you can controll how slow the scrolling should be (deltaSpeed)
|
|
||||||
// and when it will check again (deltaTimeout) after it has inspected the dom/viewport;
|
|
||||||
delta: {
|
|
||||||
speed: obj.deltaSpeed || 50,
|
|
||||||
timeout: obj.deltaTimeout || 500
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// add an event listener to init when dom is ready
|
|
||||||
addEventListener('DOMContentLoaded', init, false);
|
|
||||||
|
|
||||||
var isIE10 = false;
|
|
||||||
if (Function('/*@cc_on return document.documentMode===10@*/')()){
|
|
||||||
isIE10 = true;
|
|
||||||
}
|
|
||||||
var completeOrLoaded = document.readyState === 'complete' || document.readyState === 'loaded';
|
|
||||||
|
|
||||||
// call init if document is ready to be worked with and we missed the event
|
|
||||||
if (isIE10) {
|
|
||||||
if (completeOrLoaded) {
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (completeOrLoaded || document.readyState === 'interactive') {
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
// manually fire check for visibility of tracked elements
|
|
||||||
trigger: function trigger(){
|
|
||||||
doCheckAppear();
|
|
||||||
},
|
|
||||||
// pause tracking of elements
|
|
||||||
pause: function pause(){
|
|
||||||
removeListeners();
|
|
||||||
},
|
|
||||||
// resume tracking of elements after a pause
|
|
||||||
resume: function resume(){
|
|
||||||
begin();
|
|
||||||
},
|
|
||||||
// provide a means to stop monitoring all elements
|
|
||||||
destroy: function destroy() {
|
|
||||||
end();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
}()(obj));
|
|
||||||
};
|
|
||||||
}());
|
|
7
vendor/bootstrap.min.js
vendored
Normal file
7
vendor/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
44
vendor/jquery.easing.min.js
vendored
Normal file
44
vendor/jquery.easing.min.js
vendored
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
||||||
|
*
|
||||||
|
* Uses the built in easing capabilities added In jQuery 1.1
|
||||||
|
* to offer multiple easing options
|
||||||
|
*
|
||||||
|
* TERMS OF USE - EASING EQUATIONS
|
||||||
|
*
|
||||||
|
* Open source under the BSD License.
|
||||||
|
*
|
||||||
|
* Copyright © 2001 Robert Penner
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* TERMS OF USE - jQuery Easing
|
||||||
|
*
|
||||||
|
* Open source under the BSD License.
|
||||||
|
*
|
||||||
|
* Copyright © 2008 George McGinley Smith
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
* are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright notice, this list of
|
||||||
|
* conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||||
|
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||||
|
* provided with the distribution.
|
||||||
|
*
|
||||||
|
* Neither the name of the author nor the names of contributors may be used to endorse
|
||||||
|
* or promote products derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||||
|
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||||
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});
|
4
vendor/jquery.min.js
vendored
Normal file
4
vendor/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
11008
vendor/jquery/jquery.js
vendored
11008
vendor/jquery/jquery.js
vendored
File diff suppressed because it is too large
Load Diff
5
vendor/jquery/jquery.min.js
vendored
5
vendor/jquery/jquery.min.js
vendored
File diff suppressed because one or more lines are too long
1860
vendor/magnific-popup/jquery.magnific-popup.js
vendored
1860
vendor/magnific-popup/jquery.magnific-popup.js
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
351
vendor/magnific-popup/magnific-popup.css
vendored
351
vendor/magnific-popup/magnific-popup.css
vendored
@ -1,351 +0,0 @@
|
|||||||
/* Magnific Popup CSS */
|
|
||||||
.mfp-bg {
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
z-index: 1042;
|
|
||||||
overflow: hidden;
|
|
||||||
position: fixed;
|
|
||||||
background: #0b0b0b;
|
|
||||||
opacity: 0.8; }
|
|
||||||
|
|
||||||
.mfp-wrap {
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
z-index: 1043;
|
|
||||||
position: fixed;
|
|
||||||
outline: none !important;
|
|
||||||
-webkit-backface-visibility: hidden; }
|
|
||||||
|
|
||||||
.mfp-container {
|
|
||||||
text-align: center;
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
padding: 0 8px;
|
|
||||||
box-sizing: border-box; }
|
|
||||||
|
|
||||||
.mfp-container:before {
|
|
||||||
content: '';
|
|
||||||
display: inline-block;
|
|
||||||
height: 100%;
|
|
||||||
vertical-align: middle; }
|
|
||||||
|
|
||||||
.mfp-align-top .mfp-container:before {
|
|
||||||
display: none; }
|
|
||||||
|
|
||||||
.mfp-content {
|
|
||||||
position: relative;
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: middle;
|
|
||||||
margin: 0 auto;
|
|
||||||
text-align: left;
|
|
||||||
z-index: 1045; }
|
|
||||||
|
|
||||||
.mfp-inline-holder .mfp-content,
|
|
||||||
.mfp-ajax-holder .mfp-content {
|
|
||||||
width: 100%;
|
|
||||||
cursor: auto; }
|
|
||||||
|
|
||||||
.mfp-ajax-cur {
|
|
||||||
cursor: progress; }
|
|
||||||
|
|
||||||
.mfp-zoom-out-cur, .mfp-zoom-out-cur .mfp-image-holder .mfp-close {
|
|
||||||
cursor: -moz-zoom-out;
|
|
||||||
cursor: -webkit-zoom-out;
|
|
||||||
cursor: zoom-out; }
|
|
||||||
|
|
||||||
.mfp-zoom {
|
|
||||||
cursor: pointer;
|
|
||||||
cursor: -webkit-zoom-in;
|
|
||||||
cursor: -moz-zoom-in;
|
|
||||||
cursor: zoom-in; }
|
|
||||||
|
|
||||||
.mfp-auto-cursor .mfp-content {
|
|
||||||
cursor: auto; }
|
|
||||||
|
|
||||||
.mfp-close,
|
|
||||||
.mfp-arrow,
|
|
||||||
.mfp-preloader,
|
|
||||||
.mfp-counter {
|
|
||||||
-webkit-user-select: none;
|
|
||||||
-moz-user-select: none;
|
|
||||||
user-select: none; }
|
|
||||||
|
|
||||||
.mfp-loading.mfp-figure {
|
|
||||||
display: none; }
|
|
||||||
|
|
||||||
.mfp-hide {
|
|
||||||
display: none !important; }
|
|
||||||
|
|
||||||
.mfp-preloader {
|
|
||||||
color: #CCC;
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
width: auto;
|
|
||||||
text-align: center;
|
|
||||||
margin-top: -0.8em;
|
|
||||||
left: 8px;
|
|
||||||
right: 8px;
|
|
||||||
z-index: 1044; }
|
|
||||||
.mfp-preloader a {
|
|
||||||
color: #CCC; }
|
|
||||||
.mfp-preloader a:hover {
|
|
||||||
color: #FFF; }
|
|
||||||
|
|
||||||
.mfp-s-ready .mfp-preloader {
|
|
||||||
display: none; }
|
|
||||||
|
|
||||||
.mfp-s-error .mfp-content {
|
|
||||||
display: none; }
|
|
||||||
|
|
||||||
button.mfp-close,
|
|
||||||
button.mfp-arrow {
|
|
||||||
overflow: visible;
|
|
||||||
cursor: pointer;
|
|
||||||
background: transparent;
|
|
||||||
border: 0;
|
|
||||||
-webkit-appearance: none;
|
|
||||||
display: block;
|
|
||||||
outline: none;
|
|
||||||
padding: 0;
|
|
||||||
z-index: 1046;
|
|
||||||
box-shadow: none;
|
|
||||||
touch-action: manipulation; }
|
|
||||||
|
|
||||||
button::-moz-focus-inner {
|
|
||||||
padding: 0;
|
|
||||||
border: 0; }
|
|
||||||
|
|
||||||
.mfp-close {
|
|
||||||
width: 44px;
|
|
||||||
height: 44px;
|
|
||||||
line-height: 44px;
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
text-decoration: none;
|
|
||||||
text-align: center;
|
|
||||||
opacity: 0.65;
|
|
||||||
padding: 0 0 18px 10px;
|
|
||||||
color: #FFF;
|
|
||||||
font-style: normal;
|
|
||||||
font-size: 28px;
|
|
||||||
font-family: Arial, Baskerville, monospace; }
|
|
||||||
.mfp-close:hover,
|
|
||||||
.mfp-close:focus {
|
|
||||||
opacity: 1; }
|
|
||||||
.mfp-close:active {
|
|
||||||
top: 1px; }
|
|
||||||
|
|
||||||
.mfp-close-btn-in .mfp-close {
|
|
||||||
color: #333; }
|
|
||||||
|
|
||||||
.mfp-image-holder .mfp-close,
|
|
||||||
.mfp-iframe-holder .mfp-close {
|
|
||||||
color: #FFF;
|
|
||||||
right: -6px;
|
|
||||||
text-align: right;
|
|
||||||
padding-right: 6px;
|
|
||||||
width: 100%; }
|
|
||||||
|
|
||||||
.mfp-counter {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
color: #CCC;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 18px;
|
|
||||||
white-space: nowrap; }
|
|
||||||
|
|
||||||
.mfp-arrow {
|
|
||||||
position: absolute;
|
|
||||||
opacity: 0.65;
|
|
||||||
margin: 0;
|
|
||||||
top: 50%;
|
|
||||||
margin-top: -55px;
|
|
||||||
padding: 0;
|
|
||||||
width: 90px;
|
|
||||||
height: 110px;
|
|
||||||
-webkit-tap-highlight-color: transparent; }
|
|
||||||
.mfp-arrow:active {
|
|
||||||
margin-top: -54px; }
|
|
||||||
.mfp-arrow:hover,
|
|
||||||
.mfp-arrow:focus {
|
|
||||||
opacity: 1; }
|
|
||||||
.mfp-arrow:before,
|
|
||||||
.mfp-arrow:after {
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
margin-top: 35px;
|
|
||||||
margin-left: 35px;
|
|
||||||
border: medium inset transparent; }
|
|
||||||
.mfp-arrow:after {
|
|
||||||
border-top-width: 13px;
|
|
||||||
border-bottom-width: 13px;
|
|
||||||
top: 8px; }
|
|
||||||
.mfp-arrow:before {
|
|
||||||
border-top-width: 21px;
|
|
||||||
border-bottom-width: 21px;
|
|
||||||
opacity: 0.7; }
|
|
||||||
|
|
||||||
.mfp-arrow-left {
|
|
||||||
left: 0; }
|
|
||||||
.mfp-arrow-left:after {
|
|
||||||
border-right: 17px solid #FFF;
|
|
||||||
margin-left: 31px; }
|
|
||||||
.mfp-arrow-left:before {
|
|
||||||
margin-left: 25px;
|
|
||||||
border-right: 27px solid #3F3F3F; }
|
|
||||||
|
|
||||||
.mfp-arrow-right {
|
|
||||||
right: 0; }
|
|
||||||
.mfp-arrow-right:after {
|
|
||||||
border-left: 17px solid #FFF;
|
|
||||||
margin-left: 39px; }
|
|
||||||
.mfp-arrow-right:before {
|
|
||||||
border-left: 27px solid #3F3F3F; }
|
|
||||||
|
|
||||||
.mfp-iframe-holder {
|
|
||||||
padding-top: 40px;
|
|
||||||
padding-bottom: 40px; }
|
|
||||||
.mfp-iframe-holder .mfp-content {
|
|
||||||
line-height: 0;
|
|
||||||
width: 100%;
|
|
||||||
max-width: 900px; }
|
|
||||||
.mfp-iframe-holder .mfp-close {
|
|
||||||
top: -40px; }
|
|
||||||
|
|
||||||
.mfp-iframe-scaler {
|
|
||||||
width: 100%;
|
|
||||||
height: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
padding-top: 56.25%; }
|
|
||||||
.mfp-iframe-scaler iframe {
|
|
||||||
position: absolute;
|
|
||||||
display: block;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
|
||||||
background: #000; }
|
|
||||||
|
|
||||||
/* Main image in popup */
|
|
||||||
img.mfp-img {
|
|
||||||
width: auto;
|
|
||||||
max-width: 100%;
|
|
||||||
height: auto;
|
|
||||||
display: block;
|
|
||||||
line-height: 0;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 40px 0 40px;
|
|
||||||
margin: 0 auto; }
|
|
||||||
|
|
||||||
/* The shadow behind the image */
|
|
||||||
.mfp-figure {
|
|
||||||
line-height: 0; }
|
|
||||||
.mfp-figure:after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 40px;
|
|
||||||
bottom: 40px;
|
|
||||||
display: block;
|
|
||||||
right: 0;
|
|
||||||
width: auto;
|
|
||||||
height: auto;
|
|
||||||
z-index: -1;
|
|
||||||
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
|
||||||
background: #444; }
|
|
||||||
.mfp-figure small {
|
|
||||||
color: #BDBDBD;
|
|
||||||
display: block;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 14px; }
|
|
||||||
.mfp-figure figure {
|
|
||||||
margin: 0; }
|
|
||||||
|
|
||||||
.mfp-bottom-bar {
|
|
||||||
margin-top: -36px;
|
|
||||||
position: absolute;
|
|
||||||
top: 100%;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
cursor: auto; }
|
|
||||||
|
|
||||||
.mfp-title {
|
|
||||||
text-align: left;
|
|
||||||
line-height: 18px;
|
|
||||||
color: #F3F3F3;
|
|
||||||
word-wrap: break-word;
|
|
||||||
padding-right: 36px; }
|
|
||||||
|
|
||||||
.mfp-image-holder .mfp-content {
|
|
||||||
max-width: 100%; }
|
|
||||||
|
|
||||||
.mfp-gallery .mfp-image-holder .mfp-figure {
|
|
||||||
cursor: pointer; }
|
|
||||||
|
|
||||||
@media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) {
|
|
||||||
/**
|
|
||||||
* Remove all paddings around the image on small screen
|
|
||||||
*/
|
|
||||||
.mfp-img-mobile .mfp-image-holder {
|
|
||||||
padding-left: 0;
|
|
||||||
padding-right: 0; }
|
|
||||||
.mfp-img-mobile img.mfp-img {
|
|
||||||
padding: 0; }
|
|
||||||
.mfp-img-mobile .mfp-figure:after {
|
|
||||||
top: 0;
|
|
||||||
bottom: 0; }
|
|
||||||
.mfp-img-mobile .mfp-figure small {
|
|
||||||
display: inline;
|
|
||||||
margin-left: 5px; }
|
|
||||||
.mfp-img-mobile .mfp-bottom-bar {
|
|
||||||
background: rgba(0, 0, 0, 0.6);
|
|
||||||
bottom: 0;
|
|
||||||
margin: 0;
|
|
||||||
top: auto;
|
|
||||||
padding: 3px 5px;
|
|
||||||
position: fixed;
|
|
||||||
box-sizing: border-box; }
|
|
||||||
.mfp-img-mobile .mfp-bottom-bar:empty {
|
|
||||||
padding: 0; }
|
|
||||||
.mfp-img-mobile .mfp-counter {
|
|
||||||
right: 5px;
|
|
||||||
top: 3px; }
|
|
||||||
.mfp-img-mobile .mfp-close {
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
width: 35px;
|
|
||||||
height: 35px;
|
|
||||||
line-height: 35px;
|
|
||||||
background: rgba(0, 0, 0, 0.6);
|
|
||||||
position: fixed;
|
|
||||||
text-align: center;
|
|
||||||
padding: 0; } }
|
|
||||||
|
|
||||||
@media all and (max-width: 900px) {
|
|
||||||
.mfp-arrow {
|
|
||||||
-webkit-transform: scale(0.75);
|
|
||||||
transform: scale(0.75); }
|
|
||||||
.mfp-arrow-left {
|
|
||||||
-webkit-transform-origin: 0;
|
|
||||||
transform-origin: 0; }
|
|
||||||
.mfp-arrow-right {
|
|
||||||
-webkit-transform-origin: 100%;
|
|
||||||
transform-origin: 100%; }
|
|
||||||
.mfp-container {
|
|
||||||
padding-left: 6px;
|
|
||||||
padding-right: 6px; } }
|
|
1
vendor/scrollreveal.min.js
vendored
Normal file
1
vendor/scrollreveal.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
947
vendor/scrollreveal/scrollreveal.js
vendored
947
vendor/scrollreveal/scrollreveal.js
vendored
@ -1,947 +0,0 @@
|
|||||||
|
|
||||||
(function(root, factory) {
|
|
||||||
if (typeof define === 'function' && define.amd) {
|
|
||||||
define(factory);
|
|
||||||
} else if (typeof exports === 'object') {
|
|
||||||
module.exports = factory(require, exports, module);
|
|
||||||
} else {
|
|
||||||
root.ScrollReveal = factory();
|
|
||||||
}
|
|
||||||
}(this, function(require, exports, module) {
|
|
||||||
|
|
||||||
|
|
||||||
///// ///// ///// /////
|
|
||||||
///// ///// ///// /////
|
|
||||||
///// ///// ///// /////
|
|
||||||
///// ///// ///// /////
|
|
||||||
///// ///// /////
|
|
||||||
///// ///// /////
|
|
||||||
///// ///// ///// /////
|
|
||||||
///// ///// ///// /////
|
|
||||||
///// /////
|
|
||||||
///// /////
|
|
||||||
///// ///// ///// /////
|
|
||||||
///// ///// ///// /////
|
|
||||||
///// ///// ///// /////
|
|
||||||
///// ///// ///// /////
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ScrollReveal
|
|
||||||
* ------------
|
|
||||||
* Version : 3.1.4
|
|
||||||
* Website : scrollrevealjs.org
|
|
||||||
* Repo : github.com/jlmakes/scrollreveal.js
|
|
||||||
* Author : Julian Lloyd (@jlmakes)
|
|
||||||
*/
|
|
||||||
|
|
||||||
;(function() {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var
|
|
||||||
sr,
|
|
||||||
Tools,
|
|
||||||
_requestAnimationFrame;
|
|
||||||
|
|
||||||
this.ScrollReveal = (function() {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Configuration
|
|
||||||
* -------------
|
|
||||||
* This object signature can be passed directly to the ScrollReveal constructor,
|
|
||||||
* or as the second argument of the `reveal()` method.
|
|
||||||
*/
|
|
||||||
|
|
||||||
ScrollReveal.prototype.defaults = {
|
|
||||||
|
|
||||||
// 'bottom', 'left', 'top', 'right'
|
|
||||||
origin : 'bottom',
|
|
||||||
|
|
||||||
// Can be any valid CSS distance, e.g. '5rem', '10%', '20vw', etc.
|
|
||||||
distance : '20px',
|
|
||||||
|
|
||||||
// Time in milliseconds.
|
|
||||||
duration : 500,
|
|
||||||
delay : 0,
|
|
||||||
|
|
||||||
// Starting angles in degrees, will transition from these values to 0 in all axes.
|
|
||||||
rotate : { x: 0, y: 0, z: 0 },
|
|
||||||
|
|
||||||
// Starting opacity value, before transitioning to the computed opacity.
|
|
||||||
opacity : 0,
|
|
||||||
|
|
||||||
// Starting scale value, will transition from this value to 1
|
|
||||||
scale : 0.9,
|
|
||||||
|
|
||||||
// Accepts any valid CSS easing, e.g. 'ease', 'ease-in-out', 'linear', etc.
|
|
||||||
easing : 'cubic-bezier(0.6, 0.2, 0.1, 1)',
|
|
||||||
|
|
||||||
// When null, `<html>` is assumed to be the reveal container. You can pass a
|
|
||||||
// DOM node as a custom container, e.g. document.querySelector('.fooContainer')
|
|
||||||
// or a selector, e.g. '.fooContainer'
|
|
||||||
container : null,
|
|
||||||
|
|
||||||
// true/false to control reveal animations on mobile.
|
|
||||||
mobile : true,
|
|
||||||
|
|
||||||
// true: reveals occur every time elements become visible
|
|
||||||
// false: reveals occur once as elements become visible
|
|
||||||
reset : false,
|
|
||||||
|
|
||||||
// 'always' — delay for all reveal animations
|
|
||||||
// 'once' — delay only the first time reveals occur
|
|
||||||
// 'onload' - delay only for animations triggered by first load
|
|
||||||
useDelay : 'always',
|
|
||||||
|
|
||||||
// Change when an element is considered in the viewport. The default value
|
|
||||||
// of 0.20 means 20% of an element must be visible for its reveal to occur.
|
|
||||||
viewFactor : 0.2,
|
|
||||||
|
|
||||||
// Pixel values that alter the container boundaries.
|
|
||||||
// e.g. Set `{ top: 48 }`, if you have a 48px tall fixed toolbar.
|
|
||||||
// --
|
|
||||||
// Visual Aid: https://scrollrevealjs.org/assets/viewoffset.png
|
|
||||||
viewOffset : { top: 0, right: 0, bottom: 0, left: 0 },
|
|
||||||
|
|
||||||
// Callbacks that fire for each completed element reveal, and if
|
|
||||||
// `config.reset = true`, for each completed element reset. When creating your
|
|
||||||
// callbacks, remember they are passed the element’s DOM node that triggered
|
|
||||||
// it as the first argument.
|
|
||||||
afterReveal : function(domEl) {},
|
|
||||||
afterReset : function(domEl) {}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function ScrollReveal(config) {
|
|
||||||
|
|
||||||
// Support instantiation without the `new` keyword.
|
|
||||||
if (typeof this == 'undefined' || Object.getPrototypeOf(this) !== ScrollReveal.prototype) {
|
|
||||||
return new ScrollReveal(config)
|
|
||||||
}
|
|
||||||
|
|
||||||
sr = this; // Save reference to instance.
|
|
||||||
sr.tools = new Tools(); // *required utilities
|
|
||||||
|
|
||||||
if (sr.isSupported()) {
|
|
||||||
|
|
||||||
sr.tools.extend(sr.defaults, config || {});
|
|
||||||
|
|
||||||
_resolveContainer(sr.defaults);
|
|
||||||
|
|
||||||
sr.store = {
|
|
||||||
elements : {},
|
|
||||||
containers : []
|
|
||||||
};
|
|
||||||
|
|
||||||
sr.sequences = {};
|
|
||||||
sr.history = [];
|
|
||||||
sr.uid = 0;
|
|
||||||
sr.initialized = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Note: IE9 only supports console if devtools are open.
|
|
||||||
else if (typeof console !== 'undefined' && console !== null) {
|
|
||||||
console.log('ScrollReveal is not supported in this browser.');
|
|
||||||
}
|
|
||||||
|
|
||||||
return sr
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if client supports CSS Transform and CSS Transition.
|
|
||||||
* @return {boolean}
|
|
||||||
*/
|
|
||||||
ScrollReveal.prototype.isSupported = function() {
|
|
||||||
var style = document.documentElement.style;
|
|
||||||
return 'WebkitTransition' in style && 'WebkitTransform' in style
|
|
||||||
|| 'transition' in style && 'transform' in style
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a reveal set, a group of elements that will animate when they
|
|
||||||
* become visible. If [interval] is provided, a new sequence is created
|
|
||||||
* that will ensure elements reveal in the order they appear in the DOM.
|
|
||||||
*
|
|
||||||
* @param {string|Node} [selector] The element (node) or elements (selector) to animate.
|
|
||||||
* @param {Object} [config] Override the defaults for this reveal set.
|
|
||||||
* @param {number} [interval] Time between sequenced element animations (milliseconds).
|
|
||||||
* @param {boolean} [sync] Used internally when updating reveals for async content.
|
|
||||||
*
|
|
||||||
* @return {Object} The current ScrollReveal instance.
|
|
||||||
*/
|
|
||||||
ScrollReveal.prototype.reveal = function(selector, config, interval, sync) {
|
|
||||||
|
|
||||||
var
|
|
||||||
container,
|
|
||||||
elements,
|
|
||||||
elem,
|
|
||||||
elemId,
|
|
||||||
sequence,
|
|
||||||
sequenceId;
|
|
||||||
|
|
||||||
// Resolve container.
|
|
||||||
if (config && config.container) {
|
|
||||||
container = _resolveContainer(config);
|
|
||||||
} else {
|
|
||||||
container = sr.defaults.container;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Let’s check to see if a DOM node was passed in as the first argument,
|
|
||||||
// otherwise query the container for all elements matching the selector.
|
|
||||||
if (sr.tools.isNode(selector)) {
|
|
||||||
elements = [selector];
|
|
||||||
} else {
|
|
||||||
elements = Array.prototype.slice.call(container.querySelectorAll(selector));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!elements.length) {
|
|
||||||
console.log('ScrollReveal: reveal on "'+ selector + '" failed, no elements found.');
|
|
||||||
return sr
|
|
||||||
}
|
|
||||||
|
|
||||||
// No custom configuration was passed, but a sequence interval instead.
|
|
||||||
// let’s shuffle things around to make sure everything works.
|
|
||||||
if (config && typeof config == 'number') {
|
|
||||||
interval = config;
|
|
||||||
config = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prepare a new sequence if an interval is passed.
|
|
||||||
if (interval && typeof interval == 'number') {
|
|
||||||
sequenceId = _nextUid();
|
|
||||||
|
|
||||||
sequence = sr.sequences[sequenceId] = {
|
|
||||||
id : sequenceId,
|
|
||||||
interval : interval,
|
|
||||||
elemIds : [],
|
|
||||||
active : false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Begin main loop to configure ScrollReveal elements.
|
|
||||||
for (var i = 0; i < elements.length; i++) {
|
|
||||||
|
|
||||||
// Check if the element has already been configured and grab it from the store.
|
|
||||||
elemId = elements[i].getAttribute('data-sr-id');
|
|
||||||
if (elemId) {
|
|
||||||
elem = sr.store.elements[elemId];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Otherwise, let’s do some basic setup.
|
|
||||||
else {
|
|
||||||
elem = {
|
|
||||||
id : _nextUid(),
|
|
||||||
domEl : elements[i],
|
|
||||||
seen : false,
|
|
||||||
revealing : false
|
|
||||||
};
|
|
||||||
elem.domEl.setAttribute('data-sr-id', elem.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sequence only setup
|
|
||||||
if (sequence) {
|
|
||||||
|
|
||||||
elem.sequence = {
|
|
||||||
id : sequence.id,
|
|
||||||
index : sequence.elemIds.length
|
|
||||||
};
|
|
||||||
|
|
||||||
sequence.elemIds.push(elem.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// New or existing element, it’s time to update its configuration, styles,
|
|
||||||
// and send the updates to our store.
|
|
||||||
_configure(elem, config || {});
|
|
||||||
_style(elem);
|
|
||||||
_updateStore(elem);
|
|
||||||
|
|
||||||
// We need to make sure elements are set to visibility: visible, even when
|
|
||||||
// on mobile and `config.mobile == false`, or if unsupported.
|
|
||||||
if (sr.tools.isMobile() && !elem.config.mobile || !sr.isSupported()) {
|
|
||||||
elem.domEl.setAttribute('style', elem.styles.inline);
|
|
||||||
elem.disabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Otherwise, proceed normally.
|
|
||||||
else if (!elem.revealing) {
|
|
||||||
elem.domEl.setAttribute('style',
|
|
||||||
elem.styles.inline
|
|
||||||
+ elem.styles.transform.initial
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Each `reveal()` is recorded so that when calling `sync()` while working
|
|
||||||
// with asynchronously loaded content, it can re-trace your steps but with
|
|
||||||
// all your new elements now in the DOM.
|
|
||||||
|
|
||||||
// Since `reveal()` is called internally by `sync()`, we don’t want to
|
|
||||||
// record or intiialize each reveal during syncing.
|
|
||||||
if (!sync && sr.isSupported()) {
|
|
||||||
_record(selector, config);
|
|
||||||
|
|
||||||
// We push initialization to the event queue using setTimeout, so that we can
|
|
||||||
// give ScrollReveal room to process all reveal calls before putting things into motion.
|
|
||||||
// --
|
|
||||||
// Philip Roberts - What the heck is the event loop anyway? (JSConf EU 2014)
|
|
||||||
// https://www.youtube.com/watch?v=8aGhZQkoFbQ
|
|
||||||
if (sr.initTimeout) {
|
|
||||||
window.clearTimeout(sr.initTimeout);
|
|
||||||
}
|
|
||||||
sr.initTimeout = window.setTimeout(_init, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return sr
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Re-runs `reveal()` for each record stored in history, effectively capturing
|
|
||||||
* any content loaded asynchronously that matches existing reveal set selectors.
|
|
||||||
*
|
|
||||||
* @return {Object} The current ScrollReveal instance.
|
|
||||||
*/
|
|
||||||
ScrollReveal.prototype.sync = function() {
|
|
||||||
if (sr.history.length && sr.isSupported()) {
|
|
||||||
for (var i = 0; i < sr.history.length; i++) {
|
|
||||||
var record = sr.history[i];
|
|
||||||
sr.reveal(record.selector, record.config, record.interval, true);
|
|
||||||
};
|
|
||||||
_init();
|
|
||||||
} else {
|
|
||||||
console.log('ScrollReveal: sync failed, no reveals found.');
|
|
||||||
}
|
|
||||||
return sr
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Private Methods
|
|
||||||
* ---------------
|
|
||||||
* These methods remain accessible only to the ScrollReveal instance, even
|
|
||||||
* though they only "exist" during instantiation outside of the constructors scope.
|
|
||||||
* --
|
|
||||||
* http://stackoverflow.com/questions/111102/how-do-javascript-closures-work
|
|
||||||
*/
|
|
||||||
|
|
||||||
function _resolveContainer(config) {
|
|
||||||
var container = config.container;
|
|
||||||
|
|
||||||
// Check if our container is defined by a selector.
|
|
||||||
if (container && typeof container == 'string') {
|
|
||||||
return config.container = window.document.querySelector(container);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if our container is defined by a node.
|
|
||||||
else if (container && !sr.tools.isNode(container)) {
|
|
||||||
console.log('ScrollReveal: Invalid container provided, using <html> instead.');
|
|
||||||
config.container = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Otherwise use <html> by default.
|
|
||||||
if (container == null) {
|
|
||||||
config.container = window.document.documentElement;
|
|
||||||
}
|
|
||||||
|
|
||||||
return config.container
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A consistent way of creating unique IDs.
|
|
||||||
* @returns {number}
|
|
||||||
*/
|
|
||||||
function _nextUid() {
|
|
||||||
return ++sr.uid;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _configure(elem, config) {
|
|
||||||
|
|
||||||
// If the element hasn’t already been configured, let’s use a clone of the
|
|
||||||
// defaults extended by the configuration passed as the second argument.
|
|
||||||
if (!elem.config) {
|
|
||||||
elem.config = sr.tools.extendClone(sr.defaults, config);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Otherwise, let’s use a clone of the existing element configuration extended
|
|
||||||
// by the configuration passed as the second argument.
|
|
||||||
else {
|
|
||||||
elem.config = sr.tools.extendClone(elem.config, config);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Infer CSS Transform axis from origin string.
|
|
||||||
if (elem.config.origin === 'top' || elem.config.origin === 'bottom') {
|
|
||||||
elem.config.axis = 'Y';
|
|
||||||
} else {
|
|
||||||
elem.config.axis = 'X';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Let’s make sure our our pixel distances are negative for top and left.
|
|
||||||
// e.g. config.origin = 'top' and config.distance = '25px' starts at `top: -25px` in CSS.
|
|
||||||
if (elem.config.origin === 'top' || elem.config.origin === 'left') {
|
|
||||||
elem.config.distance = '-' + elem.config.distance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _style(elem) {
|
|
||||||
var computed = window.getComputedStyle(elem.domEl);
|
|
||||||
|
|
||||||
if (!elem.styles) {
|
|
||||||
elem.styles = {
|
|
||||||
transition : {},
|
|
||||||
transform : {},
|
|
||||||
computed : {}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Capture any existing inline styles, and add our visibility override.
|
|
||||||
// --
|
|
||||||
// See section 4.2. in the Documentation:
|
|
||||||
// https://github.com/jlmakes/scrollreveal.js#42-improve-user-experience
|
|
||||||
elem.styles.inline = elem.domEl.getAttribute('style') || '';
|
|
||||||
elem.styles.inline += '; visibility: visible; ';
|
|
||||||
|
|
||||||
// grab the elements existing opacity.
|
|
||||||
elem.styles.computed.opacity = computed.opacity;
|
|
||||||
|
|
||||||
// grab the elements existing transitions.
|
|
||||||
if (!computed.transition || computed.transition == 'all 0s ease 0s') {
|
|
||||||
elem.styles.computed.transition = '';
|
|
||||||
} else {
|
|
||||||
elem.styles.computed.transition = computed.transition + ', ';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create transition styles
|
|
||||||
elem.styles.transition.instant = _generateTransition(elem, 0);
|
|
||||||
elem.styles.transition.delayed = _generateTransition(elem, elem.config.delay);
|
|
||||||
|
|
||||||
// Generate transform styles, first with the webkit prefix.
|
|
||||||
elem.styles.transform.initial = ' -webkit-transform:';
|
|
||||||
elem.styles.transform.target = ' -webkit-transform:';
|
|
||||||
_generateTransform(elem);
|
|
||||||
|
|
||||||
// And again without any prefix.
|
|
||||||
elem.styles.transform.initial += 'transform:';
|
|
||||||
elem.styles.transform.target += 'transform:';
|
|
||||||
_generateTransform(elem);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _generateTransition(elem, delay) {
|
|
||||||
var config = elem.config;
|
|
||||||
|
|
||||||
return '-webkit-transition: ' + elem.styles.computed.transition +
|
|
||||||
'-webkit-transform ' + config.duration / 1000 + 's '
|
|
||||||
+ config.easing + ' '
|
|
||||||
+ delay / 1000 + 's, opacity '
|
|
||||||
+ config.duration / 1000 + 's '
|
|
||||||
+ config.easing + ' '
|
|
||||||
+ delay / 1000 + 's; ' +
|
|
||||||
|
|
||||||
'transition: ' + elem.styles.computed.transition +
|
|
||||||
'transform ' + config.duration / 1000 + 's '
|
|
||||||
+ config.easing + ' '
|
|
||||||
+ delay / 1000 + 's, opacity '
|
|
||||||
+ config.duration / 1000 + 's '
|
|
||||||
+ config.easing + ' '
|
|
||||||
+ delay / 1000 + 's; '
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _generateTransform(elem) {
|
|
||||||
var config = elem.config;
|
|
||||||
var transform = elem.styles.transform;
|
|
||||||
|
|
||||||
if (parseInt(config.distance)) {
|
|
||||||
transform.initial += ' translate' + config.axis + '(' + config.distance + ')';
|
|
||||||
transform.target += ' translate' + config.axis + '(0)';
|
|
||||||
}
|
|
||||||
if (config.scale) {
|
|
||||||
transform.initial += ' scale(' + config.scale + ')';
|
|
||||||
transform.target += ' scale(1)';
|
|
||||||
}
|
|
||||||
if (config.rotate.x) {
|
|
||||||
transform.initial += ' rotateX(' + config.rotate.x + 'deg)';
|
|
||||||
transform.target += ' rotateX(0)';
|
|
||||||
}
|
|
||||||
if (config.rotate.y) {
|
|
||||||
transform.initial += ' rotateY(' + config.rotate.y + 'deg)';
|
|
||||||
transform.target += ' rotateY(0)';
|
|
||||||
}
|
|
||||||
if (config.rotate.z) {
|
|
||||||
transform.initial += ' rotateZ(' + config.rotate.z + 'deg)';
|
|
||||||
transform.target += ' rotateZ(0)';
|
|
||||||
}
|
|
||||||
transform.initial += '; opacity: ' + config.opacity + ';';
|
|
||||||
transform.target += '; opacity: ' + elem.styles.computed.opacity + ';';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _updateStore(elem) {
|
|
||||||
var container = elem.config.container;
|
|
||||||
|
|
||||||
// If this element’s container isn’t already in the store, let’s add it.
|
|
||||||
if (container && sr.store.containers.indexOf(container) == -1) {
|
|
||||||
sr.store.containers.push(elem.config.container);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the element stored with our new element.
|
|
||||||
sr.store.elements[elem.id] = elem;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _record(selector, config, interval) {
|
|
||||||
|
|
||||||
// Save the `reveal()` arguments that triggered this `_record()` call, so we
|
|
||||||
// can re-trace our steps when calling the `sync()` method.
|
|
||||||
var record = {
|
|
||||||
selector : selector,
|
|
||||||
config : config,
|
|
||||||
interval : interval
|
|
||||||
};
|
|
||||||
sr.history.push(record);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _init() {
|
|
||||||
if (sr.isSupported()) {
|
|
||||||
|
|
||||||
// Initial animate call triggers valid reveal animations on first load.
|
|
||||||
// Subsequent animate calls are made inside the event handler.
|
|
||||||
_animate();
|
|
||||||
|
|
||||||
// Then we loop through all container nodes in the store and bind event
|
|
||||||
// listeners to each.
|
|
||||||
for (var i = 0; i < sr.store.containers.length; i++) {
|
|
||||||
sr.store.containers[i].addEventListener('scroll', _handler);
|
|
||||||
sr.store.containers[i].addEventListener('resize', _handler);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Let’s also do a one-time binding of window event listeners.
|
|
||||||
if (!sr.initialized) {
|
|
||||||
window.addEventListener('scroll', _handler);
|
|
||||||
window.addEventListener('resize', _handler);
|
|
||||||
sr.initialized = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sr
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _handler() {
|
|
||||||
_requestAnimationFrame(_animate);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _setActiveSequences() {
|
|
||||||
|
|
||||||
var
|
|
||||||
active,
|
|
||||||
elem,
|
|
||||||
elemId,
|
|
||||||
sequence;
|
|
||||||
|
|
||||||
// Loop through all sequences
|
|
||||||
sr.tools.forOwn(sr.sequences, function(sequenceId) {
|
|
||||||
sequence = sr.sequences[sequenceId];
|
|
||||||
active = false;
|
|
||||||
|
|
||||||
// For each sequenced elemenet, let’s check visibility and if
|
|
||||||
// any are visible, set it’s sequence to active.
|
|
||||||
for (var i = 0; i < sequence.elemIds.length; i++) {
|
|
||||||
elemId = sequence.elemIds[i]
|
|
||||||
elem = sr.store.elements[elemId];
|
|
||||||
if (_isElemVisible(elem) && !active) {
|
|
||||||
active = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sequence.active = active;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _animate() {
|
|
||||||
|
|
||||||
var
|
|
||||||
delayed,
|
|
||||||
elem;
|
|
||||||
|
|
||||||
_setActiveSequences();
|
|
||||||
|
|
||||||
// Loop through all elements in the store
|
|
||||||
sr.tools.forOwn(sr.store.elements, function(elemId) {
|
|
||||||
|
|
||||||
elem = sr.store.elements[elemId];
|
|
||||||
delayed = _shouldUseDelay(elem);
|
|
||||||
|
|
||||||
// Let’s see if we should reveal, and if so, whether to use delay.
|
|
||||||
if (_shouldReveal(elem)) {
|
|
||||||
if (delayed) {
|
|
||||||
elem.domEl.setAttribute('style',
|
|
||||||
elem.styles.inline
|
|
||||||
+ elem.styles.transform.target
|
|
||||||
+ elem.styles.transition.delayed
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
elem.domEl.setAttribute('style',
|
|
||||||
elem.styles.inline
|
|
||||||
+ elem.styles.transform.target
|
|
||||||
+ elem.styles.transition.instant
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Let’s queue the `afterReveal` callback and tag the element.
|
|
||||||
_queueCallback('reveal', elem, delayed);
|
|
||||||
elem.revealing = true;
|
|
||||||
elem.seen = true;
|
|
||||||
|
|
||||||
if (elem.sequence) {
|
|
||||||
_queueNextInSequence(elem, delayed);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we got this far our element shouldn’t reveal, but should it reset?
|
|
||||||
else if (_shouldReset(elem)) {
|
|
||||||
elem.domEl.setAttribute('style',
|
|
||||||
elem.styles.inline
|
|
||||||
+ elem.styles.transform.initial
|
|
||||||
+ elem.styles.transition.instant
|
|
||||||
);
|
|
||||||
_queueCallback('reset', elem);
|
|
||||||
elem.revealing = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sequence callback that triggers the next element.
|
|
||||||
*/
|
|
||||||
function _queueNextInSequence(elem, delayed) {
|
|
||||||
|
|
||||||
var
|
|
||||||
elapsed = 0,
|
|
||||||
delay = 0,
|
|
||||||
sequence = sr.sequences[elem.sequence.id];
|
|
||||||
|
|
||||||
// We’re processing a sequenced element, so let's block other elements in this sequence.
|
|
||||||
sequence.blocked = true;
|
|
||||||
|
|
||||||
// Since we’re triggering animations a part of a sequence after animations on first load,
|
|
||||||
// we need to check for that condition and explicitly add the delay to our timer.
|
|
||||||
if (delayed && elem.config.useDelay == 'onload') {
|
|
||||||
delay = elem.config.delay;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If a sequence timer is already running, capture the elapsed time and clear it.
|
|
||||||
if (elem.sequence.timer) {
|
|
||||||
elapsed = Math.abs(elem.sequence.timer.started - new Date());
|
|
||||||
window.clearTimeout(elem.sequence.timer);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start a new timer.
|
|
||||||
elem.sequence.timer = { started: new Date() };
|
|
||||||
elem.sequence.timer.clock = window.setTimeout(function() {
|
|
||||||
|
|
||||||
// Sequence interval has passed, so unblock the sequence and re-run the handler.
|
|
||||||
sequence.blocked = false;
|
|
||||||
elem.sequence.timer = null;
|
|
||||||
_handler();
|
|
||||||
|
|
||||||
}, Math.abs(sequence.interval) + delay - elapsed);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _queueCallback(type, elem, delayed) {
|
|
||||||
|
|
||||||
var
|
|
||||||
elapsed = 0,
|
|
||||||
duration = 0,
|
|
||||||
callback = 'after';
|
|
||||||
|
|
||||||
// Check which callback we’re working with.
|
|
||||||
switch (type) {
|
|
||||||
|
|
||||||
case 'reveal':
|
|
||||||
duration = elem.config.duration;
|
|
||||||
if (delayed) {
|
|
||||||
duration += elem.config.delay;
|
|
||||||
}
|
|
||||||
callback += 'Reveal';
|
|
||||||
break
|
|
||||||
|
|
||||||
case 'reset':
|
|
||||||
duration = elem.config.duration;
|
|
||||||
callback += 'Reset';
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
// If a timer is already running, capture the elapsed time and clear it.
|
|
||||||
if (elem.timer) {
|
|
||||||
elapsed = Math.abs(elem.timer.started - new Date());
|
|
||||||
window.clearTimeout(elem.timer.clock);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start a new timer.
|
|
||||||
elem.timer = { started: new Date() };
|
|
||||||
elem.timer.clock = window.setTimeout(function() {
|
|
||||||
|
|
||||||
// The timer completed, so let’s fire the callback and null the timer.
|
|
||||||
elem.config[callback](elem.domEl);
|
|
||||||
elem.timer = null;
|
|
||||||
|
|
||||||
}, duration - elapsed);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _shouldReveal(elem) {
|
|
||||||
if (elem.sequence) {
|
|
||||||
var sequence = sr.sequences[elem.sequence.id];
|
|
||||||
return sequence.active
|
|
||||||
&& !sequence.blocked
|
|
||||||
&& !elem.revealing
|
|
||||||
&& !elem.disabled
|
|
||||||
}
|
|
||||||
return _isElemVisible(elem)
|
|
||||||
&& !elem.revealing
|
|
||||||
&& !elem.disabled
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _shouldUseDelay(elem) {
|
|
||||||
var config = elem.config.useDelay;
|
|
||||||
return config === 'always'
|
|
||||||
|| (config === 'onload' && !sr.initialized)
|
|
||||||
|| (config === 'once' && !elem.seen)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _shouldReset(elem) {
|
|
||||||
if (elem.sequence) {
|
|
||||||
var sequence = sr.sequences[elem.sequence.id];
|
|
||||||
return !sequence.active
|
|
||||||
&& elem.config.reset
|
|
||||||
&& elem.revealing
|
|
||||||
&& !elem.disabled
|
|
||||||
}
|
|
||||||
return !_isElemVisible(elem)
|
|
||||||
&& elem.config.reset
|
|
||||||
&& elem.revealing
|
|
||||||
&& !elem.disabled
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _getContainer(container) {
|
|
||||||
return {
|
|
||||||
width : container.clientWidth,
|
|
||||||
height : container.clientHeight
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _getScrolled(container) {
|
|
||||||
|
|
||||||
// Return the container scroll values, plus the its offset.
|
|
||||||
if (container && container !== window.document.documentElement) {
|
|
||||||
var offset = _getOffset(container);
|
|
||||||
return {
|
|
||||||
x : container.scrollLeft + offset.left,
|
|
||||||
y : container.scrollTop + offset.top
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Otherwise, default to the window object’s scroll values.
|
|
||||||
else {
|
|
||||||
return {
|
|
||||||
x : window.pageXOffset,
|
|
||||||
y : window.pageYOffset
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _getOffset(domEl) {
|
|
||||||
|
|
||||||
var
|
|
||||||
offsetTop = 0,
|
|
||||||
offsetLeft = 0,
|
|
||||||
|
|
||||||
// Grab the element’s dimensions.
|
|
||||||
offsetHeight = domEl.offsetHeight,
|
|
||||||
offsetWidth = domEl.offsetWidth;
|
|
||||||
|
|
||||||
// Now calculate the distance between the element and its parent, then
|
|
||||||
// again for the parent to its parent, and again etc... until we have the
|
|
||||||
// total distance of the element to the document’s top and left origin.
|
|
||||||
do {
|
|
||||||
if (!isNaN(domEl.offsetTop)) {
|
|
||||||
offsetTop += domEl.offsetTop;
|
|
||||||
}
|
|
||||||
if (!isNaN(domEl.offsetLeft)) {
|
|
||||||
offsetLeft += domEl.offsetLeft;
|
|
||||||
}
|
|
||||||
} while (domEl = domEl.offsetParent);
|
|
||||||
|
|
||||||
return {
|
|
||||||
top : offsetTop,
|
|
||||||
left : offsetLeft,
|
|
||||||
height : offsetHeight,
|
|
||||||
width : offsetWidth
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _isElemVisible(elem) {
|
|
||||||
|
|
||||||
var
|
|
||||||
offset = _getOffset(elem.domEl),
|
|
||||||
container = _getContainer(elem.config.container),
|
|
||||||
scrolled = _getScrolled(elem.config.container),
|
|
||||||
vF = elem.config.viewFactor,
|
|
||||||
|
|
||||||
// Define the element geometry.
|
|
||||||
elemHeight = offset.height,
|
|
||||||
elemWidth = offset.width,
|
|
||||||
elemTop = offset.top,
|
|
||||||
elemLeft = offset.left,
|
|
||||||
elemBottom = elemTop + elemHeight,
|
|
||||||
elemRight = elemLeft + elemWidth;
|
|
||||||
|
|
||||||
return confirmBounds() || isPositionFixed()
|
|
||||||
|
|
||||||
function confirmBounds() {
|
|
||||||
|
|
||||||
var
|
|
||||||
// Define the element’s functional boundaries using its view factor.
|
|
||||||
top = elemTop + elemHeight * vF,
|
|
||||||
left = elemLeft + elemWidth * vF,
|
|
||||||
bottom = elemBottom - elemHeight * vF,
|
|
||||||
right = elemRight - elemWidth * vF,
|
|
||||||
|
|
||||||
// Define the container functional boundaries using its view offset.
|
|
||||||
viewTop = scrolled.y + elem.config.viewOffset.top,
|
|
||||||
viewLeft = scrolled.x + elem.config.viewOffset.left,
|
|
||||||
viewBottom = scrolled.y - elem.config.viewOffset.bottom + container.height,
|
|
||||||
viewRight = scrolled.x - elem.config.viewOffset.right + container.width;
|
|
||||||
|
|
||||||
return top < viewBottom
|
|
||||||
&& bottom > viewTop
|
|
||||||
&& left > viewLeft
|
|
||||||
&& right < viewRight
|
|
||||||
}
|
|
||||||
|
|
||||||
function isPositionFixed() {
|
|
||||||
return (window.getComputedStyle(elem.domEl).position === 'fixed')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return ScrollReveal
|
|
||||||
|
|
||||||
})();
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* helper.tools.js
|
|
||||||
* ---------------
|
|
||||||
* Simple deep object extend, and a few other agnostic helper methods.
|
|
||||||
* gist: https://gist.github.com/jlmakes/9f104e3f1b4d86334987
|
|
||||||
*/
|
|
||||||
|
|
||||||
Tools = (function() {
|
|
||||||
|
|
||||||
Tools.prototype.isObject = function(object) {
|
|
||||||
return object !== null && typeof object === 'object' && object.constructor == Object
|
|
||||||
};
|
|
||||||
|
|
||||||
Tools.prototype.isNode = function(object) {
|
|
||||||
return typeof Node === 'object'
|
|
||||||
? object instanceof Node
|
|
||||||
: object && typeof object === 'object'
|
|
||||||
&& typeof object.nodeType === 'number'
|
|
||||||
&& typeof object.nodeName === 'string'
|
|
||||||
};
|
|
||||||
|
|
||||||
Tools.prototype.forOwn = function(object, callback) {
|
|
||||||
if (!this.isObject(object)) {
|
|
||||||
throw new TypeError('Expected "object", but received "' + typeof object + '".');
|
|
||||||
} else {
|
|
||||||
for (var property in object) {
|
|
||||||
if (object.hasOwnProperty(property)) {
|
|
||||||
callback(property);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Tools.prototype.extend = function(target, source) {
|
|
||||||
this.forOwn(source, function(property) {
|
|
||||||
if (this.isObject(source[property])) {
|
|
||||||
if (!target[property] || !this.isObject(target[property])) {
|
|
||||||
target[property] = {};
|
|
||||||
}
|
|
||||||
this.extend(target[property], source[property]);
|
|
||||||
} else {
|
|
||||||
target[property] = source[property];
|
|
||||||
}
|
|
||||||
}.bind(this));
|
|
||||||
return target
|
|
||||||
};
|
|
||||||
|
|
||||||
Tools.prototype.extendClone = function(target, source) {
|
|
||||||
return this.extend(this.extend({}, target), source)
|
|
||||||
};
|
|
||||||
|
|
||||||
Tools.prototype.isMobile = function() {
|
|
||||||
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
|
|
||||||
};
|
|
||||||
|
|
||||||
function Tools() {};
|
|
||||||
return Tools
|
|
||||||
|
|
||||||
})();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_requestAnimationFrame = window.requestAnimationFrame ||
|
|
||||||
window.webkitRequestAnimationFrame ||
|
|
||||||
window.mozRequestAnimationFrame;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}).call(this);
|
|
||||||
|
|
||||||
return this.ScrollReveal;
|
|
||||||
|
|
||||||
}));
|
|
1
vendor/scrollreveal/scrollreveal.min.js
vendored
1
vendor/scrollreveal/scrollreveal.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user