/*****WOW JS******/ (function (global, factory) { if (typeof define === "function" && define.amd) { define(['module', 'exports'], factory); } else if (typeof exports !== "undefined") { factory(module, exports); } else { var mod = { exports: {} }; factory(mod, mod.exports); global.WOW = mod.exports; } })(this, function (module, exports) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _class, _temp; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function isIn(needle, haystack) { return haystack.indexOf(needle) >= 0; } function extend(custom, defaults) { for (var key in defaults) { if (custom[key] == null) { var value = defaults[key]; custom[key] = value; } } return custom; } function isMobile(agent) { return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(agent) ); } function createEvent(event) { var bubble = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; var cancel = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2]; var detail = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; var customEvent = void 0; if (document.createEvent != null) { // W3C DOM customEvent = document.createEvent('CustomEvent'); customEvent.initCustomEvent(event, bubble, cancel, detail); } else if (document.createEventObject != null) { // IE DOM < 9 customEvent = document.createEventObject(); customEvent.eventType = event; } else { customEvent.eventName = event; } return customEvent; } function emitEvent(elem, event) { if (elem.dispatchEvent != null) { // W3C DOM elem.dispatchEvent(event); } else if (event in (elem != null)) { elem[event](); } else if ('on' + event in (elem != null)) { elem['on' + event](); } } function addEvent(elem, event, fn) { if (elem.addEventListener != null) { // W3C DOM elem.addEventListener(event, fn, false); } else if (elem.attachEvent != null) { // IE DOM elem.attachEvent('on' + event, fn); } else { // fallback elem[event] = fn; } } function removeEvent(elem, event, fn) { if (elem.removeEventListener != null) { // W3C DOM elem.removeEventListener(event, fn, false); } else if (elem.detachEvent != null) { // IE DOM elem.detachEvent('on' + event, fn); } else { // fallback delete elem[event]; } } function getInnerHeight() { if ('innerHeight' in window) { return window.innerHeight; } return document.documentElement.clientHeight; } // Minimalistic WeakMap shim, just in case. var WeakMap = window.WeakMap || window.MozWeakMap || function () { function WeakMap() { _classCallCheck(this, WeakMap); this.keys = []; this.values = []; } _createClass(WeakMap, [{ key: 'get', value: function get(key) { for (var i = 0; i < this.keys.length; i++) { var item = this.keys[i]; if (item === key) { return this.values[i]; } } return undefined; } }, { key: 'set', value: function set(key, value) { for (var i = 0; i < this.keys.length; i++) { var item = this.keys[i]; if (item === key) { this.values[i] = value; return this; } } this.keys.push(key); this.values.push(value); return this; } }]); return WeakMap; }(); // Dummy MutationObserver, to avoid raising exceptions. var MutationObserver = window.MutationObserver || window.WebkitMutationObserver || window.MozMutationObserver || (_temp = _class = function () { function MutationObserver() { _classCallCheck(this, MutationObserver); if (typeof console !== 'undefined' && console !== null) { console.warn('MutationObserver is not supported by your browser.'); console.warn('WOW.js cannot detect dom mutations, please call .sync() after loading new content.'); } } _createClass(MutationObserver, [{ key: 'observe', value: function observe() {} }]); return MutationObserver; }(), _class.notSupported = true, _temp); // getComputedStyle shim, from http://stackoverflow.com/a/21797294 var getComputedStyle = window.getComputedStyle || function getComputedStyle(el) { var getComputedStyleRX = /(\-([a-z]){1})/g; return { getPropertyValue: function getPropertyValue(prop) { if (prop === 'float') { prop = 'styleFloat'; } if (getComputedStyleRX.test(prop)) { prop.replace(getComputedStyleRX, function (_, _char) { return _char.toUpperCase(); }); } var currentStyle = el.currentStyle; return (currentStyle != null ? currentStyle[prop] : void 0) || null; } }; }; var WOW = function () { function WOW() { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; _classCallCheck(this, WOW); this.defaults = { boxClass: 'wow', animateClass: 'animated', offset: 0, mobile: true, live: true, callback: null, scrollContainer: null, resetAnimation: true }; this.animate = function animateFactory() { if ('requestAnimationFrame' in window) { return function (callback) { return window.requestAnimationFrame(callback); }; } return function (callback) { return callback(); }; }(); this.vendors = ['moz', 'webkit']; this.start = this.start.bind(this); this.resetAnimation = this.resetAnimation.bind(this); this.scrollHandler = this.scrollHandler.bind(this); this.scrollCallback = this.scrollCallback.bind(this); this.scrolled = true; this.config = extend(options, this.defaults); if (options.scrollContainer != null) { this.config.scrollContainer = document.querySelector(options.scrollContainer); } // Map of elements to animation names: this.animationNameCache = new WeakMap(); this.wowEvent = createEvent(this.config.boxClass); } _createClass(WOW, [{ key: 'init', value: function init() { this.element = window.document.documentElement; if (isIn(document.readyState, ['interactive', 'complete'])) { this.start(); } else { addEvent(document, 'DOMContentLoaded', this.start); } this.finished = []; } }, { key: 'start', value: function start() { var _this = this; this.stopped = false; this.boxes = [].slice.call(this.element.querySelectorAll('.' + this.config.boxClass)); this.all = this.boxes.slice(0); if (this.boxes.length) { if (this.disabled()) { this.resetStyle(); } else { for (var i = 0; i < this.boxes.length; i++) { var box = this.boxes[i]; this.applyStyle(box, true); } } } if (!this.disabled()) { addEvent(this.config.scrollContainer || window, 'scroll', this.scrollHandler); addEvent(window, 'resize', this.scrollHandler); this.interval = setInterval(this.scrollCallback, 50); } if (this.config.live) { var mut = new MutationObserver(function (records) { for (var j = 0; j < records.length; j++) { var record = records[j]; for (var k = 0; k < record.addedNodes.length; k++) { var node = record.addedNodes[k]; _this.doSync(node); } } return undefined; }); mut.observe(document.body, { childList: true, subtree: true }); } } }, { key: 'stop', value: function stop() { this.stopped = true; removeEvent(this.config.scrollContainer || window, 'scroll', this.scrollHandler); removeEvent(window, 'resize', this.scrollHandler); if (this.interval != null) { clearInterval(this.interval); } } }, { key: 'sync', value: function sync() { if (MutationObserver.notSupported) { this.doSync(this.element); } } }, { key: 'doSync', value: function doSync(element) { if (typeof element === 'undefined' || element === null) { element = this.element; } if (element.nodeType !== 1) { return; } element = element.parentNode || element; var iterable = element.querySelectorAll('.' + this.config.boxClass); for (var i = 0; i < iterable.length; i++) { var box = iterable[i]; if (!isIn(box, this.all)) { this.boxes.push(box); this.all.push(box); if (this.stopped || this.disabled()) { this.resetStyle(); } else { this.applyStyle(box, true); } this.scrolled = true; } } } }, { key: 'show', value: function show(box) { this.applyStyle(box); box.className = box.className + ' ' + this.config.animateClass; if (this.config.callback != null) { this.config.callback(box); } emitEvent(box, this.wowEvent); if (this.config.resetAnimation) { addEvent(box, 'animationend', this.resetAnimation); addEvent(box, 'oanimationend', this.resetAnimation); addEvent(box, 'webkitAnimationEnd', this.resetAnimation); addEvent(box, 'MSAnimationEnd', this.resetAnimation); } return box; } }, { key: 'applyStyle', value: function applyStyle(box, hidden) { var _this2 = this; var duration = box.getAttribute('data-wow-duration'); var delay = box.getAttribute('data-wow-delay'); var iteration = box.getAttribute('data-wow-iteration'); return this.animate(function () { return _this2.customStyle(box, hidden, duration, delay, iteration); }); } }, { key: 'resetStyle', value: function resetStyle() { for (var i = 0; i < this.boxes.length; i++) { var box = this.boxes[i]; box.style.visibility = 'visible'; } return undefined; } }, { key: 'resetAnimation', value: function resetAnimation(event) { if (event.type.toLowerCase().indexOf('animationend') >= 0) { var target = event.target || event.srcElement; target.className = target.className.replace(this.config.animateClass, '').trim(); } } }, { key: 'customStyle', value: function customStyle(box, hidden, duration, delay, iteration) { if (hidden) { this.cacheAnimationName(box); } box.style.visibility = hidden ? 'hidden' : 'visible'; if (duration) { this.vendorSet(box.style, { animationDuration: duration }); } if (delay) { this.vendorSet(box.style, { animationDelay: delay }); } if (iteration) { this.vendorSet(box.style, { animationIterationCount: iteration }); } this.vendorSet(box.style, { animationName: hidden ? 'none' : this.cachedAnimationName(box) }); return box; } }, { key: 'vendorSet', value: function vendorSet(elem, properties) { for (var name in properties) { if (properties.hasOwnProperty(name)) { var value = properties[name]; elem['' + name] = value; for (var i = 0; i < this.vendors.length; i++) { var vendor = this.vendors[i]; elem['' + vendor + name.charAt(0).toUpperCase() + name.substr(1)] = value; } } } } }, { key: 'vendorCSS', value: function vendorCSS(elem, property) { var style = getComputedStyle(elem); var result = style.getPropertyCSSValue(property); for (var i = 0; i < this.vendors.length; i++) { var vendor = this.vendors[i]; result = result || style.getPropertyCSSValue('-' + vendor + '-' + property); } return result; } }, { key: 'animationName', value: function animationName(box) { var aName = void 0; try { aName = this.vendorCSS(box, 'animation-name').cssText; } catch (error) { // Opera, fall back to plain property value aName = getComputedStyle(box).getPropertyValue('animation-name'); } if (aName === 'none') { return ''; // SVG/Firefox, unable to get animation name? } return aName; } }, { key: 'cacheAnimationName', value: function cacheAnimationName(box) { // https://bugzilla.mozilla.org/show_bug.cgi?id=921834 // box.dataset is not supported for SVG elements in Firefox return this.animationNameCache.set(box, this.animationName(box)); } }, { key: 'cachedAnimationName', value: function cachedAnimationName(box) { return this.animationNameCache.get(box); } }, { key: 'scrollHandler', value: function scrollHandler() { this.scrolled = true; } }, { key: 'scrollCallback', value: function scrollCallback() { if (this.scrolled) { this.scrolled = false; var results = []; for (var i = 0; i < this.boxes.length; i++) { var box = this.boxes[i]; if (box) { if (this.isVisible(box)) { this.show(box); continue; } results.push(box); } } this.boxes = results; if (!this.boxes.length && !this.config.live) { this.stop(); } } } }, { key: 'offsetTop', value: function offsetTop(element) { // SVG elements don't have an offsetTop in Firefox. // This will use their nearest parent that has an offsetTop. // Also, using ('offsetTop' of element) causes an exception in Firefox. while (element.offsetTop === undefined) { element = element.parentNode; } var top = element.offsetTop; while (element.offsetParent) { element = element.offsetParent; top += element.offsetTop; } return top; } }, { key: 'isVisible', value: function isVisible(box) { var offset = box.getAttribute('data-wow-offset') || this.config.offset; var viewTop = this.config.scrollContainer && this.config.scrollContainer.scrollTop || window.pageYOffset; var viewBottom = viewTop + Math.min(this.element.clientHeight, getInnerHeight()) - offset; var top = this.offsetTop(box); var bottom = top + box.clientHeight; return top <= viewBottom && bottom >= viewTop; } }, { key: 'disabled', value: function disabled() { return !this.config.mobile && isMobile(navigator.userAgent); } }]); return WOW; }(); exports.default = WOW; module.exports = exports['default']; }); /*! Waypoints - 4.0.1 Copyright © 2011-2016 Caleb Troughton Licensed under the MIT license. https://github.com/imakewebthings/waypoints/blob/master/licenses.txt */ !function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.Context.refreshAll();for(var e in i)i[e].enabled=!0;return this},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,n.windowContext||(n.windowContext=!0,n.windowContext=new e(window)),this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical),i=this.element==this.element.window;t&&e&&!i&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s];if(null!==a.triggerPoint){var l=o.oldScroll=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=Math.floor(y+l-f),h=w=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.$element=e(t)}var e=window.jQuery,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); /*! Waypoints Inview Shortcut - 4.0.1 Copyright © 2011-2016 Caleb Troughton Licensed under the MIT license. https://github.com/imakewebthings/waypoints/blob/master/licenses.txt */ !function(){"use strict";function t(){}function e(t){this.options=i.Adapter.extend({},e.defaults,t),this.axis=this.options.horizontal?"horizontal":"vertical",this.waypoints=[],this.element=this.options.element,this.createWaypoints()}var i=window.Waypoint;e.prototype.createWaypoints=function(){for(var t={vertical:[{down:"enter",up:"exited",offset:"100%"},{down:"entered",up:"exit",offset:"bottom-in-view"},{down:"exit",up:"entered",offset:0},{down:"exited",up:"enter",offset:function(){return-this.adapter.outerHeight()}}],horizontal:[{right:"enter",left:"exited",offset:"100%"},{right:"entered",left:"exit",offset:"right-in-view"},{right:"exit",left:"entered",offset:0},{right:"exited",left:"enter",offset:function(){return-this.adapter.outerWidth()}}]},e=0,i=t[this.axis].length;i>e;e++){var n=t[this.axis][e];this.createWaypoint(n)}},e.prototype.createWaypoint=function(t){var e=this;this.waypoints.push(new i({context:this.options.context,element:this.options.element,enabled:this.options.enabled,handler:function(t){return function(i){e.options[t[i]].call(e,i)}}(t),offset:t.offset,horizontal:this.options.horizontal}))},e.prototype.destroy=function(){for(var t=0,e=this.waypoints.length;e>t;t++)this.waypoints[t].destroy();this.waypoints=[]},e.prototype.disable=function(){for(var t=0,e=this.waypoints.length;e>t;t++)this.waypoints[t].disable()},e.prototype.enable=function(){for(var t=0,e=this.waypoints.length;e>t;t++)this.waypoints[t].enable()},e.defaults={context:window,enabled:!0,enter:t,entered:t,exit:t,exited:t},i.Inview=e}(); /* * Teletype jQuery Plugin * @version 0.1.6 * * @author Steve Whiteley * @see http://teletype.rocks * @see https://github.com/stvwhtly/jquery-teletype-plugin * * Copyright (c) 2015 Steve Whiteley * Dual licensed under the MIT or GPL Version 2 licenses. * */ ( function ( $ ) { $.fn.teletype = function( options ) { var settings = $.extend( {}, $.fn.teletype.defaults, options ); var object = this, self = $( this ), output = null, current = { string: '', index: 0, position: 0, loop: 0 }; var next = function() { current.index++; if ( current.index >= settings.text.length ) { current.index = 0; current.loop++; if ( settings.loop !== false && ( settings.loop == current.loop ) ) { return false; } } current.position = 0; setCurrentString(); if ( typeof( settings.callbackNext ) == 'function' ) { settings.callbackNext( current, object ); } return true; }; var type = function() { if ( settings.prefix && current.position === 0 ) { if ( current.loop === 0 && current.index === 0 ) { $( '' ).addClass( 'teletype-prefix' ).html( settings.prefix ).prependTo( self ); } } var letters = current.string.split( '' ), letter = letters[current.position], start = current.position + 1; if ( letter == '^' || letter == '~' ) { var end = current.string.substr( start ).search( /[^0-9]/ ); if ( end == -1 ) { end = current.string.length; } var value = current.string.substr( start, end ); if ( $.isNumeric( value ) ) { current.string = current.string.replace( letter + value, '' ); if ( letter == '^' ) { window.setTimeout( function() { window.setTimeout( type, delay( settings.typeDelay ) ); }, value ); } else { var index = current.position - value; current.string = current.string.substr( 0, index - 1 ) + current.string.substr( current.position - 1 ); window.setTimeout( function() { backspace( Math.max( index, 0 ) ); }, delay( settings.backDelay ) ); } return; } } else if ( letter == '\\' ) { var nextChar = current.string.substr( start, 1 ); if ( nextChar == 'n' ) { current.position++; letter = '
'; } } if ( letter !== undefined ) { output.html( output.html() + letter ); } current.position++; if ( current.position < current.string.length ) { window.setTimeout( type, delay( settings.typeDelay ) ); } else if ( settings.preserve === false ) { window.setTimeout( function() { window.setTimeout( backspace, delay( settings.backDelay ) ); }, settings.delay ); } else { output.html( output.html() + '' + settings.prefix + '' ); if ( next() ) { window.setTimeout( function() { window.setTimeout( type, delay( settings.typeDelay ) ); }, settings.delay ); } else if ( typeof( settings.callbackFinished ) == 'function' ) { settings.callbackFinished( object ); } } if ( typeof( settings.callbackType ) == 'function' ) { settings.callbackType( letter, current, object ); } }; var backspace = function( stop ) { if ( !stop ) { stop = 0; } if ( current.position > stop ) { output.html( output.html().slice( 0, -1 ) ); window.setTimeout( function() { backspace( stop ); }, delay( settings.backDelay ) ); current.position--; } else { if ( stop === 0 ) { if ( next() === false ) { return; } } window.setTimeout( type, delay( settings.typeDelay ) ); } }; var delay = function( speed ) { var time = parseInt( speed ); if ( settings.humanise ) { time += Math.floor( Math.random() * 200 ); } return time; }; var setCurrentString = function() { current.string = settings.text[current.index].replace(/\n/g, "\\n"); } this.setCursor = function( cursor ) { $('.teletype-cursor', self).text( cursor ); }; return this.each( function() { setCurrentString(); self.addClass( 'teletype' ).empty(); output = $( '' ).addClass( 'teletype-text' ).appendTo( self ); if ( settings.cursor ) { var cursor = $( '' ) .addClass( 'teletype-cursor' ) .appendTo( self ); object.setCursor( settings.cursor ); setInterval ( function() { if ( settings.smoothBlink ) { cursor.animate( { opacity: 0 } ).animate( { opacity: 1 } ); } else { cursor.delay(500).fadeTo(0,0).delay(500).fadeTo(0,1); } }, settings.blinkSpeed ); } type(); } ); }; $.fn.teletype.defaults = { text: [ 'one', 'two', 'three' ], typeDelay: 100, backDelay: 50, blinkSpeed: 1000, delay: 2000, cursor: '|', preserve: false, prefix: '', loop: 0, humanise: true, smoothBlink: true, callbackNext: null, callbackType: null, callbackFinished: null }; }( jQuery ) ); /** * jquery.gridrotator.js v1.1.0 * http://www.codrops.com * * Licensed under the MIT license. * http://www.opensource.org/licenses/mit-license.php * * Copyright 2012, Codrops * http://www.codrops.com */ ;( function( $, window, undefined ) { 'use strict'; /* * debouncedresize: special jQuery event that happens once after a window resize * * latest version and complete README available on Github: * https://github.com/louisremi/jquery-smartresize/blob/master/jquery.debouncedresize.js * * Copyright 2011 @louis_remi * Licensed under the MIT license. */ var $event = $.event, $special, resizeTimeout; $special = $event.special.debouncedresize = { setup: function() { $( this ).on( "resize", $special.handler ); }, teardown: function() { $( this ).off( "resize", $special.handler ); }, handler: function( event, execAsap ) { // Save the context var context = this, args = arguments, dispatch = function() { // set correct event type event.type = "debouncedresize"; $event.dispatch.apply( context, args ); }; if ( resizeTimeout ) { clearTimeout( resizeTimeout ); } execAsap ? dispatch() : resizeTimeout = setTimeout( dispatch, $special.threshold ); }, threshold: 100 }; // http://www.hardcode.nl/subcategory_1/article_317-array-shuffle-function Array.prototype.shuffle = function() { var i=this.length,p,t; while (i--) { p = Math.floor(Math.random()*i); t = this[i]; this[i]=this[p]; this[p]=t; } return this; }; // HTML5 PageVisibility API // http://www.html5rocks.com/en/tutorials/pagevisibility/intro/ // by Joe Marini (@joemarini) function getHiddenProp(){ var prefixes = ['webkit','moz','ms','o']; // if 'hidden' is natively supported just return it if ('hidden' in document) return 'hidden'; // otherwise loop over all the known prefixes until we find one for (var i = 0; i < prefixes.length; i++){ if ((prefixes[i] + 'Hidden') in document) return prefixes[i] + 'Hidden'; } // otherwise it's not supported return null; } function isHidden() { var prop = getHiddenProp(); if (!prop) return false; return document[prop]; } function isEmpty( obj ) { return Object.keys(obj).length === 0; } // global var $window = $( window ), Modernizr = window.Modernizr; $.GridRotator = function( options, element ) { this.$el = $( element ); if( Modernizr.backgroundsize ) { var self = this; this.$el.addClass( 'ri-grid-loading' ); this._init( options ); } }; // the options $.GridRotator.defaults = { // number of rows rows : 4, // number of columns columns : 10, w1024 : { rows : 3, columns : 8 }, w768 : {rows : 3,columns : 7 }, w480 : {rows : 3,columns : 5 }, w320 : {rows : 2,columns : 4 }, w240 : {rows : 2,columns : 3 }, // step: number of items that are replaced at the same time // random || [some number] // note: for performance issues, the number "can't" be > options.maxStep step : 'random', // change it as you wish.. maxStep : 3, // prevent user to click the items preventClick : true, // animation type // showHide || fadeInOut || // slideLeft || slideRight || slideTop || slideBottom || // rotateBottom || rotateLeft || rotateRight || rotateTop || // scale || // rotate3d || // rotateLeftScale || rotateRightScale || rotateTopScale || rotateBottomScale || // random animType : 'random', // animation speed animSpeed : 800, // animation easings animEasingOut : 'linear', animEasingIn: 'linear', // the item(s) will be replaced every 3 seconds // note: for performance issues, the time "can't" be < 300 ms interval : 3000, // if false the animations will not start // use false if onhover is true for example slideshow : true, // if true the items will switch when hovered onhover : false, // ids of elements that shouldn't change nochange : [] }; $.GridRotator.prototype = { _init : function( options ) { // options this.options = $.extend( true, {}, $.GridRotator.defaults, options ); // cache some elements + variables this._config(); }, _config : function() { var self = this, transEndEventNames = { 'WebkitTransition' : 'webkitTransitionEnd', 'MozTransition' : 'transitionend', 'OTransition' : 'oTransitionEnd', 'msTransition' : 'MSTransitionEnd', 'transition' : 'transitionend' }; // support CSS transitions and 3d transforms this.supportTransitions = Modernizr.csstransitions; this.supportTransforms3D = Modernizr.csstransforms3d; this.transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ] + '.gridrotator'; // all animation types for the random option this.animTypes = this.supportTransforms3D ? [ 'fadeInOut', 'slideLeft', 'slideRight', 'slideTop', 'slideBottom', 'rotateLeft', 'rotateRight', 'rotateTop', 'rotateBottom', 'scale', 'rotate3d', 'rotateLeftScale', 'rotateRightScale', 'rotateTopScale', 'rotateBottomScale' ] : [ 'fadeInOut', 'slideLeft', 'slideRight', 'slideTop', 'slideBottom' ]; this.animType = this.options.animType; if( this.animType !== 'random' && !this.supportTransforms3D && $.inArray( this.animType, this.animTypes ) === -1 && this.animType !== 'showHide' ) { // fallback to 'fadeInOut' if user sets a type which is not supported this.animType = 'fadeInOut'; } this.animTypesTotal = this.animTypes.length; // the
    where the items are placed this.$list = this.$el.children( 'ul' ); // remove images and add background-image to anchors // preload the images before var loaded = 0, $imgs = this.$list.find( 'img' ), count = $imgs.length; $imgs.each( function() { var $img = $( this ), src = $img.attr( 'src' ); $( '' ).load( function() { ++loaded; $img.parent().css( 'background-image', 'url(' + src + ')' ); if( loaded === count ) { $imgs.remove(); self.$el.removeClass( 'ri-grid-loading' ); // the items self.$items = self.$list.children( 'li' ); // make a copy of the items self.$itemsCache = self.$items.clone(); // total number of items self.itemsTotal = self.$items.length; // the items that will be out of the grid // actually the item's child (anchor element) self.outItems= []; self._layout( function() { self._initEvents(); } ); // replace [options.step] items after [options.interval] time // the items that go out are randomly chosen, while the ones that get in // follow a "First In First Out" logic self._start(); } } ).attr( 'src', src ) } ); }, _layout : function( callback ) { var self = this; // sets the grid dimentions based on the container's width this._setGridDim(); // reset this.$list.empty(); this.$items = this.$itemsCache.clone().appendTo( this.$list ); var $outItems = this.$items.filter( ':gt(' + ( this.showTotal - 1 ) + ')' ), $outAItems = $outItems.children( 'a' ); this.outItems.length = 0; $outAItems.each( function( i ) { self.outItems.push( $( this ) ); } ); $outItems.remove(); // container's width var containerWidth = ( document.defaultView ) ? parseInt( document.defaultView.getComputedStyle( this.$el.get( 0 ), null ).width ) : this.$el.width(), // item's width itemWidth = Math.floor( containerWidth / (this.columns-1) ), // calculate gap gapWidth = containerWidth - ( this.columns * Math.floor( itemWidth ) ); for( var i = 0; i < this.rows; ++i ) { for( var j = 0; j < this.columns; ++j ) { var idx = this.columns * i + j, $item = this.$items.eq( idx ); $item.css( { width : j < Math.floor( gapWidth ) ? itemWidth + 1 : itemWidth, height : itemWidth } ); if( $.inArray( idx, this.options.nochange ) !== -1 ) { $item.addClass( 'ri-nochange' ).data( 'nochange', true ); } } } if( this.options.preventClick ) { this.$items.children().css( 'cursor', 'default' ).on( 'click.gridrotator', false ); } if( callback ) { callback.call(); } }, // set the grid rows and columns _setGridDim : function() { // container's width var c_w = this.$el.width(); // we will choose the number of rows/columns according to the container's width and the values set in the plugin options switch( true ) { case ( c_w < 240 ) : this.rows = this.options.w240.rows; this.columns = this.options.w240.columns; break; case ( c_w < 320 ) : this.rows = this.options.w320.rows; this.columns = this.options.w320.columns; break; case ( c_w < 480 ) : this.rows = this.options.w480.rows; this.columns = this.options.w480.columns; break; case ( c_w < 768 ) : this.rows = this.options.w768.rows; this.columns = this.options.w768.columns; break; case ( c_w < 1024 ) : this.rows = this.options.w1024.rows; this.columns = this.options.w1024.columns; break; default : this.rows = this.options.rows; this.columns = this.options.columns; break; } if( c_w < 480) { this.showTotal = 5; } else { this.showTotal = this.rows * this.columns; } // console.log("showTotal==>"+this.showTotal); }, // init window resize event _initEvents : function() { var self = this; $window.on( 'debouncedresize.gridrotator', function() { self._layout(); } ); // use the property name to generate the prefixed event name var visProp = getHiddenProp(); // HTML5 PageVisibility API // http://www.html5rocks.com/en/tutorials/pagevisibility/intro/ // by Joe Marini (@joemarini) if (visProp) { var evtname = visProp.replace(/[H|h]idden/,'') + 'visibilitychange'; document.addEventListener(evtname, function() { self._visChange(); } ); } if( !Modernizr.touch && this.options.onhover ) { self.$items.on( 'mouseenter.gridrotator', function() { var $item = $( this ); if( !$item.data( 'active' ) && !$item.data( 'hovered' ) && !$item.data( 'nochange' ) ) { $item.data( 'hovered', true ); self._replace( $item ); } } ).on( 'mouseleave.gridrotator', function() { $( this ).data( 'hovered', false ); } ); } }, _visChange : function() { isHidden() ? clearTimeout( this.playtimeout ) : this._start(); }, // start rotating elements _start : function() { if( this.showTotal < this.itemsTotal && this.options.slideshow ) { this._showNext(); } }, // get which type of animation _getAnimType : function() { return this.animType === 'random' ? this.animTypes[ Math.floor( Math.random() * this.animTypesTotal ) ] : this.animType; }, // get css properties for the transition effect _getAnimProperties : function( $out ) { var startInProp = {}, startOutProp = {}, endInProp = {}, endOutProp = {}, animType = this._getAnimType(), speed, delay = 0; switch( animType ) { case 'showHide' : speed = 0; endOutProp.opacity = 0; break; case 'fadeInOut' : endOutProp.opacity = 0; break; case 'slideLeft' : startInProp.left = $out.width(); endInProp.left = 0; endOutProp.left = -$out.width(); break; case 'slideRight' : startInProp.left = -$out.width(); endInProp.left = 0; endOutProp.left = $out.width(); break; case 'slideTop' : startInProp.top = $out.height(); endInProp.top = 0; endOutProp.top = -$out.height(); break; case 'slideBottom' : startInProp.top = -$out.height(); endInProp.top = 0; endOutProp.top = $out.height(); break; case 'rotateLeft' : speed = this.options.animSpeed / 2; startInProp.transform = 'rotateY(90deg)'; endInProp.transform = 'rotateY(0deg)'; delay = speed; endOutProp.transform = 'rotateY(-90deg)'; break; case 'rotateRight' : speed = this.options.animSpeed / 2; startInProp.transform = 'rotateY(-90deg)'; endInProp.transform = 'rotateY(0deg)'; delay = speed; endOutProp.transform = 'rotateY(90deg)'; break; case 'rotateTop' : speed = this.options.animSpeed / 2; startInProp.transform= 'rotateX(90deg)'; endInProp.transform = 'rotateX(0deg)'; delay = speed; endOutProp.transform = 'rotateX(-90deg)'; break; case 'rotateBottom' : speed = this.options.animSpeed / 2; startInProp.transform = 'rotateX(-90deg)'; endInProp.transform = 'rotateX(0deg)'; delay = speed; endOutProp.transform = 'rotateX(90deg)'; break; case 'scale' : speed = this.options.animSpeed / 2; startInProp.transform = 'scale(0)'; startOutProp.transform = 'scale(1)'; endInProp.transform = 'scale(1)'; delay = speed; endOutProp.transform = 'scale(0)'; break; case 'rotateLeftScale' : startOutProp.transform = 'scale(1)'; speed = this.options.animSpeed / 2; startInProp.transform = 'scale(0.3) rotateY(90deg)'; endInProp.transform = 'scale(1) rotateY(0deg)'; delay = speed; endOutProp.transform = 'scale(0.3) rotateY(-90deg)'; break; case 'rotateRightScale' : startOutProp.transform = 'scale(1)'; speed = this.options.animSpeed / 2; startInProp.transform = 'scale(0.3) rotateY(-90deg)'; endInProp.transform = 'scale(1) rotateY(0deg)'; delay = speed; endOutProp.transform = 'scale(0.3) rotateY(90deg)'; break; case 'rotateTopScale' : startOutProp.transform = 'scale(1)'; speed = this.options.animSpeed / 2; startInProp.transform = 'scale(0.3) rotateX(90deg)'; endInProp.transform = 'scale(1) rotateX(0deg)'; delay = speed; endOutProp.transform = 'scale(0.3) rotateX(-90deg)'; break; case 'rotateBottomScale' : startOutProp.transform = 'scale(1)'; speed = this.options.animSpeed / 2; startInProp.transform = 'scale(0.3) rotateX(-90deg)'; endInProp.transform = 'scale(1) rotateX(0deg)'; delay = speed; endOutProp.transform = 'scale(0.3) rotateX(90deg)'; break; case 'rotate3d' : speed = this.options.animSpeed / 2; startInProp.transform = 'rotate3d( 1, 1, 0, 90deg )'; endInProp.transform = 'rotate3d( 1, 1, 0, 0deg )'; delay = speed; endOutProp.transform = 'rotate3d( 1, 1, 0, -90deg )'; break; } return { startInProp : startInProp, startOutProp : startOutProp, endInProp : endInProp, endOutProp : endOutProp, delay : delay, animSpeed : speed != undefined ? speed : this.options.animSpeed }; }, // show next [option.step] elements _showNext : function( time ) { var self = this; clearTimeout( this.playtimeout ); this.playtimeout = setTimeout( function() { var step = self.options.step, max= self.options.maxStep, min = 1; if( max > self.showTotal ) { max = self.showTotal; } // number of items to swith at this point of time var nmbOut = step === 'random' ? Math.floor( Math.random() * max + min ) : Math.min( Math.abs( step ) , max ) , // array with random indexes. These will be the indexes of the items we will replace randArr = self._getRandom( nmbOut, self.showTotal ); for( var i = 0; i < nmbOut; ++i ) { // element to go out var $out = self.$items.eq( randArr[ i ] ); // if element is active, which means it is currently animating, // then we need to get different positions.. if( $out.data( 'active' ) || $out.data( 'nochange' ) ) { // one of the items is active, call again.. self._showNext( 1 ); return false; } self._replace( $out ); } // again and again.. self._showNext(); }, time || Math.max( Math.abs( this.options.interval ) , 300 ) ); }, _replace : function( $out ) { $out.data( 'active', true ); var self = this, $outA = $out.children( 'a:last' ), newElProp = { width : $outA.width(), height : $outA.height() }; // element stays active $out.data( 'active', true ); // get the element (anchor) that will go in (first one inserted in this.outItems) var $inA = this.outItems.shift(); // save element that went out this.outItems.push( $outA.clone().css( 'transition', 'none' ) ); // prepend in element $inA.css( newElProp ).prependTo( $out ); var animProp = this._getAnimProperties( $outA ); $inA.css( animProp.startInProp ); $outA.css( animProp.startOutProp ); this._setTransition( $inA, 'all', animProp.animSpeed, animProp.delay, this.options.animEasingIn ); this._setTransition( $outA, 'all', animProp.animSpeed, 0, this.options.animEasingOut ); this._applyTransition( $inA, animProp.endInProp, animProp.animSpeed, function() { var $el = $( this ), t = animProp.animSpeed === self.options.animSpeed && isEmpty( animProp.endInProp ) ? animProp.animSpeed : 0; setTimeout( function() { if( self.supportTransitions ) { $el.off( self.transEndEventName ); } $el.next().remove(); $el.parent().data( 'active', false ); }, t ); }, animProp.animSpeed === 0 || isEmpty( animProp.endInProp ) ); this._applyTransition( $outA, animProp.endOutProp, animProp.animSpeed ); }, _getRandom : function( cnt, limit ) { var randArray = []; for( var i = 0; i < limit; ++i ) { randArray.push( i ) } return randArray.shuffle().slice( 0, cnt ); }, _setTransition : function( el, prop, speed, delay, easing ) { setTimeout( function() { el.css( 'transition', prop + ' ' + speed + 'ms ' + delay + 'ms ' + easing ); }, 25 ); }, _applyTransition : function( el, styleCSS, speed, fncomplete, force ) { var self = this; setTimeout( function() { $.fn.applyStyle = self.supportTransitions ? $.fn.css : $.fn.animate; if( fncomplete && self.supportTransitions ) { el.on( self.transEndEventName, fncomplete ); if( force ) { fncomplete.call( el ); } } fncomplete = fncomplete || function() { return false; }; el.stop().applyStyle( styleCSS, $.extend( true, [], { duration : speed + 'ms', complete : fncomplete } ) ); }, 25 ); } }; var logError = function( message ) { if ( window.console ) { window.console.error( message ); } }; $.fn.gridrotator = function( options ) { var instance = $.data( this, 'gridrotator' ); if ( typeof options === 'string' ) { var args = Array.prototype.slice.call( arguments, 1 ); this.each(function() { if ( !instance ) { logError( "cannot call methods on gridrotator prior to initialization; " + "attempted to call method '" + options + "'" ); return; } if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) { logError( "no such method '" + options + "' for gridrotator instance" ); return; } instance[ options ].apply( instance, args ); }); } else { this.each(function() { if ( instance ) { instance._init(); } else { instance = $.data( this, 'gridrotator', new $.GridRotator( options, this ) ); } }); } return instance; }; } )( jQuery, window );