diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..1a6a4db Binary files /dev/null and b/.DS_Store differ diff --git a/README.md b/README.md index f9d1387..32ab840 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,9 @@ -# Kenton Notes -- keep the padding -- bigger pictures in the news and in the blog -- in the news case +#Austin notes +-hubspot form doesn't work correctly, overwrites existing contact in hubspot, may need to delete php/js file -> slack austin major for hubspot credentials +-blog format no longer works +-bootstrap will need to be converted to newer version in future +-header doesn't load correctly in jekyll format, had to add in index.html +-.mov file needs to converted to .mp4 +-client testimonials need to be added -> waiting on kenton +-client case studies need to be added -> waiting on kenton +-calls on sector needs to be defined by kenton diff --git a/_config.yml b/_config.yml index 6314ec2..8541dd1 100644 --- a/_config.yml +++ b/_config.yml @@ -49,3 +49,9 @@ markdown: kramdown permalink: /:year/:month/:title sass: style: compressed + +defaults: + - scope: + path: "assets/mp4" + values: + video: true diff --git a/_includes/footer.html b/_includes/footer.html index 373612d..c066f95 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -1,24 +1,59 @@ -
-
-
-

Execute your project
Become a Partner
Build your skilled technical employee pipeline

- - -

Contact Us

-

316 978-5331

-

ENNOVAR@WICHITA.EDU

-
COPYRIGHT - Ennovar at Wichita State University
-
-
-
- - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/_includes/headers.html b/_includes/headers.html index 2c9e747..8c0a728 100644 --- a/_includes/headers.html +++ b/_includes/headers.html @@ -2,28 +2,36 @@ - - + + - Ennovar at Wichita State University | An Institute of Experential Learning and Market Strategies - - - - - - - - - - - - - - + Ennovar Software + + + + + + + + + + + + + + + + + + + + + + + + + '),C){var g=c.guid+"_"+c.youTubeGuid++,h=[w.media,w.embed,e!==!0?w.animated:""].join(" "),j='
';j+='
',j+="
";var k=a(j),m=a.extend(!0,{},{controls:0,rel:0,showinfo:0,wmode:"transparent",enablejsapi:1,version:3,playerapiid:g,loop:c.loop?1:0,autoplay:1,origin:z.location.protocol+"//"+z.location.host},c.youtubeOptions);c.$container.append(k),c.player&&(c.oldPlayer=c.player,c.player=null),c.player=new z.YT.Player(g,{videoId:c.videoId,playerVars:m,events:{onReady:function(){c.playerReady=!0,c.mute&&c.player.mute(),c.autoPlay&&c.player.playVideo()},onStateChange:function(a){c.playing||a.data!==z.YT.PlayerState.PLAYING?c.loop&&c.playing&&a.data===z.YT.PlayerState.ENDED&&c.player.playVideo():(c.playing=!0,c.autoPlay||c.player.pauseVideo(),k.fsTransition({property:"opacity"},function(){l(c)}).css({opacity:1}),s(c),c.$el.trigger(x.loaded)),c.$el.find(v.embed).addClass(w.ready)},onPlaybackQualityChange:function(){},onPlaybackRateChange:function(){},onError:function(){},onApiChange:function(){}}}),s(c)}else D.push({data:c,source:d})}function l(a){var b=a.$container.find(v.media);b.length>=1&&(b.not(":last").remove(),a.oldPlayer=null)}function m(a){var b=a.$container.find(v.media);b.length>=1&&b.fsTransition({property:"opacity"},function(){b.remove(),delete a.source}).css({opacity:0})}function n(a){if(a.video){if(a.isYouTube&&a.playerReady)a.player.pauseVideo();else{var b=a.$container.find("video");b.length&&b[0].pause()}a.playing=!1}}function o(a){if(a.video){if(a.isYouTube&&a.playerReady)a.player.playVideo();else{var b=a.$container.find("video");b.length&&b[0].play()}a.playing=!0}}function p(a){if(a.video){if(a.isYouTube&&a.playerReady)a.player.mute();else{var b=a.$container.find("video");b.length&&(b[0].muted=!0)}a.playing=!0}}function q(a){if(a.video){if(a.isYouTube&&a.playerReady)a.player.unMute();else{var b=a.$container.find("video");b.length&&(b[0].muted=!1)}a.playing=!0}}function r(a){if(a.responsive){var b=h(a);b!==a.currentSource?i(a,b,!1,!0):s(a)}else s(a)}function s(a){for(var b=a.$container.find(v.media),c=0,d=b.length;d>c;c++){var e=b.eq(c),f=a.isYouTube?"iframe":e.find("video").length?"video":"img",g=e.find(f);if(g.length&&("img"!==f||!B)){var h=a.$el.outerWidth(),i=a.$el.outerHeight(),j=t(a,g);a.width=j.width,a.height=j.height,a.left=0,a.top=0;var k=a.isYouTube?a.embedRatio:a.width/a.height;a.height=i,a.width=a.height*k,a.widthf;f++)if(e=j.eq(f),!h(e)){var l="__"+d.guid++,m=d.classes.raw.base+l,n=e.data(c+"-options"),o=a.extend(!0,{$el:e,guid:l,rawGuid:m,dotGuid:"."+m},b,"object"===a.type(n)?n:{});e.addClass(d.classes.raw.element).data(s,o),d.methods._construct.apply(e,[o].concat(Array.prototype.slice.call(arguments,i?1:0))),k=k.add(e)}for(f=0,g=k.length;g>f;f++)e=k.eq(f),d.methods._postConstruct.apply(e,[h(e)]);return j}function g(){d.functions.iterate.apply(this,[d.methods._destruct].concat(Array.prototype.slice.call(arguments,1))),this.removeClass(d.classes.raw.element).removeData(s)}function h(a){return a.data(s)}function i(b){if(this instanceof a){var c=d.methods[b];return"object"!==a.type(b)&&b?c&&0!==b.indexOf("_")?d.functions.iterate.apply(this,[c].concat(Array.prototype.slice.call(arguments,1))):this:f.apply(this,arguments)}}function k(c){var e=d.utilities[c]||d.utilities._initialize||!1;return e?e.apply(b,Array.prototype.slice.call(arguments,"object"===a.type(c)?0:1)):void 0}function n(b){d.defaults=a.extend(!0,d.defaults,b||{})}function q(b){for(var c=this,d=0,e=c.length;e>d;d++){var f=c.eq(d),g=h(f)||{};"undefined"!==a.type(g.$el)&&b.apply(f,[g].concat(Array.prototype.slice.call(arguments,1)))}return c}var r="fs-"+c,s="fs"+c.replace(/(^|\s)([a-z])/g,function(a,b,c){return b+c.toUpperCase()});return d.initialized=!1,d.priority=d.priority||10,d.classes=e("classes",r,o,d.classes),d.events=e("events",c,p,d.events),d.functions=a.extend({getData:h,iterate:q},l,d.functions),d.methods=a.extend(!0,{_setup:a.noop,_construct:a.noop,_postConstruct:a.noop,_destruct:a.noop,_resize:!1,destroy:g},d.methods),d.utilities=a.extend(!0,{_initialize:!1,_delegate:!1,defaults:n},d.utilities),d.widget&&(m.Conflicts.fn[c]=a.fn[c],a.fn[s]=i,m.DontConflict||(a.fn[c]=a.fn[s])),m.Conflicts[c]=a[c],a[s]=d.utilities._delegate||k,m.DontConflict||(a[c]=a[s]),d.namespace=c,d.namespaceClean=s,d.guid=0,d.methods._resize&&(m.ResizeHandlers.push({namespace:c,priority:d.priority,callback:d.methods._resize}),m.ResizeHandlers.sort(j)),d.methods._raf&&(m.RAFHandlers.push({namespace:c,priority:d.priority,callback:d.methods._raf}),m.RAFHandlers.sort(j)),d}(c,f),n.then(function(){d(c)}),m.Plugins[c]};var q=null,r=20;return m.$window.on("resize.fs",g),g(),i(),a(function(){m.$body=a("body"),n.resolve(),m.support.nativeMatchMedia=m.support.matchMedia&&!a("html").hasClass("no-matchmedia")}),p.clickTouchStart=p.click+" "+p.touchStart,f(),m}(jQuery,window,document); \ No newline at end of file diff --git a/assets/js/plugins/background/transition.js b/assets/js/plugins/background/transition.js new file mode 100644 index 0000000..0829ca8 --- /dev/null +++ b/assets/js/plugins/background/transition.js @@ -0,0 +1,3 @@ +/*! formstone v0.8.29 [transition.js] 2015-11-25 | MIT License | formstone.it */ + +!function(a,b){"use strict";function c(a,c){if(c){a.$target=this.find(a.target),a.$check=a.target?a.$target:this,a.callback=c,a.styles=h(a.$check),a.timer=null;var d=a.$check.css(b.transition+"-duration"),f=parseFloat(d);b.support.transition&&d&&f?this.on(k.transitionEnd,a,e):a.timer=l.startTimer(a.timer,50,function(){g(a)},!0)}}function d(a){l.clearTimer(a.timer,!0),this.off(k.namespace)}function e(b){b.stopPropagation(),b.preventDefault();var c=b.data,d=b.originalEvent,e=c.target?c.$target:c.$el;c.property&&d.propertyName!==c.property||!a(d.target).is(e)||f(c)}function f(a){a.always||a.$el[j.namespaceClean]("destroy"),a.callback.apply(a.$el)}function g(a){var b=h(a.$check);i(a.styles,b)||f(a),a.styles=b}function h(b){var c,d,e,f={};if(b instanceof a&&(b=b[0]),m.getComputedStyle){c=m.getComputedStyle(b,null);for(var g=0,h=c.length;h>g;g++)d=c[g],e=c.getPropertyValue(d),f[d]=e}else if(b.currentStyle){c=b.currentStyle;for(d in c)c[d]&&(f[d]=c[d])}return f}function i(b,c){if(a.type(b)!==a.type(c))return!1;for(var d in b)if(!b.hasOwnProperty(d)||!c.hasOwnProperty(d)||b[d]!==c[d])return!1;return!0}var j=b.Plugin("transition",{widget:!0,defaults:{always:!1,property:null,target:null},methods:{_construct:c,_destruct:d,resolve:f}}),k=j.events,l=j.functions,m=b.window}(jQuery,Formstone); \ No newline at end of file diff --git a/assets/js/plugins/cbpAnimatedHeader.js b/assets/js/plugins/cbpAnimatedHeader.js new file mode 100644 index 0000000..550440d --- /dev/null +++ b/assets/js/plugins/cbpAnimatedHeader.js @@ -0,0 +1,44 @@ +/** + * cbpAnimatedHeader.js v1.0.0 + * http://www.codrops.com + * + * Licensed under the MIT license. + * http://www.opensource.org/licenses/mit-license.php + * + * Copyright 2013, Codrops + * http://www.codrops.com + */ +var cbpAnimatedHeader = (function() { + + var docElem = document.documentElement, + header = document.querySelector( '.navbar-fixed-top' ), + didScroll = false, + changeHeaderOn = 200; + + function init() { + window.addEventListener( 'scroll', function( event ) { + if( !didScroll ) { + didScroll = true; + setTimeout( scrollPage, 250 ); + } + }, false ); + } + + function scrollPage() { + var sy = scrollY(); + if ( sy >= changeHeaderOn ) { + classie.remove( header, 'navbar-expanded' ); + } + else { + classie.add( header, 'navbar-expanded' ); + } + didScroll = false; + } + + function scrollY() { + return window.pageYOffset || docElem.scrollTop; + } + + init(); + +})(); \ No newline at end of file diff --git a/assets/js/plugins/classie.js b/assets/js/plugins/classie.js new file mode 100644 index 0000000..a967554 --- /dev/null +++ b/assets/js/plugins/classie.js @@ -0,0 +1,80 @@ +/*! + * classie - class helper functions + * from bonzo https://github.com/ded/bonzo + * + * classie.has( elem, 'my-class' ) -> true/false + * classie.add( elem, 'my-new-class' ) + * classie.remove( elem, 'my-unwanted-class' ) + * classie.toggle( elem, 'my-class' ) + */ + +/*jshint browser: true, strict: true, undef: true */ +/*global define: false */ + +( function( window ) { + +'use strict'; + +// class helper functions from bonzo https://github.com/ded/bonzo + +function classReg( className ) { + return new RegExp("(^|\\s+)" + className + "(\\s+|$)"); +} + +// classList support for class management +// altho to be fair, the api sucks because it won't accept multiple classes at once +var hasClass, addClass, removeClass; + +if ( 'classList' in document.documentElement ) { + hasClass = function( elem, c ) { + return elem.classList.contains( c ); + }; + addClass = function( elem, c ) { + elem.classList.add( c ); + }; + removeClass = function( elem, c ) { + elem.classList.remove( c ); + }; +} +else { + hasClass = function( elem, c ) { + return classReg( c ).test( elem.className ); + }; + addClass = function( elem, c ) { + if ( !hasClass( elem, c ) ) { + elem.className = elem.className + ' ' + c; + } + }; + removeClass = function( elem, c ) { + elem.className = elem.className.replace( classReg( c ), ' ' ); + }; +} + +function toggleClass( elem, c ) { + var fn = hasClass( elem, c ) ? removeClass : addClass; + fn( elem, c ); +} + +var classie = { + // full names + hasClass: hasClass, + addClass: addClass, + removeClass: removeClass, + toggleClass: toggleClass, + // short names + has: hasClass, + add: addClass, + remove: removeClass, + toggle: toggleClass +}; + +// transport +if ( typeof define === 'function' && define.amd ) { + // AMD + define( classie ); +} else { + // browser global + window.classie = classie; +} + +})( window ); diff --git a/assets/js/plugins/jqBootstrapValidation.js b/assets/js/plugins/jqBootstrapValidation.js new file mode 100644 index 0000000..29cbb08 --- /dev/null +++ b/assets/js/plugins/jqBootstrapValidation.js @@ -0,0 +1,912 @@ +/* jqBootstrapValidation + * A plugin for automating validation on Twitter Bootstrap formatted forms. + * + * v1.3.6 + * + * License: MIT - see LICENSE file + * + * http://ReactiveRaven.github.com/jqBootstrapValidation/ + */ + +(function( $ ){ + + var createdElements = []; + + var defaults = { + options: { + prependExistingHelpBlock: false, + sniffHtml: true, // sniff for 'required', 'maxlength', etc + preventSubmit: true, // stop the form submit event from firing if validation fails + submitError: false, // function called if there is an error when trying to submit + submitSuccess: false, // function called just before a successful submit event is sent to the server + semanticallyStrict: false, // set to true to tidy up generated HTML output + autoAdd: { + helpBlocks: true + }, + filter: function () { + // return $(this).is(":visible"); // only validate elements you can see + return true; // validate everything + } + }, + methods: { + init : function( options ) { + + var settings = $.extend(true, {}, defaults); + + settings.options = $.extend(true, settings.options, options); + + var $siblingElements = this; + + var uniqueForms = $.unique( + $siblingElements.map( function () { + return $(this).parents("form")[0]; + }).toArray() + ); + + $(uniqueForms).bind("submit", function (e) { + var $form = $(this); + var warningsFound = 0; + var $inputs = $form.find("input,textarea,select").not("[type=submit],[type=image]").filter(settings.options.filter); + $inputs.trigger("submit.validation").trigger("validationLostFocus.validation"); + + $inputs.each(function (i, el) { + var $this = $(el), + $controlGroup = $this.parents(".control-group").first(); + if ( + $controlGroup.hasClass("warning") + ) { + $controlGroup.removeClass("warning").addClass("error"); + warningsFound++; + } + }); + + $inputs.trigger("validationLostFocus.validation"); + + if (warningsFound) { + if (settings.options.preventSubmit) { + e.preventDefault(); + } + $form.addClass("error"); + if ($.isFunction(settings.options.submitError)) { + settings.options.submitError($form, e, $inputs.jqBootstrapValidation("collectErrors", true)); + } + } else { + $form.removeClass("error"); + if ($.isFunction(settings.options.submitSuccess)) { + settings.options.submitSuccess($form, e); + } + } + }); + + return this.each(function(){ + + // Get references to everything we're interested in + var $this = $(this), + $controlGroup = $this.parents(".control-group").first(), + $helpBlock = $controlGroup.find(".help-block").first(), + $form = $this.parents("form").first(), + validatorNames = []; + + // create message container if not exists + if (!$helpBlock.length && settings.options.autoAdd && settings.options.autoAdd.helpBlocks) { + $helpBlock = $('
'); + $controlGroup.find('.controls').append($helpBlock); + createdElements.push($helpBlock[0]); + } + + // ============================================================= + // SNIFF HTML FOR VALIDATORS + // ============================================================= + + // *snort sniff snuffle* + + if (settings.options.sniffHtml) { + var message = ""; + // --------------------------------------------------------- + // PATTERN + // --------------------------------------------------------- + if ($this.attr("pattern") !== undefined) { + message = "Not in the expected format"; + if ($this.data("validationPatternMessage")) { + message = $this.data("validationPatternMessage"); + } + $this.data("validationPatternMessage", message); + $this.data("validationPatternRegex", $this.attr("pattern")); + } + // --------------------------------------------------------- + // MAX + // --------------------------------------------------------- + if ($this.attr("max") !== undefined || $this.attr("aria-valuemax") !== undefined) { + var max = ($this.attr("max") !== undefined ? $this.attr("max") : $this.attr("aria-valuemax")); + message = "Too high: Maximum of '" + max + "'"; + if ($this.data("validationMaxMessage")) { + message = $this.data("validationMaxMessage"); + } + $this.data("validationMaxMessage", message); + $this.data("validationMaxMax", max); + } + // --------------------------------------------------------- + // MIN + // --------------------------------------------------------- + if ($this.attr("min") !== undefined || $this.attr("aria-valuemin") !== undefined) { + var min = ($this.attr("min") !== undefined ? $this.attr("min") : $this.attr("aria-valuemin")); + message = "Too low: Minimum of '" + min + "'"; + if ($this.data("validationMinMessage")) { + message = $this.data("validationMinMessage"); + } + $this.data("validationMinMessage", message); + $this.data("validationMinMin", min); + } + // --------------------------------------------------------- + // MAXLENGTH + // --------------------------------------------------------- + if ($this.attr("maxlength") !== undefined) { + message = "Too long: Maximum of '" + $this.attr("maxlength") + "' characters"; + if ($this.data("validationMaxlengthMessage")) { + message = $this.data("validationMaxlengthMessage"); + } + $this.data("validationMaxlengthMessage", message); + $this.data("validationMaxlengthMaxlength", $this.attr("maxlength")); + } + // --------------------------------------------------------- + // MINLENGTH + // --------------------------------------------------------- + if ($this.attr("minlength") !== undefined) { + message = "Too short: Minimum of '" + $this.attr("minlength") + "' characters"; + if ($this.data("validationMinlengthMessage")) { + message = $this.data("validationMinlengthMessage"); + } + $this.data("validationMinlengthMessage", message); + $this.data("validationMinlengthMinlength", $this.attr("minlength")); + } + // --------------------------------------------------------- + // REQUIRED + // --------------------------------------------------------- + if ($this.attr("required") !== undefined || $this.attr("aria-required") !== undefined) { + message = settings.builtInValidators.required.message; + if ($this.data("validationRequiredMessage")) { + message = $this.data("validationRequiredMessage"); + } + $this.data("validationRequiredMessage", message); + } + // --------------------------------------------------------- + // NUMBER + // --------------------------------------------------------- + if ($this.attr("type") !== undefined && $this.attr("type").toLowerCase() === "number") { + message = settings.builtInValidators.number.message; + if ($this.data("validationNumberMessage")) { + message = $this.data("validationNumberMessage"); + } + $this.data("validationNumberMessage", message); + } + // --------------------------------------------------------- + // EMAIL + // --------------------------------------------------------- + if ($this.attr("type") !== undefined && $this.attr("type").toLowerCase() === "email") { + message = "Not a valid email address"; + if ($this.data("validationValidemailMessage")) { + message = $this.data("validationValidemailMessage"); + } else if ($this.data("validationEmailMessage")) { + message = $this.data("validationEmailMessage"); + } + $this.data("validationValidemailMessage", message); + } + // --------------------------------------------------------- + // MINCHECKED + // --------------------------------------------------------- + if ($this.attr("minchecked") !== undefined) { + message = "Not enough options checked; Minimum of '" + $this.attr("minchecked") + "' required"; + if ($this.data("validationMincheckedMessage")) { + message = $this.data("validationMincheckedMessage"); + } + $this.data("validationMincheckedMessage", message); + $this.data("validationMincheckedMinchecked", $this.attr("minchecked")); + } + // --------------------------------------------------------- + // MAXCHECKED + // --------------------------------------------------------- + if ($this.attr("maxchecked") !== undefined) { + message = "Too many options checked; Maximum of '" + $this.attr("maxchecked") + "' required"; + if ($this.data("validationMaxcheckedMessage")) { + message = $this.data("validationMaxcheckedMessage"); + } + $this.data("validationMaxcheckedMessage", message); + $this.data("validationMaxcheckedMaxchecked", $this.attr("maxchecked")); + } + } + + // ============================================================= + // COLLECT VALIDATOR NAMES + // ============================================================= + + // Get named validators + if ($this.data("validation") !== undefined) { + validatorNames = $this.data("validation").split(","); + } + + // Get extra ones defined on the element's data attributes + $.each($this.data(), function (i, el) { + var parts = i.replace(/([A-Z])/g, ",$1").split(","); + if (parts[0] === "validation" && parts[1]) { + validatorNames.push(parts[1]); + } + }); + + // ============================================================= + // NORMALISE VALIDATOR NAMES + // ============================================================= + + var validatorNamesToInspect = validatorNames; + var newValidatorNamesToInspect = []; + + do // repeatedly expand 'shortcut' validators into their real validators + { + // Uppercase only the first letter of each name + $.each(validatorNames, function (i, el) { + validatorNames[i] = formatValidatorName(el); + }); + + // Remove duplicate validator names + validatorNames = $.unique(validatorNames); + + // Pull out the new validator names from each shortcut + newValidatorNamesToInspect = []; + $.each(validatorNamesToInspect, function(i, el) { + if ($this.data("validation" + el + "Shortcut") !== undefined) { + // Are these custom validators? + // Pull them out! + $.each($this.data("validation" + el + "Shortcut").split(","), function(i2, el2) { + newValidatorNamesToInspect.push(el2); + }); + } else if (settings.builtInValidators[el.toLowerCase()]) { + // Is this a recognised built-in? + // Pull it out! + var validator = settings.builtInValidators[el.toLowerCase()]; + if (validator.type.toLowerCase() === "shortcut") { + $.each(validator.shortcut.split(","), function (i, el) { + el = formatValidatorName(el); + newValidatorNamesToInspect.push(el); + validatorNames.push(el); + }); + } + } + }); + + validatorNamesToInspect = newValidatorNamesToInspect; + + } while (validatorNamesToInspect.length > 0) + + // ============================================================= + // SET UP VALIDATOR ARRAYS + // ============================================================= + + var validators = {}; + + $.each(validatorNames, function (i, el) { + // Set up the 'override' message + var message = $this.data("validation" + el + "Message"); + var hasOverrideMessage = (message !== undefined); + var foundValidator = false; + message = + ( + message + ? message + : "'" + el + "' validation failed " + ) + ; + + $.each( + settings.validatorTypes, + function (validatorType, validatorTemplate) { + if (validators[validatorType] === undefined) { + validators[validatorType] = []; + } + if (!foundValidator && $this.data("validation" + el + formatValidatorName(validatorTemplate.name)) !== undefined) { + validators[validatorType].push( + $.extend( + true, + { + name: formatValidatorName(validatorTemplate.name), + message: message + }, + validatorTemplate.init($this, el) + ) + ); + foundValidator = true; + } + } + ); + + if (!foundValidator && settings.builtInValidators[el.toLowerCase()]) { + + var validator = $.extend(true, {}, settings.builtInValidators[el.toLowerCase()]); + if (hasOverrideMessage) { + validator.message = message; + } + var validatorType = validator.type.toLowerCase(); + + if (validatorType === "shortcut") { + foundValidator = true; + } else { + $.each( + settings.validatorTypes, + function (validatorTemplateType, validatorTemplate) { + if (validators[validatorTemplateType] === undefined) { + validators[validatorTemplateType] = []; + } + if (!foundValidator && validatorType === validatorTemplateType.toLowerCase()) { + $this.data("validation" + el + formatValidatorName(validatorTemplate.name), validator[validatorTemplate.name.toLowerCase()]); + validators[validatorType].push( + $.extend( + validator, + validatorTemplate.init($this, el) + ) + ); + foundValidator = true; + } + } + ); + } + } + + if (! foundValidator) { + $.error("Cannot find validation info for '" + el + "'"); + } + }); + + // ============================================================= + // STORE FALLBACK VALUES + // ============================================================= + + $helpBlock.data( + "original-contents", + ( + $helpBlock.data("original-contents") + ? $helpBlock.data("original-contents") + : $helpBlock.html() + ) + ); + + $helpBlock.data( + "original-role", + ( + $helpBlock.data("original-role") + ? $helpBlock.data("original-role") + : $helpBlock.attr("role") + ) + ); + + $controlGroup.data( + "original-classes", + ( + $controlGroup.data("original-clases") + ? $controlGroup.data("original-classes") + : $controlGroup.attr("class") + ) + ); + + $this.data( + "original-aria-invalid", + ( + $this.data("original-aria-invalid") + ? $this.data("original-aria-invalid") + : $this.attr("aria-invalid") + ) + ); + + // ============================================================= + // VALIDATION + // ============================================================= + + $this.bind( + "validation.validation", + function (event, params) { + + var value = getValue($this); + + // Get a list of the errors to apply + var errorsFound = []; + + $.each(validators, function (validatorType, validatorTypeArray) { + if (value || value.length || (params && params.includeEmpty) || (!!settings.validatorTypes[validatorType].blockSubmit && params && !!params.submitting)) { + $.each(validatorTypeArray, function (i, validator) { + if (settings.validatorTypes[validatorType].validate($this, value, validator)) { + errorsFound.push(validator.message); + } + }); + } + }); + + return errorsFound; + } + ); + + $this.bind( + "getValidators.validation", + function () { + return validators; + } + ); + + // ============================================================= + // WATCH FOR CHANGES + // ============================================================= + $this.bind( + "submit.validation", + function () { + return $this.triggerHandler("change.validation", {submitting: true}); + } + ); + $this.bind( + [ + "keyup", + "focus", + "blur", + "click", + "keydown", + "keypress", + "change" + ].join(".validation ") + ".validation", + function (e, params) { + + var value = getValue($this); + + var errorsFound = []; + + $controlGroup.find("input,textarea,select").each(function (i, el) { + var oldCount = errorsFound.length; + $.each($(el).triggerHandler("validation.validation", params), function (j, message) { + errorsFound.push(message); + }); + if (errorsFound.length > oldCount) { + $(el).attr("aria-invalid", "true"); + } else { + var original = $this.data("original-aria-invalid"); + $(el).attr("aria-invalid", (original !== undefined ? original : false)); + } + }); + + $form.find("input,select,textarea").not($this).not("[name=\"" + $this.attr("name") + "\"]").trigger("validationLostFocus.validation"); + + errorsFound = $.unique(errorsFound.sort()); + + // Were there any errors? + if (errorsFound.length) { + // Better flag it up as a warning. + $controlGroup.removeClass("success error").addClass("warning"); + + // How many errors did we find? + if (settings.options.semanticallyStrict && errorsFound.length === 1) { + // Only one? Being strict? Just output it. + $helpBlock.html(errorsFound[0] + + ( settings.options.prependExistingHelpBlock ? $helpBlock.data("original-contents") : "" )); + } else { + // Multiple? Being sloppy? Glue them together into an UL. + $helpBlock.html("
  • " + errorsFound.join("
  • ") + "
" + + ( settings.options.prependExistingHelpBlock ? $helpBlock.data("original-contents") : "" )); + } + } else { + $controlGroup.removeClass("warning error success"); + if (value.length > 0) { + $controlGroup.addClass("success"); + } + $helpBlock.html($helpBlock.data("original-contents")); + } + + if (e.type === "blur") { + $controlGroup.removeClass("success"); + } + } + ); + $this.bind("validationLostFocus.validation", function () { + $controlGroup.removeClass("success"); + }); + }); + }, + destroy : function( ) { + + return this.each( + function() { + + var + $this = $(this), + $controlGroup = $this.parents(".control-group").first(), + $helpBlock = $controlGroup.find(".help-block").first(); + + // remove our events + $this.unbind('.validation'); // events are namespaced. + // reset help text + $helpBlock.html($helpBlock.data("original-contents")); + // reset classes + $controlGroup.attr("class", $controlGroup.data("original-classes")); + // reset aria + $this.attr("aria-invalid", $this.data("original-aria-invalid")); + // reset role + $helpBlock.attr("role", $this.data("original-role")); + // remove all elements we created + if (createdElements.indexOf($helpBlock[0]) > -1) { + $helpBlock.remove(); + } + + } + ); + + }, + collectErrors : function(includeEmpty) { + + var errorMessages = {}; + this.each(function (i, el) { + var $el = $(el); + var name = $el.attr("name"); + var errors = $el.triggerHandler("validation.validation", {includeEmpty: true}); + errorMessages[name] = $.extend(true, errors, errorMessages[name]); + }); + + $.each(errorMessages, function (i, el) { + if (el.length === 0) { + delete errorMessages[i]; + } + }); + + return errorMessages; + + }, + hasErrors: function() { + + var errorMessages = []; + + this.each(function (i, el) { + errorMessages = errorMessages.concat( + $(el).triggerHandler("getValidators.validation") ? $(el).triggerHandler("validation.validation", {submitting: true}) : [] + ); + }); + + return (errorMessages.length > 0); + }, + override : function (newDefaults) { + defaults = $.extend(true, defaults, newDefaults); + } + }, + validatorTypes: { + callback: { + name: "callback", + init: function ($this, name) { + return { + validatorName: name, + callback: $this.data("validation" + name + "Callback"), + lastValue: $this.val(), + lastValid: true, + lastFinished: true + }; + }, + validate: function ($this, value, validator) { + if (validator.lastValue === value && validator.lastFinished) { + return !validator.lastValid; + } + + if (validator.lastFinished === true) + { + validator.lastValue = value; + validator.lastValid = true; + validator.lastFinished = false; + + var rrjqbvValidator = validator; + var rrjqbvThis = $this; + executeFunctionByName( + validator.callback, + window, + $this, + value, + function (data) { + if (rrjqbvValidator.lastValue === data.value) { + rrjqbvValidator.lastValid = data.valid; + if (data.message) { + rrjqbvValidator.message = data.message; + } + rrjqbvValidator.lastFinished = true; + rrjqbvThis.data("validation" + rrjqbvValidator.validatorName + "Message", rrjqbvValidator.message); + // Timeout is set to avoid problems with the events being considered 'already fired' + setTimeout(function () { + rrjqbvThis.trigger("change.validation"); + }, 1); // doesn't need a long timeout, just long enough for the event bubble to burst + } + } + ); + } + + return false; + + } + }, + ajax: { + name: "ajax", + init: function ($this, name) { + return { + validatorName: name, + url: $this.data("validation" + name + "Ajax"), + lastValue: $this.val(), + lastValid: true, + lastFinished: true + }; + }, + validate: function ($this, value, validator) { + if (""+validator.lastValue === ""+value && validator.lastFinished === true) { + return validator.lastValid === false; + } + + if (validator.lastFinished === true) + { + validator.lastValue = value; + validator.lastValid = true; + validator.lastFinished = false; + $.ajax({ + url: validator.url, + data: "value=" + value + "&field=" + $this.attr("name"), + dataType: "json", + success: function (data) { + if (""+validator.lastValue === ""+data.value) { + validator.lastValid = !!(data.valid); + if (data.message) { + validator.message = data.message; + } + validator.lastFinished = true; + $this.data("validation" + validator.validatorName + "Message", validator.message); + // Timeout is set to avoid problems with the events being considered 'already fired' + setTimeout(function () { + $this.trigger("change.validation"); + }, 1); // doesn't need a long timeout, just long enough for the event bubble to burst + } + }, + failure: function () { + validator.lastValid = true; + validator.message = "ajax call failed"; + validator.lastFinished = true; + $this.data("validation" + validator.validatorName + "Message", validator.message); + // Timeout is set to avoid problems with the events being considered 'already fired' + setTimeout(function () { + $this.trigger("change.validation"); + }, 1); // doesn't need a long timeout, just long enough for the event bubble to burst + } + }); + } + + return false; + + } + }, + regex: { + name: "regex", + init: function ($this, name) { + return {regex: regexFromString($this.data("validation" + name + "Regex"))}; + }, + validate: function ($this, value, validator) { + return (!validator.regex.test(value) && ! validator.negative) + || (validator.regex.test(value) && validator.negative); + } + }, + required: { + name: "required", + init: function ($this, name) { + return {}; + }, + validate: function ($this, value, validator) { + return !!(value.length === 0 && ! validator.negative) + || !!(value.length > 0 && validator.negative); + }, + blockSubmit: true + }, + match: { + name: "match", + init: function ($this, name) { + var element = $this.parents("form").first().find("[name=\"" + $this.data("validation" + name + "Match") + "\"]").first(); + element.bind("validation.validation", function () { + $this.trigger("change.validation", {submitting: true}); + }); + return {"element": element}; + }, + validate: function ($this, value, validator) { + return (value !== validator.element.val() && ! validator.negative) + || (value === validator.element.val() && validator.negative); + }, + blockSubmit: true + }, + max: { + name: "max", + init: function ($this, name) { + return {max: $this.data("validation" + name + "Max")}; + }, + validate: function ($this, value, validator) { + return (parseFloat(value, 10) > parseFloat(validator.max, 10) && ! validator.negative) + || (parseFloat(value, 10) <= parseFloat(validator.max, 10) && validator.negative); + } + }, + min: { + name: "min", + init: function ($this, name) { + return {min: $this.data("validation" + name + "Min")}; + }, + validate: function ($this, value, validator) { + return (parseFloat(value) < parseFloat(validator.min) && ! validator.negative) + || (parseFloat(value) >= parseFloat(validator.min) && validator.negative); + } + }, + maxlength: { + name: "maxlength", + init: function ($this, name) { + return {maxlength: $this.data("validation" + name + "Maxlength")}; + }, + validate: function ($this, value, validator) { + return ((value.length > validator.maxlength) && ! validator.negative) + || ((value.length <= validator.maxlength) && validator.negative); + } + }, + minlength: { + name: "minlength", + init: function ($this, name) { + return {minlength: $this.data("validation" + name + "Minlength")}; + }, + validate: function ($this, value, validator) { + return ((value.length < validator.minlength) && ! validator.negative) + || ((value.length >= validator.minlength) && validator.negative); + } + }, + maxchecked: { + name: "maxchecked", + init: function ($this, name) { + var elements = $this.parents("form").first().find("[name=\"" + $this.attr("name") + "\"]"); + elements.bind("click.validation", function () { + $this.trigger("change.validation", {includeEmpty: true}); + }); + return {maxchecked: $this.data("validation" + name + "Maxchecked"), elements: elements}; + }, + validate: function ($this, value, validator) { + return (validator.elements.filter(":checked").length > validator.maxchecked && ! validator.negative) + || (validator.elements.filter(":checked").length <= validator.maxchecked && validator.negative); + }, + blockSubmit: true + }, + minchecked: { + name: "minchecked", + init: function ($this, name) { + var elements = $this.parents("form").first().find("[name=\"" + $this.attr("name") + "\"]"); + elements.bind("click.validation", function () { + $this.trigger("change.validation", {includeEmpty: true}); + }); + return {minchecked: $this.data("validation" + name + "Minchecked"), elements: elements}; + }, + validate: function ($this, value, validator) { + return (validator.elements.filter(":checked").length < validator.minchecked && ! validator.negative) + || (validator.elements.filter(":checked").length >= validator.minchecked && validator.negative); + }, + blockSubmit: true + } + }, + builtInValidators: { + email: { + name: "Email", + type: "shortcut", + shortcut: "validemail" + }, + validemail: { + name: "Validemail", + type: "regex", + regex: "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\\.[A-Za-z]{2,4}", + message: "Not a valid email address" + }, + passwordagain: { + name: "Passwordagain", + type: "match", + match: "password", + message: "Does not match the given password" + }, + positive: { + name: "Positive", + type: "shortcut", + shortcut: "number,positivenumber" + }, + negative: { + name: "Negative", + type: "shortcut", + shortcut: "number,negativenumber" + }, + number: { + name: "Number", + type: "regex", + regex: "([+-]?\\\d+(\\\.\\\d*)?([eE][+-]?[0-9]+)?)?", + message: "Must be a number" + }, + integer: { + name: "Integer", + type: "regex", + regex: "[+-]?\\\d+", + message: "No decimal places allowed" + }, + positivenumber: { + name: "Positivenumber", + type: "min", + min: 0, + message: "Must be a positive number" + }, + negativenumber: { + name: "Negativenumber", + type: "max", + max: 0, + message: "Must be a negative number" + }, + required: { + name: "Required", + type: "required", + message: "This is required" + }, + checkone: { + name: "Checkone", + type: "minchecked", + minchecked: 1, + message: "Check at least one option" + } + } + }; + + var formatValidatorName = function (name) { + return name + .toLowerCase() + .replace( + /(^|\s)([a-z])/g , + function(m,p1,p2) { + return p1+p2.toUpperCase(); + } + ) + ; + }; + + var getValue = function ($this) { + // Extract the value we're talking about + var value = $this.val(); + var type = $this.attr("type"); + if (type === "checkbox") { + value = ($this.is(":checked") ? value : ""); + } + if (type === "radio") { + value = ($('input[name="' + $this.attr("name") + '"]:checked').length > 0 ? value : ""); + } + return value; + }; + + function regexFromString(inputstring) { + return new RegExp("^" + inputstring + "$"); + } + + /** + * Thanks to Jason Bunting via StackOverflow.com + * + * http://stackoverflow.com/questions/359788/how-to-execute-a-javascript-function-when-i-have-its-name-as-a-string#answer-359910 + * Short link: http://tinyurl.com/executeFunctionByName + **/ + function executeFunctionByName(functionName, context /*, args*/) { + var args = Array.prototype.slice.call(arguments).splice(2); + var namespaces = functionName.split("."); + var func = namespaces.pop(); + for(var i = 0; i < namespaces.length; i++) { + context = context[namespaces[i]]; + } + return context[func].apply(this, args); + } + + $.fn.jqBootstrapValidation = function( method ) { + + if ( defaults.methods[method] ) { + return defaults.methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); + } else if ( typeof method === 'object' || ! method ) { + return defaults.methods.init.apply( this, arguments ); + } else { + $.error( 'Method ' + method + ' does not exist on jQuery.jqBootstrapValidation' ); + return null; + } + + }; + + $.jqBootstrapValidation = function (options) { + $(":input").not("[type=image],[type=submit]").jqBootstrapValidation.apply(this,arguments); + }; + +})( jQuery ); diff --git a/assets/js/plugins/jquery.easing.min.js b/assets/js/plugins/jquery.easing.min.js new file mode 100644 index 0000000..6cf5f20 --- /dev/null +++ b/assets/js/plugins/jquery.easing.min.js @@ -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>core*/ +/** + * + * Magnific Popup Core JS file + * + */ + + +/** + * Private static constants + */ +var CLOSE_EVENT = 'Close', + BEFORE_CLOSE_EVENT = 'BeforeClose', + AFTER_CLOSE_EVENT = 'AfterClose', + BEFORE_APPEND_EVENT = 'BeforeAppend', + MARKUP_PARSE_EVENT = 'MarkupParse', + OPEN_EVENT = 'Open', + CHANGE_EVENT = 'Change', + NS = 'mfp', + EVENT_NS = '.' + NS, + READY_CLASS = 'mfp-ready', + REMOVING_CLASS = 'mfp-removing', + PREVENT_CLOSE_CLASS = 'mfp-prevent-close'; + + +/** + * Private vars + */ +var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this' + MagnificPopup = function(){}, + _isJQ = !!(window.jQuery), + _prevStatus, + _window = $(window), + _body, + _document, + _prevContentType, + _wrapClasses, + _currPopupType; + + +/** + * Private functions + */ +var _mfpOn = function(name, f) { + mfp.ev.on(NS + name + EVENT_NS, f); + }, + _getEl = function(className, appendTo, html, raw) { + var el = document.createElement('div'); + el.className = 'mfp-'+className; + if(html) { + el.innerHTML = html; + } + if(!raw) { + el = $(el); + if(appendTo) { + el.appendTo(appendTo); + } + } else if(appendTo) { + appendTo.appendChild(el); + } + return el; + }, + _mfpTrigger = function(e, data) { + mfp.ev.triggerHandler(NS + e, data); + + if(mfp.st.callbacks) { + // converts "mfpEventName" to "eventName" callback and triggers it if it's present + e = e.charAt(0).toLowerCase() + e.slice(1); + if(mfp.st.callbacks[e]) { + mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]); + } + } + }, + _getCloseBtn = function(type) { + if(type !== _currPopupType || !mfp.currTemplate.closeBtn) { + mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) ); + _currPopupType = type; + } + return mfp.currTemplate.closeBtn; + }, + // Initialize Magnific Popup only when called at least once + _checkInstance = function() { + if(!$.magnificPopup.instance) { + mfp = new MagnificPopup(); + mfp.init(); + $.magnificPopup.instance = mfp; + } + }, + // CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr + supportsTransitions = function() { + var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist + v = ['ms','O','Moz','Webkit']; // 'v' for vendor + + if( s['transition'] !== undefined ) { + return true; + } + + while( v.length ) { + if( v.pop() + 'Transition' in s ) { + return true; + } + } + + return false; + }; + + + +/** + * Public functions + */ +MagnificPopup.prototype = { + + constructor: MagnificPopup, + + /** + * Initializes Magnific Popup plugin. + * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed + */ + init: function() { + var appVersion = navigator.appVersion; + mfp.isIE7 = appVersion.indexOf("MSIE 7.") !== -1; + mfp.isIE8 = appVersion.indexOf("MSIE 8.") !== -1; + mfp.isLowIE = mfp.isIE7 || mfp.isIE8; + mfp.isAndroid = (/android/gi).test(appVersion); + mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion); + mfp.supportsTransition = supportsTransitions(); + + // We disable fixed positioned lightbox on devices that don't handle it nicely. + // If you know a better way of detecting this - let me know. + mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) ); + _document = $(document); + + mfp.popupsCache = {}; + }, + + /** + * Opens popup + * @param data [description] + */ + open: function(data) { + + if(!_body) { + _body = $(document.body); + } + + var i; + + if(data.isObj === false) { + // convert jQuery collection to array to avoid conflicts later + mfp.items = data.items.toArray(); + + mfp.index = 0; + var items = data.items, + item; + for(i = 0; i < items.length; i++) { + item = items[i]; + if(item.parsed) { + item = item.el[0]; + } + if(item === data.el[0]) { + mfp.index = i; + break; + } + } + } else { + mfp.items = $.isArray(data.items) ? data.items : [data.items]; + mfp.index = data.index || 0; + } + + // if popup is already opened - we just update the content + if(mfp.isOpen) { + mfp.updateItemHTML(); + return; + } + + mfp.types = []; + _wrapClasses = ''; + if(data.mainEl && data.mainEl.length) { + mfp.ev = data.mainEl.eq(0); + } else { + mfp.ev = _document; + } + + if(data.key) { + if(!mfp.popupsCache[data.key]) { + mfp.popupsCache[data.key] = {}; + } + mfp.currTemplate = mfp.popupsCache[data.key]; + } else { + mfp.currTemplate = {}; + } + + + + mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data ); + mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos; + + if(mfp.st.modal) { + mfp.st.closeOnContentClick = false; + mfp.st.closeOnBgClick = false; + mfp.st.showCloseBtn = false; + mfp.st.enableEscapeKey = false; + } + + + // Building markup + // main containers are created only once + if(!mfp.bgOverlay) { + + // Dark overlay + mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() { + mfp.close(); + }); + + mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) { + if(mfp._checkIfClose(e.target)) { + mfp.close(); + } + }); + + mfp.container = _getEl('container', mfp.wrap); + } + + mfp.contentContainer = _getEl('content'); + if(mfp.st.preloader) { + mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading); + } + + + // Initializing modules + var modules = $.magnificPopup.modules; + for(i = 0; i < modules.length; i++) { + var n = modules[i]; + n = n.charAt(0).toUpperCase() + n.slice(1); + mfp['init'+n].call(mfp); + } + _mfpTrigger('BeforeOpen'); + + + if(mfp.st.showCloseBtn) { + // Close button + if(!mfp.st.closeBtnInside) { + mfp.wrap.append( _getCloseBtn() ); + } else { + _mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) { + values.close_replaceWith = _getCloseBtn(item.type); + }); + _wrapClasses += ' mfp-close-btn-in'; + } + } + + if(mfp.st.alignTop) { + _wrapClasses += ' mfp-align-top'; + } + + + + if(mfp.fixedContentPos) { + mfp.wrap.css({ + overflow: mfp.st.overflowY, + overflowX: 'hidden', + overflowY: mfp.st.overflowY + }); + } else { + mfp.wrap.css({ + top: _window.scrollTop(), + position: 'absolute' + }); + } + if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) { + mfp.bgOverlay.css({ + height: _document.height(), + position: 'absolute' + }); + } + + + + if(mfp.st.enableEscapeKey) { + // Close on ESC key + _document.on('keyup' + EVENT_NS, function(e) { + if(e.keyCode === 27) { + mfp.close(); + } + }); + } + + _window.on('resize' + EVENT_NS, function() { + mfp.updateSize(); + }); + + + if(!mfp.st.closeOnContentClick) { + _wrapClasses += ' mfp-auto-cursor'; + } + + if(_wrapClasses) + mfp.wrap.addClass(_wrapClasses); + + + // this triggers recalculation of layout, so we get it once to not to trigger twice + var windowHeight = mfp.wH = _window.height(); + + + var windowStyles = {}; + + if( mfp.fixedContentPos ) { + if(mfp._hasScrollBar(windowHeight)){ + var s = mfp._getScrollbarSize(); + if(s) { + windowStyles.marginRight = s; + } + } + } + + if(mfp.fixedContentPos) { + if(!mfp.isIE7) { + windowStyles.overflow = 'hidden'; + } else { + // ie7 double-scroll bug + $('body, html').css('overflow', 'hidden'); + } + } + + + + var classesToadd = mfp.st.mainClass; + if(mfp.isIE7) { + classesToadd += ' mfp-ie7'; + } + if(classesToadd) { + mfp._addClassToMFP( classesToadd ); + } + + // add content + mfp.updateItemHTML(); + + _mfpTrigger('BuildControls'); + + // remove scrollbar, add margin e.t.c + $('html').css(windowStyles); + + // add everything to DOM + mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || _body ); + + // Save last focused element + mfp._lastFocusedEl = document.activeElement; + + // Wait for next cycle to allow CSS transition + setTimeout(function() { + + if(mfp.content) { + mfp._addClassToMFP(READY_CLASS); + mfp._setFocus(); + } else { + // if content is not defined (not loaded e.t.c) we add class only for BG + mfp.bgOverlay.addClass(READY_CLASS); + } + + // Trap the focus in popup + _document.on('focusin' + EVENT_NS, mfp._onFocusIn); + + }, 16); + + mfp.isOpen = true; + mfp.updateSize(windowHeight); + _mfpTrigger(OPEN_EVENT); + + return data; + }, + + /** + * Closes the popup + */ + close: function() { + if(!mfp.isOpen) return; + _mfpTrigger(BEFORE_CLOSE_EVENT); + + mfp.isOpen = false; + // for CSS3 animation + if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) { + mfp._addClassToMFP(REMOVING_CLASS); + setTimeout(function() { + mfp._close(); + }, mfp.st.removalDelay); + } else { + mfp._close(); + } + }, + + /** + * Helper for close() function + */ + _close: function() { + _mfpTrigger(CLOSE_EVENT); + + var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' '; + + mfp.bgOverlay.detach(); + mfp.wrap.detach(); + mfp.container.empty(); + + if(mfp.st.mainClass) { + classesToRemove += mfp.st.mainClass + ' '; + } + + mfp._removeClassFromMFP(classesToRemove); + + if(mfp.fixedContentPos) { + var windowStyles = {marginRight: ''}; + if(mfp.isIE7) { + $('body, html').css('overflow', ''); + } else { + windowStyles.overflow = ''; + } + $('html').css(windowStyles); + } + + _document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS); + mfp.ev.off(EVENT_NS); + + // clean up DOM elements that aren't removed + mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style'); + mfp.bgOverlay.attr('class', 'mfp-bg'); + mfp.container.attr('class', 'mfp-container'); + + // remove close button from target element + if(mfp.st.showCloseBtn && + (!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) { + if(mfp.currTemplate.closeBtn) + mfp.currTemplate.closeBtn.detach(); + } + + + if(mfp._lastFocusedEl) { + $(mfp._lastFocusedEl).focus(); // put tab focus back + } + mfp.currItem = null; + mfp.content = null; + mfp.currTemplate = null; + mfp.prevHeight = 0; + + _mfpTrigger(AFTER_CLOSE_EVENT); + }, + + updateSize: function(winHeight) { + + if(mfp.isIOS) { + // fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2 + var zoomLevel = document.documentElement.clientWidth / window.innerWidth; + var height = window.innerHeight * zoomLevel; + mfp.wrap.css('height', height); + mfp.wH = height; + } else { + mfp.wH = winHeight || _window.height(); + } + // Fixes #84: popup incorrectly positioned with position:relative on body + if(!mfp.fixedContentPos) { + mfp.wrap.css('height', mfp.wH); + } + + _mfpTrigger('Resize'); + + }, + + /** + * Set content of popup based on current index + */ + updateItemHTML: function() { + var item = mfp.items[mfp.index]; + + // Detach and perform modifications + mfp.contentContainer.detach(); + + if(mfp.content) + mfp.content.detach(); + + if(!item.parsed) { + item = mfp.parseEl( mfp.index ); + } + + var type = item.type; + + _mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]); + // BeforeChange event works like so: + // _mfpOn('BeforeChange', function(e, prevType, newType) { }); + + mfp.currItem = item; + + + + + + if(!mfp.currTemplate[type]) { + var markup = mfp.st[type] ? mfp.st[type].markup : false; + + // allows to modify markup + _mfpTrigger('FirstMarkupParse', markup); + + if(markup) { + mfp.currTemplate[type] = $(markup); + } else { + // if there is no markup found we just define that template is parsed + mfp.currTemplate[type] = true; + } + } + + if(_prevContentType && _prevContentType !== item.type) { + mfp.container.removeClass('mfp-'+_prevContentType+'-holder'); + } + + var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]); + mfp.appendContent(newContent, type); + + item.preloaded = true; + + _mfpTrigger(CHANGE_EVENT, item); + _prevContentType = item.type; + + // Append container back after its content changed + mfp.container.prepend(mfp.contentContainer); + + _mfpTrigger('AfterChange'); + }, + + + /** + * Set HTML content of popup + */ + appendContent: function(newContent, type) { + mfp.content = newContent; + + if(newContent) { + if(mfp.st.showCloseBtn && mfp.st.closeBtnInside && + mfp.currTemplate[type] === true) { + // if there is no markup, we just append close button element inside + if(!mfp.content.find('.mfp-close').length) { + mfp.content.append(_getCloseBtn()); + } + } else { + mfp.content = newContent; + } + } else { + mfp.content = ''; + } + + _mfpTrigger(BEFORE_APPEND_EVENT); + mfp.container.addClass('mfp-'+type+'-holder'); + + mfp.contentContainer.append(mfp.content); + }, + + + + + /** + * Creates Magnific Popup data object based on given data + * @param {int} index Index of item to parse + */ + parseEl: function(index) { + var item = mfp.items[index], + type; + + if(item.tagName) { + item = { el: $(item) }; + } else { + type = item.type; + item = { data: item, src: item.src }; + } + + if(item.el) { + var types = mfp.types; + + // check for 'mfp-TYPE' class + for(var i = 0; i < types.length; i++) { + if( item.el.hasClass('mfp-'+types[i]) ) { + type = types[i]; + break; + } + } + + item.src = item.el.attr('data-mfp-src'); + if(!item.src) { + item.src = item.el.attr('href'); + } + } + + item.type = type || mfp.st.type || 'inline'; + item.index = index; + item.parsed = true; + mfp.items[index] = item; + _mfpTrigger('ElementParse', item); + + return mfp.items[index]; + }, + + + /** + * Initializes single popup or a group of popups + */ + addGroup: function(el, options) { + var eHandler = function(e) { + e.mfpEl = this; + mfp._openClick(e, el, options); + }; + + if(!options) { + options = {}; + } + + var eName = 'click.magnificPopup'; + options.mainEl = el; + + if(options.items) { + options.isObj = true; + el.off(eName).on(eName, eHandler); + } else { + options.isObj = false; + if(options.delegate) { + el.off(eName).on(eName, options.delegate , eHandler); + } else { + options.items = el; + el.off(eName).on(eName, eHandler); + } + } + }, + _openClick: function(e, el, options) { + var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick; + + + if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey ) ) { + return; + } + + var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn; + + if(disableOn) { + if($.isFunction(disableOn)) { + if( !disableOn.call(mfp) ) { + return true; + } + } else { // else it's number + if( _window.width() < disableOn ) { + return true; + } + } + } + + if(e.type) { + e.preventDefault(); + + // This will prevent popup from closing if element is inside and popup is already opened + if(mfp.isOpen) { + e.stopPropagation(); + } + } + + + options.el = $(e.mfpEl); + if(options.delegate) { + options.items = el.find(options.delegate); + } + mfp.open(options); + }, + + + /** + * Updates text on preloader + */ + updateStatus: function(status, text) { + + if(mfp.preloader) { + if(_prevStatus !== status) { + mfp.container.removeClass('mfp-s-'+_prevStatus); + } + + if(!text && status === 'loading') { + text = mfp.st.tLoading; + } + + var data = { + status: status, + text: text + }; + // allows to modify status + _mfpTrigger('UpdateStatus', data); + + status = data.status; + text = data.text; + + mfp.preloader.html(text); + + mfp.preloader.find('a').on('click', function(e) { + e.stopImmediatePropagation(); + }); + + mfp.container.addClass('mfp-s-'+status); + _prevStatus = status; + } + }, + + + /* + "Private" helpers that aren't private at all + */ + // Check to close popup or not + // "target" is an element that was clicked + _checkIfClose: function(target) { + + if($(target).hasClass(PREVENT_CLOSE_CLASS)) { + return; + } + + var closeOnContent = mfp.st.closeOnContentClick; + var closeOnBg = mfp.st.closeOnBgClick; + + if(closeOnContent && closeOnBg) { + return true; + } else { + + // We close the popup if click is on close button or on preloader. Or if there is no content. + if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) { + return true; + } + + // if click is outside the content + if( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) { + if(closeOnBg) { + // last check, if the clicked element is in DOM, (in case it's removed onclick) + if( $.contains(document, target) ) { + return true; + } + } + } else if(closeOnContent) { + return true; + } + + } + return false; + }, + _addClassToMFP: function(cName) { + mfp.bgOverlay.addClass(cName); + mfp.wrap.addClass(cName); + }, + _removeClassFromMFP: function(cName) { + this.bgOverlay.removeClass(cName); + mfp.wrap.removeClass(cName); + }, + _hasScrollBar: function(winHeight) { + return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) ); + }, + _setFocus: function() { + (mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus(); + }, + _onFocusIn: function(e) { + if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) { + mfp._setFocus(); + return false; + } + }, + _parseMarkup: function(template, values, item) { + var arr; + if(item.data) { + values = $.extend(item.data, values); + } + _mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] ); + + $.each(values, function(key, value) { + if(value === undefined || value === false) { + return true; + } + arr = key.split('_'); + if(arr.length > 1) { + var el = template.find(EVENT_NS + '-'+arr[0]); + + if(el.length > 0) { + var attr = arr[1]; + if(attr === 'replaceWith') { + if(el[0] !== value[0]) { + el.replaceWith(value); + } + } else if(attr === 'img') { + if(el.is('img')) { + el.attr('src', value); + } else { + el.replaceWith( '' ); + } + } else { + el.attr(arr[1], value); + } + } + + } else { + template.find(EVENT_NS + '-'+key).html(value); + } + }); + }, + + _getScrollbarSize: function() { + // thx David + if(mfp.scrollbarSize === undefined) { + var scrollDiv = document.createElement("div"); + scrollDiv.id = "mfp-sbm"; + scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;'; + document.body.appendChild(scrollDiv); + mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth; + document.body.removeChild(scrollDiv); + } + return mfp.scrollbarSize; + } + +}; /* MagnificPopup core prototype end */ + + + + +/** + * Public static functions + */ +$.magnificPopup = { + instance: null, + proto: MagnificPopup.prototype, + modules: [], + + open: function(options, index) { + _checkInstance(); + + if(!options) { + options = {}; + } else { + options = $.extend(true, {}, options); + } + + + options.isObj = true; + options.index = index || 0; + return this.instance.open(options); + }, + + close: function() { + return $.magnificPopup.instance && $.magnificPopup.instance.close(); + }, + + registerModule: function(name, module) { + if(module.options) { + $.magnificPopup.defaults[name] = module.options; + } + $.extend(this.proto, module.proto); + this.modules.push(name); + }, + + defaults: { + + // Info about options is in docs: + // http://dimsemenov.com/plugins/magnific-popup/documentation.html#options + + disableOn: 0, + + key: null, + + midClick: false, + + mainClass: '', + + preloader: true, + + focus: '', // CSS selector of input to focus after popup is opened + + closeOnContentClick: false, + + closeOnBgClick: true, + + closeBtnInside: true, + + showCloseBtn: true, + + enableEscapeKey: true, + + modal: false, + + alignTop: false, + + removalDelay: 0, + + prependTo: null, + + fixedContentPos: 'auto', + + fixedBgPos: 'auto', + + overflowY: 'auto', + + closeMarkup: '', + + tClose: 'Close (Esc)', + + tLoading: 'Loading...' + + } +}; + + + +$.fn.magnificPopup = function(options) { + _checkInstance(); + + var jqEl = $(this); + + // We call some API method of first param is a string + if (typeof options === "string" ) { + + if(options === 'open') { + var items, + itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup, + index = parseInt(arguments[1], 10) || 0; + + if(itemOpts.items) { + items = itemOpts.items[index]; + } else { + items = jqEl; + if(itemOpts.delegate) { + items = items.find(itemOpts.delegate); + } + items = items.eq( index ); + } + mfp._openClick({mfpEl:items}, jqEl, itemOpts); + } else { + if(mfp.isOpen) + mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1)); + } + + } else { + // clone options obj + options = $.extend(true, {}, options); + + /* + * As Zepto doesn't support .data() method for objects + * and it works only in normal browsers + * we assign "options" object directly to the DOM element. FTW! + */ + if(_isJQ) { + jqEl.data('magnificPopup', options); + } else { + jqEl[0].magnificPopup = options; + } + + mfp.addGroup(jqEl, options); + + } + return jqEl; +}; + + +//Quick benchmark +/* +var start = performance.now(), + i, + rounds = 1000; + +for(i = 0; i < rounds; i++) { + +} +console.log('Test #1:', performance.now() - start); + +start = performance.now(); +for(i = 0; i < rounds; i++) { + +} +console.log('Test #2:', performance.now() - start); +*/ + + +/*>>core*/ + +/*>>inline*/ + +var INLINE_NS = 'inline', + _hiddenClass, + _inlinePlaceholder, + _lastInlineElement, + _putInlineElementsBack = function() { + if(_lastInlineElement) { + _inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach(); + _lastInlineElement = null; + } + }; + +$.magnificPopup.registerModule(INLINE_NS, { + options: { + hiddenClass: 'hide', // will be appended with `mfp-` prefix + markup: '', + tNotFound: 'Content not found' + }, + proto: { + + initInline: function() { + mfp.types.push(INLINE_NS); + + _mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() { + _putInlineElementsBack(); + }); + }, + + getInline: function(item, template) { + + _putInlineElementsBack(); + + if(item.src) { + var inlineSt = mfp.st.inline, + el = $(item.src); + + if(el.length) { + + // If target element has parent - we replace it with placeholder and put it back after popup is closed + var parent = el[0].parentNode; + if(parent && parent.tagName) { + if(!_inlinePlaceholder) { + _hiddenClass = inlineSt.hiddenClass; + _inlinePlaceholder = _getEl(_hiddenClass); + _hiddenClass = 'mfp-'+_hiddenClass; + } + // replace target inline element with placeholder + _lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass); + } + + mfp.updateStatus('ready'); + } else { + mfp.updateStatus('error', inlineSt.tNotFound); + el = $('
'); + } + + item.inlineElement = el; + return el; + } + + mfp.updateStatus('ready'); + mfp._parseMarkup(template, {}, item); + return template; + } + } +}); + +/*>>inline*/ + +/*>>ajax*/ +var AJAX_NS = 'ajax', + _ajaxCur, + _removeAjaxCursor = function() { + if(_ajaxCur) { + _body.removeClass(_ajaxCur); + } + }, + _destroyAjaxRequest = function() { + _removeAjaxCursor(); + if(mfp.req) { + mfp.req.abort(); + } + }; + +$.magnificPopup.registerModule(AJAX_NS, { + + options: { + settings: null, + cursor: 'mfp-ajax-cur', + tError: 'The content could not be loaded.' + }, + + proto: { + initAjax: function() { + mfp.types.push(AJAX_NS); + _ajaxCur = mfp.st.ajax.cursor; + + _mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest); + _mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest); + }, + getAjax: function(item) { + + if(_ajaxCur) + _body.addClass(_ajaxCur); + + mfp.updateStatus('loading'); + + var opts = $.extend({ + url: item.src, + success: function(data, textStatus, jqXHR) { + var temp = { + data:data, + xhr:jqXHR + }; + + _mfpTrigger('ParseAjax', temp); + + mfp.appendContent( $(temp.data), AJAX_NS ); + + item.finished = true; + + _removeAjaxCursor(); + + mfp._setFocus(); + + setTimeout(function() { + mfp.wrap.addClass(READY_CLASS); + }, 16); + + mfp.updateStatus('ready'); + + _mfpTrigger('AjaxContentAdded'); + }, + error: function() { + _removeAjaxCursor(); + item.finished = item.loadError = true; + mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src)); + } + }, mfp.st.ajax.settings); + + mfp.req = $.ajax(opts); + + return ''; + } + } +}); + + + + + + + +/*>>ajax*/ + +/*>>image*/ +var _imgInterval, + _getTitle = function(item) { + if(item.data && item.data.title !== undefined) + return item.data.title; + + var src = mfp.st.image.titleSrc; + + if(src) { + if($.isFunction(src)) { + return src.call(mfp, item); + } else if(item.el) { + return item.el.attr(src) || ''; + } + } + return ''; + }; + +$.magnificPopup.registerModule('image', { + + options: { + markup: '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
', + cursor: 'mfp-zoom-out-cur', + titleSrc: 'title', + verticalFit: true, + tError: 'The image could not be loaded.' + }, + + proto: { + initImage: function() { + var imgSt = mfp.st.image, + ns = '.image'; + + mfp.types.push('image'); + + _mfpOn(OPEN_EVENT+ns, function() { + if(mfp.currItem.type === 'image' && imgSt.cursor) { + _body.addClass(imgSt.cursor); + } + }); + + _mfpOn(CLOSE_EVENT+ns, function() { + if(imgSt.cursor) { + _body.removeClass(imgSt.cursor); + } + _window.off('resize' + EVENT_NS); + }); + + _mfpOn('Resize'+ns, mfp.resizeImage); + if(mfp.isLowIE) { + _mfpOn('AfterChange', mfp.resizeImage); + } + }, + resizeImage: function() { + var item = mfp.currItem; + if(!item || !item.img) return; + + if(mfp.st.image.verticalFit) { + var decr = 0; + // fix box-sizing in ie7/8 + if(mfp.isLowIE) { + decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10); + } + item.img.css('max-height', mfp.wH-decr); + } + }, + _onImageHasSize: function(item) { + if(item.img) { + + item.hasSize = true; + + if(_imgInterval) { + clearInterval(_imgInterval); + } + + item.isCheckingImgSize = false; + + _mfpTrigger('ImageHasSize', item); + + if(item.imgHidden) { + if(mfp.content) + mfp.content.removeClass('mfp-loading'); + + item.imgHidden = false; + } + + } + }, + + /** + * Function that loops until the image has size to display elements that rely on it asap + */ + findImageSize: function(item) { + + var counter = 0, + img = item.img[0], + mfpSetInterval = function(delay) { + + if(_imgInterval) { + clearInterval(_imgInterval); + } + // decelerating interval that checks for size of an image + _imgInterval = setInterval(function() { + if(img.naturalWidth > 0) { + mfp._onImageHasSize(item); + return; + } + + if(counter > 200) { + clearInterval(_imgInterval); + } + + counter++; + if(counter === 3) { + mfpSetInterval(10); + } else if(counter === 40) { + mfpSetInterval(50); + } else if(counter === 100) { + mfpSetInterval(500); + } + }, delay); + }; + + mfpSetInterval(1); + }, + + getImage: function(item, template) { + + var guard = 0, + + // image load complete handler + onLoadComplete = function() { + if(item) { + if (item.img[0].complete) { + item.img.off('.mfploader'); + + if(item === mfp.currItem){ + mfp._onImageHasSize(item); + + mfp.updateStatus('ready'); + } + + item.hasSize = true; + item.loaded = true; + + _mfpTrigger('ImageLoadComplete'); + + } + else { + // if image complete check fails 200 times (20 sec), we assume that there was an error. + guard++; + if(guard < 200) { + setTimeout(onLoadComplete,100); + } else { + onLoadError(); + } + } + } + }, + + // image error handler + onLoadError = function() { + if(item) { + item.img.off('.mfploader'); + if(item === mfp.currItem){ + mfp._onImageHasSize(item); + mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) ); + } + + item.hasSize = true; + item.loaded = true; + item.loadError = true; + } + }, + imgSt = mfp.st.image; + + + var el = template.find('.mfp-img'); + if(el.length) { + var img = document.createElement('img'); + img.className = 'mfp-img'; + item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError); + img.src = item.src; + + // without clone() "error" event is not firing when IMG is replaced by new IMG + // TODO: find a way to avoid such cloning + if(el.is('img')) { + item.img = item.img.clone(); + } + + img = item.img[0]; + if(img.naturalWidth > 0) { + item.hasSize = true; + } else if(!img.width) { + item.hasSize = false; + } + } + + mfp._parseMarkup(template, { + title: _getTitle(item), + img_replaceWith: item.img + }, item); + + mfp.resizeImage(); + + if(item.hasSize) { + if(_imgInterval) clearInterval(_imgInterval); + + if(item.loadError) { + template.addClass('mfp-loading'); + mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) ); + } else { + template.removeClass('mfp-loading'); + mfp.updateStatus('ready'); + } + return template; + } + + mfp.updateStatus('loading'); + item.loading = true; + + if(!item.hasSize) { + item.imgHidden = true; + template.addClass('mfp-loading'); + mfp.findImageSize(item); + } + + return template; + } + } +}); + + + +/*>>image*/ + +/*>>zoom*/ +var hasMozTransform, + getHasMozTransform = function() { + if(hasMozTransform === undefined) { + hasMozTransform = document.createElement('p').style.MozTransform !== undefined; + } + return hasMozTransform; + }; + +$.magnificPopup.registerModule('zoom', { + + options: { + enabled: false, + easing: 'ease-in-out', + duration: 300, + opener: function(element) { + return element.is('img') ? element : element.find('img'); + } + }, + + proto: { + + initZoom: function() { + var zoomSt = mfp.st.zoom, + ns = '.zoom', + image; + + if(!zoomSt.enabled || !mfp.supportsTransition) { + return; + } + + var duration = zoomSt.duration, + getElToAnimate = function(image) { + var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'), + transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing, + cssObj = { + position: 'fixed', + zIndex: 9999, + left: 0, + top: 0, + '-webkit-backface-visibility': 'hidden' + }, + t = 'transition'; + + cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition; + + newImg.css(cssObj); + return newImg; + }, + showMainContent = function() { + mfp.content.css('visibility', 'visible'); + }, + openTimeout, + animatedImg; + + _mfpOn('BuildControls'+ns, function() { + if(mfp._allowZoom()) { + + clearTimeout(openTimeout); + mfp.content.css('visibility', 'hidden'); + + // Basically, all code below does is clones existing image, puts in on top of the current one and animated it + + image = mfp._getItemToZoom(); + + if(!image) { + showMainContent(); + return; + } + + animatedImg = getElToAnimate(image); + + animatedImg.css( mfp._getOffset() ); + + mfp.wrap.append(animatedImg); + + openTimeout = setTimeout(function() { + animatedImg.css( mfp._getOffset( true ) ); + openTimeout = setTimeout(function() { + + showMainContent(); + + setTimeout(function() { + animatedImg.remove(); + image = animatedImg = null; + _mfpTrigger('ZoomAnimationEnded'); + }, 16); // avoid blink when switching images + + }, duration); // this timeout equals animation duration + + }, 16); // by adding this timeout we avoid short glitch at the beginning of animation + + + // Lots of timeouts... + } + }); + _mfpOn(BEFORE_CLOSE_EVENT+ns, function() { + if(mfp._allowZoom()) { + + clearTimeout(openTimeout); + + mfp.st.removalDelay = duration; + + if(!image) { + image = mfp._getItemToZoom(); + if(!image) { + return; + } + animatedImg = getElToAnimate(image); + } + + + animatedImg.css( mfp._getOffset(true) ); + mfp.wrap.append(animatedImg); + mfp.content.css('visibility', 'hidden'); + + setTimeout(function() { + animatedImg.css( mfp._getOffset() ); + }, 16); + } + + }); + + _mfpOn(CLOSE_EVENT+ns, function() { + if(mfp._allowZoom()) { + showMainContent(); + if(animatedImg) { + animatedImg.remove(); + } + image = null; + } + }); + }, + + _allowZoom: function() { + return mfp.currItem.type === 'image'; + }, + + _getItemToZoom: function() { + if(mfp.currItem.hasSize) { + return mfp.currItem.img; + } else { + return false; + } + }, + + // Get element postion relative to viewport + _getOffset: function(isLarge) { + var el; + if(isLarge) { + el = mfp.currItem.img; + } else { + el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem); + } + + var offset = el.offset(); + var paddingTop = parseInt(el.css('padding-top'),10); + var paddingBottom = parseInt(el.css('padding-bottom'),10); + offset.top -= ( $(window).scrollTop() - paddingTop ); + + + /* + + Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa. + + */ + var obj = { + width: el.width(), + // fix Zepto height+padding issue + height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop + }; + + // I hate to do this, but there is no another option + if( getHasMozTransform() ) { + obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)'; + } else { + obj.left = offset.left; + obj.top = offset.top; + } + return obj; + } + + } +}); + + + +/*>>zoom*/ + +/*>>iframe*/ + +var IFRAME_NS = 'iframe', + _emptyPage = '//about:blank', + + _fixIframeBugs = function(isShowing) { + if(mfp.currTemplate[IFRAME_NS]) { + var el = mfp.currTemplate[IFRAME_NS].find('iframe'); + if(el.length) { + // reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug + if(!isShowing) { + el[0].src = _emptyPage; + } + + // IE8 black screen bug fix + if(mfp.isIE8) { + el.css('display', isShowing ? 'block' : 'none'); + } + } + } + }; + +$.magnificPopup.registerModule(IFRAME_NS, { + + options: { + markup: '
'+ + '
'+ + ''+ + '
', + + srcAction: 'iframe_src', + + // we don't care and support only one default type of URL by default + patterns: { + youtube: { + index: 'youtube.com', + id: 'v=', + src: '//www.youtube.com/embed/%id%?autoplay=1' + }, + vimeo: { + index: 'vimeo.com/', + id: '/', + src: '//player.vimeo.com/video/%id%?autoplay=1' + }, + gmaps: { + index: '//maps.google.', + src: '%id%&output=embed' + } + } + }, + + proto: { + initIframe: function() { + mfp.types.push(IFRAME_NS); + + _mfpOn('BeforeChange', function(e, prevType, newType) { + if(prevType !== newType) { + if(prevType === IFRAME_NS) { + _fixIframeBugs(); // iframe if removed + } else if(newType === IFRAME_NS) { + _fixIframeBugs(true); // iframe is showing + } + }// else { + // iframe source is switched, don't do anything + //} + }); + + _mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() { + _fixIframeBugs(); + }); + }, + + getIframe: function(item, template) { + var embedSrc = item.src; + var iframeSt = mfp.st.iframe; + + $.each(iframeSt.patterns, function() { + if(embedSrc.indexOf( this.index ) > -1) { + if(this.id) { + if(typeof this.id === 'string') { + embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length); + } else { + embedSrc = this.id.call( this, embedSrc ); + } + } + embedSrc = this.src.replace('%id%', embedSrc ); + return false; // break; + } + }); + + var dataObj = {}; + if(iframeSt.srcAction) { + dataObj[iframeSt.srcAction] = embedSrc; + } + mfp._parseMarkup(template, dataObj, item); + + mfp.updateStatus('ready'); + + return template; + } + } +}); + + + +/*>>iframe*/ + +/*>>gallery*/ +/** + * Get looped index depending on number of slides + */ +var _getLoopedId = function(index) { + var numSlides = mfp.items.length; + if(index > numSlides - 1) { + return index - numSlides; + } else if(index < 0) { + return numSlides + index; + } + return index; + }, + _replaceCurrTotal = function(text, curr, total) { + return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total); + }; + +$.magnificPopup.registerModule('gallery', { + + options: { + enabled: false, + arrowMarkup: '', + preload: [0,2], + navigateByImgClick: true, + arrows: true, + + tPrev: 'Previous (Left arrow key)', + tNext: 'Next (Right arrow key)', + tCounter: '%curr% of %total%' + }, + + proto: { + initGallery: function() { + + var gSt = mfp.st.gallery, + ns = '.mfp-gallery', + supportsFastClick = Boolean($.fn.mfpFastClick); + + mfp.direction = true; // true - next, false - prev + + if(!gSt || !gSt.enabled ) return false; + + _wrapClasses += ' mfp-gallery'; + + _mfpOn(OPEN_EVENT+ns, function() { + + if(gSt.navigateByImgClick) { + mfp.wrap.on('click'+ns, '.mfp-img', function() { + if(mfp.items.length > 1) { + mfp.next(); + return false; + } + }); + } + + _document.on('keydown'+ns, function(e) { + if (e.keyCode === 37) { + mfp.prev(); + } else if (e.keyCode === 39) { + mfp.next(); + } + }); + }); + + _mfpOn('UpdateStatus'+ns, function(e, data) { + if(data.text) { + data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length); + } + }); + + _mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) { + var l = mfp.items.length; + values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : ''; + }); + + _mfpOn('BuildControls' + ns, function() { + if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) { + var markup = gSt.arrowMarkup, + arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS), + arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS); + + var eName = supportsFastClick ? 'mfpFastClick' : 'click'; + arrowLeft[eName](function() { + mfp.prev(); + }); + arrowRight[eName](function() { + mfp.next(); + }); + + // Polyfill for :before and :after (adds elements with classes mfp-a and mfp-b) + if(mfp.isIE7) { + _getEl('b', arrowLeft[0], false, true); + _getEl('a', arrowLeft[0], false, true); + _getEl('b', arrowRight[0], false, true); + _getEl('a', arrowRight[0], false, true); + } + + mfp.container.append(arrowLeft.add(arrowRight)); + } + }); + + _mfpOn(CHANGE_EVENT+ns, function() { + if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout); + + mfp._preloadTimeout = setTimeout(function() { + mfp.preloadNearbyImages(); + mfp._preloadTimeout = null; + }, 16); + }); + + + _mfpOn(CLOSE_EVENT+ns, function() { + _document.off(ns); + mfp.wrap.off('click'+ns); + + if(mfp.arrowLeft && supportsFastClick) { + mfp.arrowLeft.add(mfp.arrowRight).destroyMfpFastClick(); + } + mfp.arrowRight = mfp.arrowLeft = null; + }); + + }, + next: function() { + mfp.direction = true; + mfp.index = _getLoopedId(mfp.index + 1); + mfp.updateItemHTML(); + }, + prev: function() { + mfp.direction = false; + mfp.index = _getLoopedId(mfp.index - 1); + mfp.updateItemHTML(); + }, + goTo: function(newIndex) { + mfp.direction = (newIndex >= mfp.index); + mfp.index = newIndex; + mfp.updateItemHTML(); + }, + preloadNearbyImages: function() { + var p = mfp.st.gallery.preload, + preloadBefore = Math.min(p[0], mfp.items.length), + preloadAfter = Math.min(p[1], mfp.items.length), + i; + + for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) { + mfp._preloadItem(mfp.index+i); + } + for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) { + mfp._preloadItem(mfp.index-i); + } + }, + _preloadItem: function(index) { + index = _getLoopedId(index); + + if(mfp.items[index].preloaded) { + return; + } + + var item = mfp.items[index]; + if(!item.parsed) { + item = mfp.parseEl( index ); + } + + _mfpTrigger('LazyLoad', item); + + if(item.type === 'image') { + item.img = $('').on('load.mfploader', function() { + item.hasSize = true; + }).on('error.mfploader', function() { + item.hasSize = true; + item.loadError = true; + _mfpTrigger('LazyLoadError', item); + }).attr('src', item.src); + } + + + item.preloaded = true; + } + } +}); + +/* +Touch Support that might be implemented some day + +addSwipeGesture: function() { + var startX, + moved, + multipleTouches; + + return; + + var namespace = '.mfp', + addEventNames = function(pref, down, move, up, cancel) { + mfp._tStart = pref + down + namespace; + mfp._tMove = pref + move + namespace; + mfp._tEnd = pref + up + namespace; + mfp._tCancel = pref + cancel + namespace; + }; + + if(window.navigator.msPointerEnabled) { + addEventNames('MSPointer', 'Down', 'Move', 'Up', 'Cancel'); + } else if('ontouchstart' in window) { + addEventNames('touch', 'start', 'move', 'end', 'cancel'); + } else { + return; + } + _window.on(mfp._tStart, function(e) { + var oE = e.originalEvent; + multipleTouches = moved = false; + startX = oE.pageX || oE.changedTouches[0].pageX; + }).on(mfp._tMove, function(e) { + if(e.originalEvent.touches.length > 1) { + multipleTouches = e.originalEvent.touches.length; + } else { + //e.preventDefault(); + moved = true; + } + }).on(mfp._tEnd + ' ' + mfp._tCancel, function(e) { + if(moved && !multipleTouches) { + var oE = e.originalEvent, + diff = startX - (oE.pageX || oE.changedTouches[0].pageX); + + if(diff > 20) { + mfp.next(); + } else if(diff < -20) { + mfp.prev(); + } + } + }); +}, +*/ + + +/*>>gallery*/ + +/*>>retina*/ + +var RETINA_NS = 'retina'; + +$.magnificPopup.registerModule(RETINA_NS, { + options: { + replaceSrc: function(item) { + return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; }); + }, + ratio: 1 // Function or number. Set to 1 to disable. + }, + proto: { + initRetina: function() { + if(window.devicePixelRatio > 1) { + + var st = mfp.st.retina, + ratio = st.ratio; + + ratio = !isNaN(ratio) ? ratio : ratio(); + + if(ratio > 1) { + _mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) { + item.img.css({ + 'max-width': item.img[0].naturalWidth / ratio, + 'width': '100%' + }); + }); + _mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) { + item.src = st.replaceSrc(item, ratio); + }); + } + } + + } + } +}); + +/*>>retina*/ + +/*>>fastclick*/ +/** + * FastClick event implementation. (removes 300ms delay on touch devices) + * Based on https://developers.google.com/mobile/articles/fast_buttons + * + * You may use it outside the Magnific Popup by calling just: + * + * $('.your-el').mfpFastClick(function() { + * console.log('Clicked!'); + * }); + * + * To unbind: + * $('.your-el').destroyMfpFastClick(); + * + * + * Note that it's a very basic and simple implementation, it blocks ghost click on the same element where it was bound. + * If you need something more advanced, use plugin by FT Labs https://github.com/ftlabs/fastclick + * + */ + +(function() { + var ghostClickDelay = 1000, + supportsTouch = 'ontouchstart' in window, + unbindTouchMove = function() { + _window.off('touchmove'+ns+' touchend'+ns); + }, + eName = 'mfpFastClick', + ns = '.'+eName; + + + // As Zepto.js doesn't have an easy way to add custom events (like jQuery), so we implement it in this way + $.fn.mfpFastClick = function(callback) { + + return $(this).each(function() { + + var elem = $(this), + lock; + + if( supportsTouch ) { + + var timeout, + startX, + startY, + pointerMoved, + point, + numPointers; + + elem.on('touchstart' + ns, function(e) { + pointerMoved = false; + numPointers = 1; + + point = e.originalEvent ? e.originalEvent.touches[0] : e.touches[0]; + startX = point.clientX; + startY = point.clientY; + + _window.on('touchmove'+ns, function(e) { + point = e.originalEvent ? e.originalEvent.touches : e.touches; + numPointers = point.length; + point = point[0]; + if (Math.abs(point.clientX - startX) > 10 || + Math.abs(point.clientY - startY) > 10) { + pointerMoved = true; + unbindTouchMove(); + } + }).on('touchend'+ns, function(e) { + unbindTouchMove(); + if(pointerMoved || numPointers > 1) { + return; + } + lock = true; + e.preventDefault(); + clearTimeout(timeout); + timeout = setTimeout(function() { + lock = false; + }, ghostClickDelay); + callback(); + }); + }); + + } + + elem.on('click' + ns, function() { + if(!lock) { + callback(); + } + }); + }); + }; + + $.fn.destroyMfpFastClick = function() { + $(this).off('touchstart' + ns + ' click' + ns); + if(supportsTouch) _window.off('touchmove'+ns+' touchend'+ns); + }; +})(); + +/*>>fastclick*/ + _checkInstance(); })(window.jQuery || window.Zepto); \ No newline at end of file diff --git a/assets/js/plugins/jquery.magnific-popup/jquery.magnific-popup.min.js b/assets/js/plugins/jquery.magnific-popup/jquery.magnific-popup.min.js new file mode 100644 index 0000000..cf1f26d --- /dev/null +++ b/assets/js/plugins/jquery.magnific-popup/jquery.magnific-popup.min.js @@ -0,0 +1,4 @@ +/*! Magnific Popup - v0.9.9 - 2013-12-27 +* http://dimsemenov.com/plugins/magnific-popup/ +* Copyright (c) 2013 Dmitry Semenov; */ +(function(e){var t,n,i,o,r,a,s,l="Close",c="BeforeClose",d="AfterClose",u="BeforeAppend",p="MarkupParse",f="Open",m="Change",g="mfp",h="."+g,v="mfp-ready",C="mfp-removing",y="mfp-prevent-close",w=function(){},b=!!window.jQuery,I=e(window),x=function(e,n){t.ev.on(g+e+h,n)},k=function(t,n,i,o){var r=document.createElement("div");return r.className="mfp-"+t,i&&(r.innerHTML=i),o?n&&n.appendChild(r):(r=e(r),n&&r.appendTo(n)),r},T=function(n,i){t.ev.triggerHandler(g+n,i),t.st.callbacks&&(n=n.charAt(0).toLowerCase()+n.slice(1),t.st.callbacks[n]&&t.st.callbacks[n].apply(t,e.isArray(i)?i:[i]))},E=function(n){return n===s&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),s=n),t.currTemplate.closeBtn},_=function(){e.magnificPopup.instance||(t=new w,t.init(),e.magnificPopup.instance=t)},S=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1};w.prototype={constructor:w,init:function(){var n=navigator.appVersion;t.isIE7=-1!==n.indexOf("MSIE 7."),t.isIE8=-1!==n.indexOf("MSIE 8."),t.isLowIE=t.isIE7||t.isIE8,t.isAndroid=/android/gi.test(n),t.isIOS=/iphone|ipad|ipod/gi.test(n),t.supportsTransition=S(),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),o=e(document),t.popupsCache={}},open:function(n){i||(i=e(document.body));var r;if(n.isObj===!1){t.items=n.items.toArray(),t.index=0;var s,l=n.items;for(r=0;l.length>r;r++)if(s=l[r],s.parsed&&(s=s.el[0]),s===n.el[0]){t.index=r;break}}else t.items=e.isArray(n.items)?n.items:[n.items],t.index=n.index||0;if(t.isOpen)return t.updateItemHTML(),void 0;t.types=[],a="",t.ev=n.mainEl&&n.mainEl.length?n.mainEl.eq(0):o,n.key?(t.popupsCache[n.key]||(t.popupsCache[n.key]={}),t.currTemplate=t.popupsCache[n.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopup.defaults,n),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.st.modal&&(t.st.closeOnContentClick=!1,t.st.closeOnBgClick=!1,t.st.showCloseBtn=!1,t.st.enableEscapeKey=!1),t.bgOverlay||(t.bgOverlay=k("bg").on("click"+h,function(){t.close()}),t.wrap=k("wrap").attr("tabindex",-1).on("click"+h,function(e){t._checkIfClose(e.target)&&t.close()}),t.container=k("container",t.wrap)),t.contentContainer=k("content"),t.st.preloader&&(t.preloader=k("preloader",t.container,t.st.tLoading));var c=e.magnificPopup.modules;for(r=0;c.length>r;r++){var d=c[r];d=d.charAt(0).toUpperCase()+d.slice(1),t["init"+d].call(t)}T("BeforeOpen"),t.st.showCloseBtn&&(t.st.closeBtnInside?(x(p,function(e,t,n,i){n.close_replaceWith=E(i.type)}),a+=" mfp-close-btn-in"):t.wrap.append(E())),t.st.alignTop&&(a+=" mfp-align-top"),t.fixedContentPos?t.wrap.css({overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}):t.wrap.css({top:I.scrollTop(),position:"absolute"}),(t.st.fixedBgPos===!1||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:o.height(),position:"absolute"}),t.st.enableEscapeKey&&o.on("keyup"+h,function(e){27===e.keyCode&&t.close()}),I.on("resize"+h,function(){t.updateSize()}),t.st.closeOnContentClick||(a+=" mfp-auto-cursor"),a&&t.wrap.addClass(a);var u=t.wH=I.height(),m={};if(t.fixedContentPos&&t._hasScrollBar(u)){var g=t._getScrollbarSize();g&&(m.marginRight=g)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):m.overflow="hidden");var C=t.st.mainClass;return t.isIE7&&(C+=" mfp-ie7"),C&&t._addClassToMFP(C),t.updateItemHTML(),T("BuildControls"),e("html").css(m),t.bgOverlay.add(t.wrap).prependTo(t.st.prependTo||i),t._lastFocusedEl=document.activeElement,setTimeout(function(){t.content?(t._addClassToMFP(v),t._setFocus()):t.bgOverlay.addClass(v),o.on("focusin"+h,t._onFocusIn)},16),t.isOpen=!0,t.updateSize(u),T(f),n},close:function(){t.isOpen&&(T(c),t.isOpen=!1,t.st.removalDelay&&!t.isLowIE&&t.supportsTransition?(t._addClassToMFP(C),setTimeout(function(){t._close()},t.st.removalDelay)):t._close())},_close:function(){T(l);var n=C+" "+v+" ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(n+=t.st.mainClass+" "),t._removeClassFromMFP(n),t.fixedContentPos){var i={marginRight:""};t.isIE7?e("body, html").css("overflow",""):i.overflow="",e("html").css(i)}o.off("keyup"+h+" focusin"+h),t.ev.off(h),t.wrap.attr("class","mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","mfp-bg"),t.container.attr("class","mfp-container"),!t.st.showCloseBtn||t.st.closeBtnInside&&t.currTemplate[t.currItem.type]!==!0||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t._lastFocusedEl&&e(t._lastFocusedEl).focus(),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0,T(d)},updateSize:function(e){if(t.isIOS){var n=document.documentElement.clientWidth/window.innerWidth,i=window.innerHeight*n;t.wrap.css("height",i),t.wH=i}else t.wH=e||I.height();t.fixedContentPos||t.wrap.css("height",t.wH),T("Resize")},updateItemHTML:function(){var n=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),n.parsed||(n=t.parseEl(t.index));var i=n.type;if(T("BeforeChange",[t.currItem?t.currItem.type:"",i]),t.currItem=n,!t.currTemplate[i]){var o=t.st[i]?t.st[i].markup:!1;T("FirstMarkupParse",o),t.currTemplate[i]=o?e(o):!0}r&&r!==n.type&&t.container.removeClass("mfp-"+r+"-holder");var a=t["get"+i.charAt(0).toUpperCase()+i.slice(1)](n,t.currTemplate[i]);t.appendContent(a,i),n.preloaded=!0,T(m,n),r=n.type,t.container.prepend(t.contentContainer),T("AfterChange")},appendContent:function(e,n){t.content=e,e?t.st.showCloseBtn&&t.st.closeBtnInside&&t.currTemplate[n]===!0?t.content.find(".mfp-close").length||t.content.append(E()):t.content=e:t.content="",T(u),t.container.addClass("mfp-"+n+"-holder"),t.contentContainer.append(t.content)},parseEl:function(n){var i,o=t.items[n];if(o.tagName?o={el:e(o)}:(i=o.type,o={data:o,src:o.src}),o.el){for(var r=t.types,a=0;r.length>a;a++)if(o.el.hasClass("mfp-"+r[a])){i=r[a];break}o.src=o.el.attr("data-mfp-src"),o.src||(o.src=o.el.attr("href"))}return o.type=i||t.st.type||"inline",o.index=n,o.parsed=!0,t.items[n]=o,T("ElementParse",o),t.items[n]},addGroup:function(e,n){var i=function(i){i.mfpEl=this,t._openClick(i,e,n)};n||(n={});var o="click.magnificPopup";n.mainEl=e,n.items?(n.isObj=!0,e.off(o).on(o,i)):(n.isObj=!1,n.delegate?e.off(o).on(o,n.delegate,i):(n.items=e,e.off(o).on(o,i)))},_openClick:function(n,i,o){var r=void 0!==o.midClick?o.midClick:e.magnificPopup.defaults.midClick;if(r||2!==n.which&&!n.ctrlKey&&!n.metaKey){var a=void 0!==o.disableOn?o.disableOn:e.magnificPopup.defaults.disableOn;if(a)if(e.isFunction(a)){if(!a.call(t))return!0}else if(a>I.width())return!0;n.type&&(n.preventDefault(),t.isOpen&&n.stopPropagation()),o.el=e(n.mfpEl),o.delegate&&(o.items=i.find(o.delegate)),t.open(o)}},updateStatus:function(e,i){if(t.preloader){n!==e&&t.container.removeClass("mfp-s-"+n),i||"loading"!==e||(i=t.st.tLoading);var o={status:e,text:i};T("UpdateStatus",o),e=o.status,i=o.text,t.preloader.html(i),t.preloader.find("a").on("click",function(e){e.stopImmediatePropagation()}),t.container.addClass("mfp-s-"+e),n=e}},_checkIfClose:function(n){if(!e(n).hasClass(y)){var i=t.st.closeOnContentClick,o=t.st.closeOnBgClick;if(i&&o)return!0;if(!t.content||e(n).hasClass("mfp-close")||t.preloader&&n===t.preloader[0])return!0;if(n===t.content[0]||e.contains(t.content[0],n)){if(i)return!0}else if(o&&e.contains(document,n))return!0;return!1}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return(t.isIE7?o.height():document.body.scrollHeight)>(e||I.height())},_setFocus:function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).focus()},_onFocusIn:function(n){return n.target===t.wrap[0]||e.contains(t.wrap[0],n.target)?void 0:(t._setFocus(),!1)},_parseMarkup:function(t,n,i){var o;i.data&&(n=e.extend(i.data,n)),T(p,[t,n,i]),e.each(n,function(e,n){if(void 0===n||n===!1)return!0;if(o=e.split("_"),o.length>1){var i=t.find(h+"-"+o[0]);if(i.length>0){var r=o[1];"replaceWith"===r?i[0]!==n[0]&&i.replaceWith(n):"img"===r?i.is("img")?i.attr("src",n):i.replaceWith(''):i.attr(o[1],n)}}else t.find(h+"-"+e).html(n)})},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.id="mfp-sbm",e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopup={instance:null,proto:w.prototype,modules:[],open:function(t,n){return _(),t=t?e.extend(!0,{},t):{},t.isObj=!0,t.index=n||0,this.instance.open(t)},close:function(){return e.magnificPopup.instance&&e.magnificPopup.instance.close()},registerModule:function(t,n){n.options&&(e.magnificPopup.defaults[t]=n.options),e.extend(this.proto,n.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'',tClose:"Close (Esc)",tLoading:"Loading..."}},e.fn.magnificPopup=function(n){_();var i=e(this);if("string"==typeof n)if("open"===n){var o,r=b?i.data("magnificPopup"):i[0].magnificPopup,a=parseInt(arguments[1],10)||0;r.items?o=r.items[a]:(o=i,r.delegate&&(o=o.find(r.delegate)),o=o.eq(a)),t._openClick({mfpEl:o},i,r)}else t.isOpen&&t[n].apply(t,Array.prototype.slice.call(arguments,1));else n=e.extend(!0,{},n),b?i.data("magnificPopup",n):i[0].magnificPopup=n,t.addGroup(i,n);return i};var P,O,z,M="inline",B=function(){z&&(O.after(z.addClass(P)).detach(),z=null)};e.magnificPopup.registerModule(M,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push(M),x(l+"."+M,function(){B()})},getInline:function(n,i){if(B(),n.src){var o=t.st.inline,r=e(n.src);if(r.length){var a=r[0].parentNode;a&&a.tagName&&(O||(P=o.hiddenClass,O=k(P),P="mfp-"+P),z=r.after(O).detach().removeClass(P)),t.updateStatus("ready")}else t.updateStatus("error",o.tNotFound),r=e("
");return n.inlineElement=r,r}return t.updateStatus("ready"),t._parseMarkup(i,{},n),i}}});var F,H="ajax",L=function(){F&&i.removeClass(F)},A=function(){L(),t.req&&t.req.abort()};e.magnificPopup.registerModule(H,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'The content could not be loaded.'},proto:{initAjax:function(){t.types.push(H),F=t.st.ajax.cursor,x(l+"."+H,A),x("BeforeChange."+H,A)},getAjax:function(n){F&&i.addClass(F),t.updateStatus("loading");var o=e.extend({url:n.src,success:function(i,o,r){var a={data:i,xhr:r};T("ParseAjax",a),t.appendContent(e(a.data),H),n.finished=!0,L(),t._setFocus(),setTimeout(function(){t.wrap.addClass(v)},16),t.updateStatus("ready"),T("AjaxContentAdded")},error:function(){L(),n.finished=n.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",n.src))}},t.st.ajax.settings);return t.req=e.ajax(o),""}}});var j,N=function(n){if(n.data&&void 0!==n.data.title)return n.data.title;var i=t.st.image.titleSrc;if(i){if(e.isFunction(i))return i.call(t,n);if(n.el)return n.el.attr(i)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'The image could not be loaded.'},proto:{initImage:function(){var e=t.st.image,n=".image";t.types.push("image"),x(f+n,function(){"image"===t.currItem.type&&e.cursor&&i.addClass(e.cursor)}),x(l+n,function(){e.cursor&&i.removeClass(e.cursor),I.off("resize"+h)}),x("Resize"+n,t.resizeImage),t.isLowIE&&x("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e&&e.img&&t.st.image.verticalFit){var n=0;t.isLowIE&&(n=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-n)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,j&&clearInterval(j),e.isCheckingImgSize=!1,T("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var n=0,i=e.img[0],o=function(r){j&&clearInterval(j),j=setInterval(function(){return i.naturalWidth>0?(t._onImageHasSize(e),void 0):(n>200&&clearInterval(j),n++,3===n?o(10):40===n?o(50):100===n&&o(500),void 0)},r)};o(1)},getImage:function(n,i){var o=0,r=function(){n&&(n.img[0].complete?(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("ready")),n.hasSize=!0,n.loaded=!0,T("ImageLoadComplete")):(o++,200>o?setTimeout(r,100):a()))},a=function(){n&&(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("error",s.tError.replace("%url%",n.src))),n.hasSize=!0,n.loaded=!0,n.loadError=!0)},s=t.st.image,l=i.find(".mfp-img");if(l.length){var c=document.createElement("img");c.className="mfp-img",n.img=e(c).on("load.mfploader",r).on("error.mfploader",a),c.src=n.src,l.is("img")&&(n.img=n.img.clone()),c=n.img[0],c.naturalWidth>0?n.hasSize=!0:c.width||(n.hasSize=!1)}return t._parseMarkup(i,{title:N(n),img_replaceWith:n.img},n),t.resizeImage(),n.hasSize?(j&&clearInterval(j),n.loadError?(i.addClass("mfp-loading"),t.updateStatus("error",s.tError.replace("%url%",n.src))):(i.removeClass("mfp-loading"),t.updateStatus("ready")),i):(t.updateStatus("loading"),n.loading=!0,n.hasSize||(n.imgHidden=!0,i.addClass("mfp-loading"),t.findImageSize(n)),i)}}});var W,R=function(){return void 0===W&&(W=void 0!==document.createElement("p").style.MozTransform),W};e.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e,n=t.st.zoom,i=".zoom";if(n.enabled&&t.supportsTransition){var o,r,a=n.duration,s=function(e){var t=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),i="all "+n.duration/1e3+"s "+n.easing,o={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},r="transition";return o["-webkit-"+r]=o["-moz-"+r]=o["-o-"+r]=o[r]=i,t.css(o),t},d=function(){t.content.css("visibility","visible")};x("BuildControls"+i,function(){if(t._allowZoom()){if(clearTimeout(o),t.content.css("visibility","hidden"),e=t._getItemToZoom(),!e)return d(),void 0;r=s(e),r.css(t._getOffset()),t.wrap.append(r),o=setTimeout(function(){r.css(t._getOffset(!0)),o=setTimeout(function(){d(),setTimeout(function(){r.remove(),e=r=null,T("ZoomAnimationEnded")},16)},a)},16)}}),x(c+i,function(){if(t._allowZoom()){if(clearTimeout(o),t.st.removalDelay=a,!e){if(e=t._getItemToZoom(),!e)return;r=s(e)}r.css(t._getOffset(!0)),t.wrap.append(r),t.content.css("visibility","hidden"),setTimeout(function(){r.css(t._getOffset())},16)}}),x(l+i,function(){t._allowZoom()&&(d(),r&&r.remove(),e=null)})}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return t.currItem.hasSize?t.currItem.img:!1},_getOffset:function(n){var i;i=n?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem);var o=i.offset(),r=parseInt(i.css("padding-top"),10),a=parseInt(i.css("padding-bottom"),10);o.top-=e(window).scrollTop()-r;var s={width:i.width(),height:(b?i.innerHeight():i[0].offsetHeight)-a-r};return R()?s["-moz-transform"]=s.transform="translate("+o.left+"px,"+o.top+"px)":(s.left=o.left,s.top=o.top),s}}});var Z="iframe",q="//about:blank",D=function(e){if(t.currTemplate[Z]){var n=t.currTemplate[Z].find("iframe");n.length&&(e||(n[0].src=q),t.isIE8&&n.css("display",e?"block":"none"))}};e.magnificPopup.registerModule(Z,{options:{markup:'
',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(Z),x("BeforeChange",function(e,t,n){t!==n&&(t===Z?D():n===Z&&D(!0))}),x(l+"."+Z,function(){D()})},getIframe:function(n,i){var o=n.src,r=t.st.iframe;e.each(r.patterns,function(){return o.indexOf(this.index)>-1?(this.id&&(o="string"==typeof this.id?o.substr(o.lastIndexOf(this.id)+this.id.length,o.length):this.id.call(this,o)),o=this.src.replace("%id%",o),!1):void 0});var a={};return r.srcAction&&(a[r.srcAction]=o),t._parseMarkup(i,a,n),t.updateStatus("ready"),i}}});var K=function(e){var n=t.items.length;return e>n-1?e-n:0>e?n+e:e},Y=function(e,t,n){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,n)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var n=t.st.gallery,i=".mfp-gallery",r=Boolean(e.fn.mfpFastClick);return t.direction=!0,n&&n.enabled?(a+=" mfp-gallery",x(f+i,function(){n.navigateByImgClick&&t.wrap.on("click"+i,".mfp-img",function(){return t.items.length>1?(t.next(),!1):void 0}),o.on("keydown"+i,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),x("UpdateStatus"+i,function(e,n){n.text&&(n.text=Y(n.text,t.currItem.index,t.items.length))}),x(p+i,function(e,i,o,r){var a=t.items.length;o.counter=a>1?Y(n.tCounter,r.index,a):""}),x("BuildControls"+i,function(){if(t.items.length>1&&n.arrows&&!t.arrowLeft){var i=n.arrowMarkup,o=t.arrowLeft=e(i.replace(/%title%/gi,n.tPrev).replace(/%dir%/gi,"left")).addClass(y),a=t.arrowRight=e(i.replace(/%title%/gi,n.tNext).replace(/%dir%/gi,"right")).addClass(y),s=r?"mfpFastClick":"click";o[s](function(){t.prev()}),a[s](function(){t.next()}),t.isIE7&&(k("b",o[0],!1,!0),k("a",o[0],!1,!0),k("b",a[0],!1,!0),k("a",a[0],!1,!0)),t.container.append(o.add(a))}}),x(m+i,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),x(l+i,function(){o.off(i),t.wrap.off("click"+i),t.arrowLeft&&r&&t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(),t.arrowRight=t.arrowLeft=null}),void 0):!1},next:function(){t.direction=!0,t.index=K(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=K(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,n=t.st.gallery.preload,i=Math.min(n[0],t.items.length),o=Math.min(n[1],t.items.length);for(e=1;(t.direction?o:i)>=e;e++)t._preloadItem(t.index+e);for(e=1;(t.direction?i:o)>=e;e++)t._preloadItem(t.index-e)},_preloadItem:function(n){if(n=K(n),!t.items[n].preloaded){var i=t.items[n];i.parsed||(i=t.parseEl(n)),T("LazyLoad",i),"image"===i.type&&(i.img=e('').on("load.mfploader",function(){i.hasSize=!0}).on("error.mfploader",function(){i.hasSize=!0,i.loadError=!0,T("LazyLoadError",i)}).attr("src",i.src)),i.preloaded=!0}}}});var U="retina";e.magnificPopup.registerModule(U,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,n=e.ratio;n=isNaN(n)?n():n,n>1&&(x("ImageHasSize."+U,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/n,width:"100%"})}),x("ElementParse."+U,function(t,i){i.src=e.replaceSrc(i,n)}))}}}}),function(){var t=1e3,n="ontouchstart"in window,i=function(){I.off("touchmove"+r+" touchend"+r)},o="mfpFastClick",r="."+o;e.fn.mfpFastClick=function(o){return e(this).each(function(){var a,s=e(this);if(n){var l,c,d,u,p,f;s.on("touchstart"+r,function(e){u=!1,f=1,p=e.originalEvent?e.originalEvent.touches[0]:e.touches[0],c=p.clientX,d=p.clientY,I.on("touchmove"+r,function(e){p=e.originalEvent?e.originalEvent.touches:e.touches,f=p.length,p=p[0],(Math.abs(p.clientX-c)>10||Math.abs(p.clientY-d)>10)&&(u=!0,i())}).on("touchend"+r,function(e){i(),u||f>1||(a=!0,e.preventDefault(),clearTimeout(l),l=setTimeout(function(){a=!1},t),o())})})}s.on("click"+r,function(){a||o()})})},e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+r+" click"+r),n&&I.off("touchmove"+r+" touchend"+r)}}(),_()})(window.jQuery||window.Zepto); \ No newline at end of file diff --git a/assets/js/plugins/jquery.mixitup.js b/assets/js/plugins/jquery.mixitup.js new file mode 100644 index 0000000..f02dd07 --- /dev/null +++ b/assets/js/plugins/jquery.mixitup.js @@ -0,0 +1,492 @@ +/* + * MIXITUP - A CSS3 & JQuery Filter and Sort Plugin + * Version: 1.4.0 + * Author: Patrick Kunka + * Copyright 2012-2013 Patrick Kunka, All Rights Reserved + * FREE FOR NON-COMMERCIAL USE + * http://www.mixitup.io + */ +(function(e) { + function m(d, b, h, c, a) { + function j() { + k.unbind(); + b && v(b, h, c, a); + a.startOrder = []; + a.newOrder = []; + a.origSort = []; + a.checkSort = []; + u.removeStyle(a.prefix + "filter, filter, " + a.prefix + "transform, transform, opacity, display").css(a.clean).removeAttr("data-checksum"); + window.atob || u.css({ + display: "none", + opacity: "0" + }); + k.removeStyle(a.prefix + "transition, transition, " + a.prefix + "perspective, perspective, " + a.prefix + "perspective-origin, perspective-origin, " + (a.resizeContainer ? "height" : "")); + "list" == a.layoutMode ? + (q.css({ + display: a.targetDisplayList, + opacity: "1" + }), a.origDisplay = a.targetDisplayList) : (q.css({ + display: a.targetDisplayGrid, + opacity: "1" + }), a.origDisplay = a.targetDisplayGrid); + a.origLayout = a.layoutMode; + setTimeout(function() { + u.removeStyle(a.prefix + "transition, transition"); + a.mixing = !1; + if ("function" == typeof a.onMixEnd) { + var b = a.onMixEnd.call(this, a); + a = b ? b : a + } + }) + } + clearInterval(a.failsafe); + a.mixing = !0; + if ("function" == typeof a.onMixStart) { + var f = a.onMixStart.call(this, a); + a = f ? f : a + } + for (var g = a.transitionSpeed, f = 0; 2 > + f; f++) { + var n = 0 == f ? n = a.prefix : ""; + a.transition[n + "transition"] = "all " + g + "ms linear"; + a.transition[n + "transform"] = n + "translate3d(0,0,0)"; + a.perspective[n + "perspective"] = a.perspectiveDistance + "px"; + a.perspective[n + "perspective-origin"] = a.perspectiveOrigin + } + var r = a.targetSelector, + u = c.find(r); + u.each(function() { + this.data = {} + }); + var k = u.parent(); + k.css(a.perspective); + a.easingFallback = "ease-in-out"; + "smooth" == a.easing && (a.easing = "cubic-bezier(0.25, 0.46, 0.45, 0.94)"); + "snap" == a.easing && (a.easing = "cubic-bezier(0.77, 0, 0.175, 1)"); + "windback" == a.easing && (a.easing = "cubic-bezier(0.175, 0.885, 0.320, 1.275)", a.easingFallback = "cubic-bezier(0.175, 0.885, 0.320, 1)"); + "windup" == a.easing && (a.easing = "cubic-bezier(0.6, -0.28, 0.735, 0.045)", a.easingFallback = "cubic-bezier(0.6, 0.28, 0.735, 0.045)"); + f = "list" == a.layoutMode && null != a.listEffects ? a.listEffects : a.effects; + Array.prototype.indexOf && (a.fade = -1 < f.indexOf("fade") ? "0" : "", a.scale = -1 < f.indexOf("scale") ? "scale(.01)" : "", a.rotateZ = -1 < f.indexOf("rotateZ") ? "rotate(180deg)" : "", a.rotateY = -1 < + f.indexOf("rotateY") ? "rotateY(90deg)" : "", a.rotateX = -1 < f.indexOf("rotateX") ? "rotateX(90deg)" : "", a.blur = -1 < f.indexOf("blur") ? "blur(8px)" : "", a.grayscale = -1 < f.indexOf("grayscale") ? "grayscale(100%)" : ""); + d = d.replace(/\s|\//g, "."); + var q = e(), + s = e(); + if ("or" == a.filterLogic) { + var m = d.split("."); + !0 == a.multiFilter && "" == m[0] && m.shift(); + 1 > m.length ? s = s.add(c.find(r + ":visible")) : u.each(function() { + for (var a = 0, b = e(this), c = 0; c < m.length; c++) b.hasClass(m[c]) && (q = q.add(b), a++); + 0 == a && (s = s.add(b)) + }) + } else q = q.add(k.find(r + "." + + d)), s = s.add(k.find(r + ":not(." + d + "):visible")); + d = q.length; + var t = e(), + p = e(), + l = e(); + s.each(function() { + var a = e(this); + "none" != a.css("display") && (t = t.add(a), l = l.add(a)) + }); + if (q.filter(":visible").length == d && !t.length && !b) { + if (a.origLayout == a.layoutMode) return j(), !1; + if (1 == q.length) return "list" == a.layoutMode ? (c.addClass(a.listClass), c.removeClass(a.gridClass), l.css("display", a.targetDisplayList)) : (c.addClass(a.gridClass), c.removeClass(a.listClass), l.css("display", a.targetDisplayGrid)), j(), !1 + } + a.origHeight = k.height(); + if (q.length) { + c.removeClass(a.failClass); + q.each(function() { + var a = e(this); + "none" == a.css("display") ? p = p.add(a) : l = l.add(a) + }); + if (a.origLayout != a.layoutMode && !1 == a.animateGridList) return "list" == a.layoutMode ? (c.addClass(a.listClass), c.removeClass(a.gridClass), l.css("display", a.targetDisplayList)) : (c.addClass(a.gridClass), c.removeClass(a.listClass), l.css("display", a.targetDisplayGrid)), j(), !1; + if (!window.atob) return j(), !1; + u.css(a.clean); + l.each(function() { + this.data.origPos = e(this).offset() + }); + "list" == a.layoutMode ? + (c.addClass(a.listClass), c.removeClass(a.gridClass), p.css("display", a.targetDisplayList)) : (c.addClass(a.gridClass), c.removeClass(a.listClass), p.css("display", a.targetDisplayGrid)); + p.each(function() { + this.data.showInterPos = e(this).offset() + }); + t.each(function() { + this.data.hideInterPos = e(this).offset() + }); + l.each(function() { + this.data.preInterPos = e(this).offset() + }); + "list" == a.layoutMode ? l.css("display", a.targetDisplayList) : l.css("display", a.targetDisplayGrid); + b && v(b, h, c, a); + if (b && a.origSort.compare(a.checkSort)) return j(), !1; + t.hide(); + p.each(function() { + this.data.finalPos = e(this).offset() + }); + l.each(function() { + this.data.finalPrePos = e(this).offset() + }); + a.newHeight = k.height(); + b && v("reset", null, c, a); + p.hide(); + l.css("display", a.origDisplay); + "block" == a.origDisplay ? (c.addClass(a.listClass), p.css("display", a.targetDisplayList)) : (c.removeClass(a.listClass), p.css("display", a.targetDisplayGrid)); + a.resizeContainer && k.css("height", a.origHeight + "px"); + d = {}; + for (f = 0; 2 > f; f++) n = 0 == f ? n = a.prefix : "", d[n + "transform"] = a.scale + " " + a.rotateX + " " + + a.rotateY + " " + a.rotateZ, d[n + "filter"] = a.blur + " " + a.grayscale; + p.css(d); + l.each(function() { + var b = this.data, + c = e(this); + c.hasClass("mix_tohide") ? (b.preTX = b.origPos.left - b.hideInterPos.left, b.preTY = b.origPos.top - b.hideInterPos.top) : (b.preTX = b.origPos.left - b.preInterPos.left, b.preTY = b.origPos.top - b.preInterPos.top); + for (var d = {}, g = 0; 2 > g; g++) { + var f = 0 == g ? f = a.prefix : ""; + d[f + "transform"] = "translate(" + b.preTX + "px," + b.preTY + "px)" + } + c.css(d) + }); + "list" == a.layoutMode ? (c.addClass(a.listClass), c.removeClass(a.gridClass)) : + (c.addClass(a.gridClass), c.removeClass(a.listClass)); + setTimeout(function() { + if (a.resizeContainer) { + for (var b = {}, c = 0; 2 > c; c++) { + var d = 0 == c ? d = a.prefix : ""; + b[d + "transition"] = "all " + g + "ms ease-in-out"; + b.height = a.newHeight + "px" + } + k.css(b) + } + t.css("opacity", a.fade); + p.css("opacity", 1); + p.each(function() { + var b = this.data; + b.tX = b.finalPos.left - b.showInterPos.left; + b.tY = b.finalPos.top - b.showInterPos.top; + for (var c = {}, d = 0; 2 > d; d++) { + var f = 0 == d ? f = a.prefix : ""; + c[f + "transition-property"] = f + "transform, " + f + "filter, opacity"; + c[f + + "transition-timing-function"] = a.easing + ", linear, linear"; + c[f + "transition-duration"] = g + "ms"; + c[f + "transition-delay"] = "0"; + c[f + "transform"] = "translate(" + b.tX + "px," + b.tY + "px)"; + c[f + "filter"] = "none" + } + e(this).css("-webkit-transition", "all " + g + "ms " + a.easingFallback).css(c) + }); + l.each(function() { + var b = this.data; + b.tX = 0 != b.finalPrePos.left ? b.finalPrePos.left - b.preInterPos.left : 0; + b.tY = 0 != b.finalPrePos.left ? b.finalPrePos.top - b.preInterPos.top : 0; + for (var c = {}, d = 0; 2 > d; d++) { + var f = 0 == d ? f = a.prefix : ""; + c[f + "transition"] = + "all " + g + "ms " + a.easing; + c[f + "transform"] = "translate(" + b.tX + "px," + b.tY + "px)" + } + e(this).css("-webkit-transition", "all " + g + "ms " + a.easingFallback).css(c) + }); + b = {}; + for (c = 0; 2 > c; c++) d = 0 == c ? d = a.prefix : "", b[d + "transition"] = "all " + g + "ms " + a.easing + ", " + d + "filter " + g + "ms linear, opacity " + g + "ms linear", b[d + "transform"] = a.scale + " " + a.rotateX + " " + a.rotateY + " " + a.rotateZ, b[d + "filter"] = a.blur + " " + a.grayscale, b.opacity = a.fade; + t.css(b); + k.bind("webkitTransitionEnd transitionend otransitionend oTransitionEnd", function(a) { + if (-1 < + a.originalEvent.propertyName.indexOf("transform") || -1 < a.originalEvent.propertyName.indexOf("opacity")) - 1 < r.indexOf(".") ? e(a.target).hasClass(r.replace(".", "")) && j() : e(a.target).is(r) && j() + }) + }, 10); + a.failsafe = setTimeout(function() { + a.mixing && j() + }, g + 400) + } else { + a.resizeContainer && k.css("height", a.origHeight + "px"); + if (!window.atob) return j(), !1; + t = s; + setTimeout(function() { + k.css(a.perspective); + if (a.resizeContainer) { + for (var b = {}, d = 0; 2 > d; d++) { + var e = 0 == d ? e = a.prefix : ""; + b[e + "transition"] = "height " + g + "ms ease-in-out"; + b.height = a.minHeight + "px" + } + k.css(b) + } + u.css(a.transition); + if (s.length) { + b = {}; + for (d = 0; 2 > d; d++) e = 0 == d ? e = a.prefix : "", b[e + "transform"] = a.scale + " " + a.rotateX + " " + a.rotateY + " " + a.rotateZ, b[e + "filter"] = a.blur + " " + a.grayscale, b.opacity = a.fade; + t.css(b); + k.bind("webkitTransitionEnd transitionend otransitionend oTransitionEnd", function(b) { + if (-1 < b.originalEvent.propertyName.indexOf("transform") || -1 < b.originalEvent.propertyName.indexOf("opacity")) c.addClass(a.failClass), j() + }) + } else a.mixing = !1 + }, 10) + } + } + + function v(d, b, + h, c) { + function a(a, b) { + return 1 * a.attr(d).toLowerCase() < 1 * b.attr(d).toLowerCase() ? -1 : 1 * a.attr(d).toLowerCase() > 1 * b.attr(d).toLowerCase() ? 1 : 0 + } + + function j(a) { + "asc" == b ? f.prepend(a).prepend(" \ + ") : f.append(a).append(" \ + ") + } + h.find(c.targetSelector).wrapAll('
'); + var f = h.find(".mix_sorter"); + c.origSort.length || f.find(c.targetSelector + ":visible").each(function() { + e(this).wrap(""); + c.origSort.push(e(this).parent().html().replace(/\s+/g, "")); + e(this).unwrap() + }); + f.empty(); + if ("reset" == d) e.each(c.startOrder, + function() { + f.append(this).append(" \ + ") + }); + else if ("default" == d) e.each(c.origOrder, function() { + j(this) + }); + else if ("random" == d) { + if (!c.newOrder.length) { + for (var g = c.startOrder.slice(), n = g.length, r = n; r--;) { + var m = parseInt(Math.random() * n), + k = g[r]; + g[r] = g[m]; + g[m] = k + } + c.newOrder = g + } + e.each(c.newOrder, function() { + f.append(this).append(" \ + ") + }) + } else "custom" == d ? e.each(b, function() { + j(this) + }) : ("undefined" === typeof c.origOrder[0].attr(d) && console.log("No such attribute found. Terminating"), c.newOrder.length || (e.each(c.origOrder, + function() { + c.newOrder.push(e(this)) + }), c.newOrder.sort(a)), e.each(c.newOrder, function() { + j(this) + })); + c.checkSort = []; + f.find(c.targetSelector + ":visible").each(function(a) { + var b = e(this); + 0 == a && b.attr("data-checksum", "1"); + b.wrap(""); + c.checkSort.push(b.parent().html().replace(/\s+/g, "")); + b.unwrap() + }); + h.find(c.targetSelector).unwrap() + } + var w = { + init: function(d) { + return this.each(function() { + var b = { + targetSelector: ".mix", + filterSelector: ".filter", + sortSelector: ".sort", + buttonEvent: "click", + effects: ["fade", "scale"], + listEffects: null, + easing: "smooth", + layoutMode: "grid", + targetDisplayGrid: "inline-block", + targetDisplayList: "block", + listClass: "", + gridClass: "", + transitionSpeed: 600, + showOnLoad: "all", + multiFilter: !1, + filterLogic: "or", + resizeContainer: !0, + minHeight: 0, + failClass: "fail", + perspectiveDistance: "3000", + perspectiveOrigin: "50% 50%", + animateGridList: !0, + onMixLoad: null, + onMixStart: null, + onMixEnd: null, + container: null, + origOrder: [], + startOrder: [], + newOrder: [], + origSort: [], + checkSort: [], + filter: "", + mixing: !1, + origDisplay: "", + origLayout: "", + origHeight: 0, + newHeight: 0, + isTouch: !1, + resetDelay: 0, + failsafe: null, + prefix: "", + easingFallback: "ease-in-out", + transition: {}, + perspective: {}, + clean: {}, + fade: "1", + scale: "", + rotateX: "", + rotateY: "", + rotateZ: "", + blur: "", + grayscale: "" + }; + d && e.extend(b, d); + this.config = b; + e.support.touch = "ontouchend" in document; + e.support.touch && (b.isTouch = !0, b.resetDelay = 350); + b.container = e(this); + var h = b.container, + c; + a: { + c = h[0]; + for (var a = ["Webkit", "Moz", "O", "ms"], j = 0; j < a.length; j++) + if (a[j] + "Transition" in c.style) { + c = a[j]; + break a + } + c = "transition" in c.style ? "" : !1 + } + b.prefix = + c; + b.prefix = b.prefix ? "-" + b.prefix.toLowerCase() + "-" : ""; + h.find(b.targetSelector).each(function() { + b.origOrder.push(e(this)) + }); + for (c = 0; 2 > c; c++) a = 0 == c ? a = b.prefix : "", b.transition[a + "transition"] = "all " + b.transitionSpeed + "ms ease-in-out", b.perspective[a + "perspective"] = b.perspectiveDistance + "px", b.perspective[a + "perspective-origin"] = b.perspectiveOrigin; + for (c = 0; 2 > c; c++) a = 0 == c ? a = b.prefix : "", b.clean[a + "transition"] = "none"; + "list" == b.layoutMode ? (h.addClass(b.listClass), b.origDisplay = b.targetDisplayList) : (h.addClass(b.gridClass), + b.origDisplay = b.targetDisplayGrid); + b.origLayout = b.layoutMode; + c = b.showOnLoad.split(" "); + e.each(c, function() { + e(b.filterSelector + '[data-filter="' + this + '"]').addClass("active") + }); + h.find(b.targetSelector).addClass("mix_all"); + "all" == c[0] && (c[0] = "mix_all", b.showOnLoad = "mix_all"); + var f = e(); + e.each(c, function() { + f = f.add(e("." + this)) + }); + f.each(function() { + var a = e(this); + "list" == b.layoutMode ? a.css("display", b.targetDisplayList) : a.css("display", b.targetDisplayGrid); + a.css(b.transition) + }); + setTimeout(function() { + b.mixing = !0; + f.css("opacity", "1"); + setTimeout(function() { + "list" == b.layoutMode ? f.removeStyle(b.prefix + "transition, transition").css({ + display: b.targetDisplayList, + opacity: 1 + }) : f.removeStyle(b.prefix + "transition, transition").css({ + display: b.targetDisplayGrid, + opacity: 1 + }); + b.mixing = !1; + if ("function" == typeof b.onMixLoad) { + var a = b.onMixLoad.call(this, b); + b = a ? a : b + } + }, b.transitionSpeed) + }, 10); + b.filter = b.showOnLoad; + e(b.sortSelector).bind(b.buttonEvent, function() { + if (!b.mixing) { + var a = e(this), + c = a.attr("data-sort"), + d = a.attr("data-order"); + if (a.hasClass("active")) { + if ("random" != c) return !1 + } else e(b.sortSelector).removeClass("active"), a.addClass("active"); + h.find(b.targetSelector).each(function() { + b.startOrder.push(e(this)) + }); + m(b.filter, c, d, h, b) + } + }); + e(b.filterSelector).bind(b.buttonEvent, function() { + if (!b.mixing) { + var a = e(this); + if (!1 == b.multiFilter) e(b.filterSelector).removeClass("active"), a.addClass("active"), b.filter = a.attr("data-filter"), e(b.filterSelector + '[data-filter="' + b.filter + '"]').addClass("active"), "all" == b.filter && (b.filter = "mix_all"); + else { + var c = a.attr("data-filter"); + "all" == c && (c = "mix_all"); + a.hasClass("active") ? (a.removeClass("active"), b.filter = b.filter.replace(RegExp("(\\s|^)" + c), "")) : (a.addClass("active"), b.filter = b.filter + " " + c) + } + m(b.filter, null, null, h, b) + } + }) + }) + }, + toGrid: function() { + return this.each(function() { + var d = this.config; + "grid" != d.layoutMode && (d.layoutMode = "grid", m(d.filter, null, null, e(this), d)) + }) + }, + toList: function() { + return this.each(function() { + var d = this.config; + "list" != d.layoutMode && (d.layoutMode = "list", m(d.filter, null, null, + e(this), d)) + }) + }, + filter: function(d) { + return this.each(function() { + var b = this.config; + e(b.filterSelector).removeClass("active"); + e(b.filterSelector + '[data-filter="' + d + '"]').addClass("active"); + "all" == d && (d = "mix_all"); + b.mixing || (b.filter = d, m(d, null, null, e(this), b)) + }) + }, + sort: function(d) { + return this.each(function() { + var b = this.config; + if (e.isArray(d)) var h = d[0], + c = d[1]; + else h = d, c = "desc"; + b.mixing || (e(this).find(b.targetSelector).each(function() { + b.startOrder.push(e(this)) + }), m(b.filter, h, c, e(this), b)) + }) + } + }; + e.fn.mixitup = + function(d, b) { + if (w[d]) return w[d].apply(this, Array.prototype.slice.call(arguments, 1)); + if ("object" === typeof d || !d) return w.init.apply(this, arguments) + }; + e.fn.removeStyle = function(d) { + return this.each(function() { + var b = e(this); + d = d.replace(/\s+/g, ""); + var h = d.split(","); + e.each(h, function() { + var c = RegExp(this.toString() + "[^;]+;?", "g"); + b.attr("style", function(a, b) { + if (b) return b.replace(c, "") + }) + }) + }) + }; + Array.prototype.compare = function(d) { + if (this.length != d.length) return !1; + for (var b = 0; b < d.length; b++) + if (this[b].compare && + !this[b].compare(d[b]) || this[b] !== d[b]) return !1; + return !0 + } +})(jQuery); diff --git a/assets/js/plugins/owl-carousel/owl.carousel.js b/assets/js/plugins/owl-carousel/owl.carousel.js new file mode 100644 index 0000000..41427a3 --- /dev/null +++ b/assets/js/plugins/owl-carousel/owl.carousel.js @@ -0,0 +1,1512 @@ +/* + * jQuery OwlCarousel v1.3.3 + * + * Copyright (c) 2013 Bartosz Wojciechowski + * http://www.owlgraphic.com/owlcarousel/ + * + * Licensed under MIT + * + */ + +/*JS Lint helpers: */ +/*global dragMove: false, dragEnd: false, $, jQuery, alert, window, document */ +/*jslint nomen: true, continue:true */ + +if (typeof Object.create !== "function") { + Object.create = function (obj) { + function F() {} + F.prototype = obj; + return new F(); + }; +} +(function ($, window, document) { + + var Carousel = { + init : function (options, el) { + var base = this; + + base.$elem = $(el); + base.options = $.extend({}, $.fn.owlCarousel.options, base.$elem.data(), options); + + base.userOptions = options; + base.loadContent(); + }, + + loadContent : function () { + var base = this, url; + + function getData(data) { + var i, content = ""; + if (typeof base.options.jsonSuccess === "function") { + base.options.jsonSuccess.apply(this, [data]); + } else { + for (i in data.owl) { + if (data.owl.hasOwnProperty(i)) { + content += data.owl[i].item; + } + } + base.$elem.html(content); + } + base.logIn(); + } + + if (typeof base.options.beforeInit === "function") { + base.options.beforeInit.apply(this, [base.$elem]); + } + + if (typeof base.options.jsonPath === "string") { + url = base.options.jsonPath; + $.getJSON(url, getData); + } else { + base.logIn(); + } + }, + + logIn : function () { + var base = this; + + base.$elem.data("owl-originalStyles", base.$elem.attr("style")); + base.$elem.data("owl-originalClasses", base.$elem.attr("class")); + + base.$elem.css({opacity: 0}); + base.orignalItems = base.options.items; + base.checkBrowser(); + base.wrapperWidth = 0; + base.checkVisible = null; + base.setVars(); + }, + + setVars : function () { + var base = this; + if (base.$elem.children().length === 0) {return false; } + base.baseClass(); + base.eventTypes(); + base.$userItems = base.$elem.children(); + base.itemsAmount = base.$userItems.length; + base.wrapItems(); + base.$owlItems = base.$elem.find(".owl-item"); + base.$owlWrapper = base.$elem.find(".owl-wrapper"); + base.playDirection = "next"; + base.prevItem = 0; + base.prevArr = [0]; + base.currentItem = 0; + base.customEvents(); + base.onStartup(); + }, + + onStartup : function () { + var base = this; + base.updateItems(); + base.calculateAll(); + base.buildControls(); + base.updateControls(); + base.response(); + base.moveEvents(); + base.stopOnHover(); + base.owlStatus(); + + if (base.options.transitionStyle !== false) { + base.transitionTypes(base.options.transitionStyle); + } + if (base.options.autoPlay === true) { + base.options.autoPlay = 5000; + } + base.play(); + + base.$elem.find(".owl-wrapper").css("display", "block"); + + if (!base.$elem.is(":visible")) { + base.watchVisibility(); + } else { + base.$elem.css("opacity", 1); + } + base.onstartup = false; + base.eachMoveUpdate(); + if (typeof base.options.afterInit === "function") { + base.options.afterInit.apply(this, [base.$elem]); + } + }, + + eachMoveUpdate : function () { + var base = this; + + if (base.options.lazyLoad === true) { + base.lazyLoad(); + } + if (base.options.autoHeight === true) { + base.autoHeight(); + } + base.onVisibleItems(); + + if (typeof base.options.afterAction === "function") { + base.options.afterAction.apply(this, [base.$elem]); + } + }, + + updateVars : function () { + var base = this; + if (typeof base.options.beforeUpdate === "function") { + base.options.beforeUpdate.apply(this, [base.$elem]); + } + base.watchVisibility(); + base.updateItems(); + base.calculateAll(); + base.updatePosition(); + base.updateControls(); + base.eachMoveUpdate(); + if (typeof base.options.afterUpdate === "function") { + base.options.afterUpdate.apply(this, [base.$elem]); + } + }, + + reload : function () { + var base = this; + window.setTimeout(function () { + base.updateVars(); + }, 0); + }, + + watchVisibility : function () { + var base = this; + + if (base.$elem.is(":visible") === false) { + base.$elem.css({opacity: 0}); + window.clearInterval(base.autoPlayInterval); + window.clearInterval(base.checkVisible); + } else { + return false; + } + base.checkVisible = window.setInterval(function () { + if (base.$elem.is(":visible")) { + base.reload(); + base.$elem.animate({opacity: 1}, 200); + window.clearInterval(base.checkVisible); + } + }, 500); + }, + + wrapItems : function () { + var base = this; + base.$userItems.wrapAll("
").wrap("
"); + base.$elem.find(".owl-wrapper").wrap("
"); + base.wrapperOuter = base.$elem.find(".owl-wrapper-outer"); + base.$elem.css("display", "block"); + }, + + baseClass : function () { + var base = this, + hasBaseClass = base.$elem.hasClass(base.options.baseClass), + hasThemeClass = base.$elem.hasClass(base.options.theme); + + if (!hasBaseClass) { + base.$elem.addClass(base.options.baseClass); + } + + if (!hasThemeClass) { + base.$elem.addClass(base.options.theme); + } + }, + + updateItems : function () { + var base = this, width, i; + + if (base.options.responsive === false) { + return false; + } + if (base.options.singleItem === true) { + base.options.items = base.orignalItems = 1; + base.options.itemsCustom = false; + base.options.itemsDesktop = false; + base.options.itemsDesktopSmall = false; + base.options.itemsTablet = false; + base.options.itemsTabletSmall = false; + base.options.itemsMobile = false; + return false; + } + + width = $(base.options.responsiveBaseWidth).width(); + + if (width > (base.options.itemsDesktop[0] || base.orignalItems)) { + base.options.items = base.orignalItems; + } + if (base.options.itemsCustom !== false) { + //Reorder array by screen size + base.options.itemsCustom.sort(function (a, b) {return a[0] - b[0]; }); + + for (i = 0; i < base.options.itemsCustom.length; i += 1) { + if (base.options.itemsCustom[i][0] <= width) { + base.options.items = base.options.itemsCustom[i][1]; + } + } + + } else { + + if (width <= base.options.itemsDesktop[0] && base.options.itemsDesktop !== false) { + base.options.items = base.options.itemsDesktop[1]; + } + + if (width <= base.options.itemsDesktopSmall[0] && base.options.itemsDesktopSmall !== false) { + base.options.items = base.options.itemsDesktopSmall[1]; + } + + if (width <= base.options.itemsTablet[0] && base.options.itemsTablet !== false) { + base.options.items = base.options.itemsTablet[1]; + } + + if (width <= base.options.itemsTabletSmall[0] && base.options.itemsTabletSmall !== false) { + base.options.items = base.options.itemsTabletSmall[1]; + } + + if (width <= base.options.itemsMobile[0] && base.options.itemsMobile !== false) { + base.options.items = base.options.itemsMobile[1]; + } + } + + //if number of items is less than declared + if (base.options.items > base.itemsAmount && base.options.itemsScaleUp === true) { + base.options.items = base.itemsAmount; + } + }, + + response : function () { + var base = this, + smallDelay, + lastWindowWidth; + + if (base.options.responsive !== true) { + return false; + } + lastWindowWidth = $(window).width(); + + base.resizer = function () { + if ($(window).width() !== lastWindowWidth) { + if (base.options.autoPlay !== false) { + window.clearInterval(base.autoPlayInterval); + } + window.clearTimeout(smallDelay); + smallDelay = window.setTimeout(function () { + lastWindowWidth = $(window).width(); + base.updateVars(); + }, base.options.responsiveRefreshRate); + } + }; + $(window).resize(base.resizer); + }, + + updatePosition : function () { + var base = this; + base.jumpTo(base.currentItem); + if (base.options.autoPlay !== false) { + base.checkAp(); + } + }, + + appendItemsSizes : function () { + var base = this, + roundPages = 0, + lastItem = base.itemsAmount - base.options.items; + + base.$owlItems.each(function (index) { + var $this = $(this); + $this + .css({"width": base.itemWidth}) + .data("owl-item", Number(index)); + + if (index % base.options.items === 0 || index === lastItem) { + if (!(index > lastItem)) { + roundPages += 1; + } + } + $this.data("owl-roundPages", roundPages); + }); + }, + + appendWrapperSizes : function () { + var base = this, + width = base.$owlItems.length * base.itemWidth; + + base.$owlWrapper.css({ + "width": width * 2, + "left": 0 + }); + base.appendItemsSizes(); + }, + + calculateAll : function () { + var base = this; + base.calculateWidth(); + base.appendWrapperSizes(); + base.loops(); + base.max(); + }, + + calculateWidth : function () { + var base = this; + base.itemWidth = Math.round(base.$elem.width() / base.options.items); + }, + + max : function () { + var base = this, + maximum = ((base.itemsAmount * base.itemWidth) - base.options.items * base.itemWidth) * -1; + if (base.options.items > base.itemsAmount) { + base.maximumItem = 0; + maximum = 0; + base.maximumPixels = 0; + } else { + base.maximumItem = base.itemsAmount - base.options.items; + base.maximumPixels = maximum; + } + return maximum; + }, + + min : function () { + return 0; + }, + + loops : function () { + var base = this, + prev = 0, + elWidth = 0, + i, + item, + roundPageNum; + + base.positionsInArray = [0]; + base.pagesInArray = []; + + for (i = 0; i < base.itemsAmount; i += 1) { + elWidth += base.itemWidth; + base.positionsInArray.push(-elWidth); + + if (base.options.scrollPerPage === true) { + item = $(base.$owlItems[i]); + roundPageNum = item.data("owl-roundPages"); + if (roundPageNum !== prev) { + base.pagesInArray[prev] = base.positionsInArray[i]; + prev = roundPageNum; + } + } + } + }, + + buildControls : function () { + var base = this; + if (base.options.navigation === true || base.options.pagination === true) { + base.owlControls = $("
").toggleClass("clickable", !base.browser.isTouch).appendTo(base.$elem); + } + if (base.options.pagination === true) { + base.buildPagination(); + } + if (base.options.navigation === true) { + base.buildButtons(); + } + }, + + buildButtons : function () { + var base = this, + buttonsWrapper = $("
"); + base.owlControls.append(buttonsWrapper); + + base.buttonPrev = $("
", { + "class" : "owl-prev", + "html" : base.options.navigationText[0] || "" + }); + + base.buttonNext = $("
", { + "class" : "owl-next", + "html" : base.options.navigationText[1] || "" + }); + + buttonsWrapper + .append(base.buttonPrev) + .append(base.buttonNext); + + buttonsWrapper.on("touchstart.owlControls mousedown.owlControls", "div[class^=\"owl\"]", function (event) { + event.preventDefault(); + }); + + buttonsWrapper.on("touchend.owlControls mouseup.owlControls", "div[class^=\"owl\"]", function (event) { + event.preventDefault(); + if ($(this).hasClass("owl-next")) { + base.next(); + } else { + base.prev(); + } + }); + }, + + buildPagination : function () { + var base = this; + + base.paginationWrapper = $("
"); + base.owlControls.append(base.paginationWrapper); + + base.paginationWrapper.on("touchend.owlControls mouseup.owlControls", ".owl-page", function (event) { + event.preventDefault(); + if (Number($(this).data("owl-page")) !== base.currentItem) { + base.goTo(Number($(this).data("owl-page")), true); + } + }); + }, + + updatePagination : function () { + var base = this, + counter, + lastPage, + lastItem, + i, + paginationButton, + paginationButtonInner; + + if (base.options.pagination === false) { + return false; + } + + base.paginationWrapper.html(""); + + counter = 0; + lastPage = base.itemsAmount - base.itemsAmount % base.options.items; + + for (i = 0; i < base.itemsAmount; i += 1) { + if (i % base.options.items === 0) { + counter += 1; + if (lastPage === i) { + lastItem = base.itemsAmount - base.options.items; + } + paginationButton = $("
", { + "class" : "owl-page" + }); + paginationButtonInner = $("", { + "text": base.options.paginationNumbers === true ? counter : "", + "class": base.options.paginationNumbers === true ? "owl-numbers" : "" + }); + paginationButton.append(paginationButtonInner); + + paginationButton.data("owl-page", lastPage === i ? lastItem : i); + paginationButton.data("owl-roundPages", counter); + + base.paginationWrapper.append(paginationButton); + } + } + base.checkPagination(); + }, + checkPagination : function () { + var base = this; + if (base.options.pagination === false) { + return false; + } + base.paginationWrapper.find(".owl-page").each(function () { + if ($(this).data("owl-roundPages") === $(base.$owlItems[base.currentItem]).data("owl-roundPages")) { + base.paginationWrapper + .find(".owl-page") + .removeClass("active"); + $(this).addClass("active"); + } + }); + }, + + checkNavigation : function () { + var base = this; + + if (base.options.navigation === false) { + return false; + } + if (base.options.rewindNav === false) { + if (base.currentItem === 0 && base.maximumItem === 0) { + base.buttonPrev.addClass("disabled"); + base.buttonNext.addClass("disabled"); + } else if (base.currentItem === 0 && base.maximumItem !== 0) { + base.buttonPrev.addClass("disabled"); + base.buttonNext.removeClass("disabled"); + } else if (base.currentItem === base.maximumItem) { + base.buttonPrev.removeClass("disabled"); + base.buttonNext.addClass("disabled"); + } else if (base.currentItem !== 0 && base.currentItem !== base.maximumItem) { + base.buttonPrev.removeClass("disabled"); + base.buttonNext.removeClass("disabled"); + } + } + }, + + updateControls : function () { + var base = this; + base.updatePagination(); + base.checkNavigation(); + if (base.owlControls) { + if (base.options.items >= base.itemsAmount) { + base.owlControls.hide(); + } else { + base.owlControls.show(); + } + } + }, + + destroyControls : function () { + var base = this; + if (base.owlControls) { + base.owlControls.remove(); + } + }, + + next : function (speed) { + var base = this; + + if (base.isTransition) { + return false; + } + + base.currentItem += base.options.scrollPerPage === true ? base.options.items : 1; + if (base.currentItem > base.maximumItem + (base.options.scrollPerPage === true ? (base.options.items - 1) : 0)) { + if (base.options.rewindNav === true) { + base.currentItem = 0; + speed = "rewind"; + } else { + base.currentItem = base.maximumItem; + return false; + } + } + base.goTo(base.currentItem, speed); + }, + + prev : function (speed) { + var base = this; + + if (base.isTransition) { + return false; + } + + if (base.options.scrollPerPage === true && base.currentItem > 0 && base.currentItem < base.options.items) { + base.currentItem = 0; + } else { + base.currentItem -= base.options.scrollPerPage === true ? base.options.items : 1; + } + if (base.currentItem < 0) { + if (base.options.rewindNav === true) { + base.currentItem = base.maximumItem; + speed = "rewind"; + } else { + base.currentItem = 0; + return false; + } + } + base.goTo(base.currentItem, speed); + }, + + goTo : function (position, speed, drag) { + var base = this, + goToPixel; + + if (base.isTransition) { + return false; + } + if (typeof base.options.beforeMove === "function") { + base.options.beforeMove.apply(this, [base.$elem]); + } + if (position >= base.maximumItem) { + position = base.maximumItem; + } else if (position <= 0) { + position = 0; + } + + base.currentItem = base.owl.currentItem = position; + if (base.options.transitionStyle !== false && drag !== "drag" && base.options.items === 1 && base.browser.support3d === true) { + base.swapSpeed(0); + if (base.browser.support3d === true) { + base.transition3d(base.positionsInArray[position]); + } else { + base.css2slide(base.positionsInArray[position], 1); + } + base.afterGo(); + base.singleItemTransition(); + return false; + } + goToPixel = base.positionsInArray[position]; + + if (base.browser.support3d === true) { + base.isCss3Finish = false; + + if (speed === true) { + base.swapSpeed("paginationSpeed"); + window.setTimeout(function () { + base.isCss3Finish = true; + }, base.options.paginationSpeed); + + } else if (speed === "rewind") { + base.swapSpeed(base.options.rewindSpeed); + window.setTimeout(function () { + base.isCss3Finish = true; + }, base.options.rewindSpeed); + + } else { + base.swapSpeed("slideSpeed"); + window.setTimeout(function () { + base.isCss3Finish = true; + }, base.options.slideSpeed); + } + base.transition3d(goToPixel); + } else { + if (speed === true) { + base.css2slide(goToPixel, base.options.paginationSpeed); + } else if (speed === "rewind") { + base.css2slide(goToPixel, base.options.rewindSpeed); + } else { + base.css2slide(goToPixel, base.options.slideSpeed); + } + } + base.afterGo(); + }, + + jumpTo : function (position) { + var base = this; + if (typeof base.options.beforeMove === "function") { + base.options.beforeMove.apply(this, [base.$elem]); + } + if (position >= base.maximumItem || position === -1) { + position = base.maximumItem; + } else if (position <= 0) { + position = 0; + } + base.swapSpeed(0); + if (base.browser.support3d === true) { + base.transition3d(base.positionsInArray[position]); + } else { + base.css2slide(base.positionsInArray[position], 1); + } + base.currentItem = base.owl.currentItem = position; + base.afterGo(); + }, + + afterGo : function () { + var base = this; + + base.prevArr.push(base.currentItem); + base.prevItem = base.owl.prevItem = base.prevArr[base.prevArr.length - 2]; + base.prevArr.shift(0); + + if (base.prevItem !== base.currentItem) { + base.checkPagination(); + base.checkNavigation(); + base.eachMoveUpdate(); + + if (base.options.autoPlay !== false) { + base.checkAp(); + } + } + if (typeof base.options.afterMove === "function" && base.prevItem !== base.currentItem) { + base.options.afterMove.apply(this, [base.$elem]); + } + }, + + stop : function () { + var base = this; + base.apStatus = "stop"; + window.clearInterval(base.autoPlayInterval); + }, + + checkAp : function () { + var base = this; + if (base.apStatus !== "stop") { + base.play(); + } + }, + + play : function () { + var base = this; + base.apStatus = "play"; + if (base.options.autoPlay === false) { + return false; + } + window.clearInterval(base.autoPlayInterval); + base.autoPlayInterval = window.setInterval(function () { + base.next(true); + }, base.options.autoPlay); + }, + + swapSpeed : function (action) { + var base = this; + if (action === "slideSpeed") { + base.$owlWrapper.css(base.addCssSpeed(base.options.slideSpeed)); + } else if (action === "paginationSpeed") { + base.$owlWrapper.css(base.addCssSpeed(base.options.paginationSpeed)); + } else if (typeof action !== "string") { + base.$owlWrapper.css(base.addCssSpeed(action)); + } + }, + + addCssSpeed : function (speed) { + return { + "-webkit-transition": "all " + speed + "ms ease", + "-moz-transition": "all " + speed + "ms ease", + "-o-transition": "all " + speed + "ms ease", + "transition": "all " + speed + "ms ease" + }; + }, + + removeTransition : function () { + return { + "-webkit-transition": "", + "-moz-transition": "", + "-o-transition": "", + "transition": "" + }; + }, + + doTranslate : function (pixels) { + return { + "-webkit-transform": "translate3d(" + pixels + "px, 0px, 0px)", + "-moz-transform": "translate3d(" + pixels + "px, 0px, 0px)", + "-o-transform": "translate3d(" + pixels + "px, 0px, 0px)", + "-ms-transform": "translate3d(" + pixels + "px, 0px, 0px)", + "transform": "translate3d(" + pixels + "px, 0px,0px)" + }; + }, + + transition3d : function (value) { + var base = this; + base.$owlWrapper.css(base.doTranslate(value)); + }, + + css2move : function (value) { + var base = this; + base.$owlWrapper.css({"left" : value}); + }, + + css2slide : function (value, speed) { + var base = this; + + base.isCssFinish = false; + base.$owlWrapper.stop(true, true).animate({ + "left" : value + }, { + duration : speed || base.options.slideSpeed, + complete : function () { + base.isCssFinish = true; + } + }); + }, + + checkBrowser : function () { + var base = this, + translate3D = "translate3d(0px, 0px, 0px)", + tempElem = document.createElement("div"), + regex, + asSupport, + support3d, + isTouch; + + tempElem.style.cssText = " -moz-transform:" + translate3D + + "; -ms-transform:" + translate3D + + "; -o-transform:" + translate3D + + "; -webkit-transform:" + translate3D + + "; transform:" + translate3D; + regex = /translate3d\(0px, 0px, 0px\)/g; + asSupport = tempElem.style.cssText.match(regex); + support3d = (asSupport !== null && asSupport.length !== 0); + + isTouch = "ontouchstart" in window || window.navigator.msMaxTouchPoints; + + base.browser = { + "support3d" : support3d, + "isTouch" : isTouch + }; + }, + + moveEvents : function () { + var base = this; + if (base.options.mouseDrag !== false || base.options.touchDrag !== false) { + base.gestures(); + base.disabledEvents(); + } + }, + + eventTypes : function () { + var base = this, + types = ["s", "e", "x"]; + + base.ev_types = {}; + + if (base.options.mouseDrag === true && base.options.touchDrag === true) { + types = [ + "touchstart.owl mousedown.owl", + "touchmove.owl mousemove.owl", + "touchend.owl touchcancel.owl mouseup.owl" + ]; + } else if (base.options.mouseDrag === false && base.options.touchDrag === true) { + types = [ + "touchstart.owl", + "touchmove.owl", + "touchend.owl touchcancel.owl" + ]; + } else if (base.options.mouseDrag === true && base.options.touchDrag === false) { + types = [ + "mousedown.owl", + "mousemove.owl", + "mouseup.owl" + ]; + } + + base.ev_types.start = types[0]; + base.ev_types.move = types[1]; + base.ev_types.end = types[2]; + }, + + disabledEvents : function () { + var base = this; + base.$elem.on("dragstart.owl", function (event) { event.preventDefault(); }); + base.$elem.on("mousedown.disableTextSelect", function (e) { + return $(e.target).is('input, textarea, select, option'); + }); + }, + + gestures : function () { + /*jslint unparam: true*/ + var base = this, + locals = { + offsetX : 0, + offsetY : 0, + baseElWidth : 0, + relativePos : 0, + position: null, + minSwipe : null, + maxSwipe: null, + sliding : null, + dargging: null, + targetElement : null + }; + + base.isCssFinish = true; + + function getTouches(event) { + if (event.touches !== undefined) { + return { + x : event.touches[0].pageX, + y : event.touches[0].pageY + }; + } + + if (event.touches === undefined) { + if (event.pageX !== undefined) { + return { + x : event.pageX, + y : event.pageY + }; + } + if (event.pageX === undefined) { + return { + x : event.clientX, + y : event.clientY + }; + } + } + } + + function swapEvents(type) { + if (type === "on") { + $(document).on(base.ev_types.move, dragMove); + $(document).on(base.ev_types.end, dragEnd); + } else if (type === "off") { + $(document).off(base.ev_types.move); + $(document).off(base.ev_types.end); + } + } + + function dragStart(event) { + var ev = event.originalEvent || event || window.event, + position; + + if (ev.which === 3) { + return false; + } + if (base.itemsAmount <= base.options.items) { + return; + } + if (base.isCssFinish === false && !base.options.dragBeforeAnimFinish) { + return false; + } + if (base.isCss3Finish === false && !base.options.dragBeforeAnimFinish) { + return false; + } + + if (base.options.autoPlay !== false) { + window.clearInterval(base.autoPlayInterval); + } + + if (base.browser.isTouch !== true && !base.$owlWrapper.hasClass("grabbing")) { + base.$owlWrapper.addClass("grabbing"); + } + + base.newPosX = 0; + base.newRelativeX = 0; + + $(this).css(base.removeTransition()); + + position = $(this).position(); + locals.relativePos = position.left; + + locals.offsetX = getTouches(ev).x - position.left; + locals.offsetY = getTouches(ev).y - position.top; + + swapEvents("on"); + + locals.sliding = false; + locals.targetElement = ev.target || ev.srcElement; + } + + function dragMove(event) { + var ev = event.originalEvent || event || window.event, + minSwipe, + maxSwipe; + + base.newPosX = getTouches(ev).x - locals.offsetX; + base.newPosY = getTouches(ev).y - locals.offsetY; + base.newRelativeX = base.newPosX - locals.relativePos; + + if (typeof base.options.startDragging === "function" && locals.dragging !== true && base.newRelativeX !== 0) { + locals.dragging = true; + base.options.startDragging.apply(base, [base.$elem]); + } + + if ((base.newRelativeX > 8 || base.newRelativeX < -8) && (base.browser.isTouch === true)) { + if (ev.preventDefault !== undefined) { + ev.preventDefault(); + } else { + ev.returnValue = false; + } + locals.sliding = true; + } + + if ((base.newPosY > 10 || base.newPosY < -10) && locals.sliding === false) { + $(document).off("touchmove.owl"); + } + + minSwipe = function () { + return base.newRelativeX / 5; + }; + + maxSwipe = function () { + return base.maximumPixels + base.newRelativeX / 5; + }; + + base.newPosX = Math.max(Math.min(base.newPosX, minSwipe()), maxSwipe()); + if (base.browser.support3d === true) { + base.transition3d(base.newPosX); + } else { + base.css2move(base.newPosX); + } + } + + function dragEnd(event) { + var ev = event.originalEvent || event || window.event, + newPosition, + handlers, + owlStopEvent; + + ev.target = ev.target || ev.srcElement; + + locals.dragging = false; + + if (base.browser.isTouch !== true) { + base.$owlWrapper.removeClass("grabbing"); + } + + if (base.newRelativeX < 0) { + base.dragDirection = base.owl.dragDirection = "left"; + } else { + base.dragDirection = base.owl.dragDirection = "right"; + } + + if (base.newRelativeX !== 0) { + newPosition = base.getNewPosition(); + base.goTo(newPosition, false, "drag"); + if (locals.targetElement === ev.target && base.browser.isTouch !== true) { + $(ev.target).on("click.disable", function (ev) { + ev.stopImmediatePropagation(); + ev.stopPropagation(); + ev.preventDefault(); + $(ev.target).off("click.disable"); + }); + handlers = $._data(ev.target, "events").click; + owlStopEvent = handlers.pop(); + handlers.splice(0, 0, owlStopEvent); + } + } + swapEvents("off"); + } + base.$elem.on(base.ev_types.start, ".owl-wrapper", dragStart); + }, + + getNewPosition : function () { + var base = this, + newPosition = base.closestItem(); + + if (newPosition > base.maximumItem) { + base.currentItem = base.maximumItem; + newPosition = base.maximumItem; + } else if (base.newPosX >= 0) { + newPosition = 0; + base.currentItem = 0; + } + return newPosition; + }, + closestItem : function () { + var base = this, + array = base.options.scrollPerPage === true ? base.pagesInArray : base.positionsInArray, + goal = base.newPosX, + closest = null; + + $.each(array, function (i, v) { + if (goal - (base.itemWidth / 20) > array[i + 1] && goal - (base.itemWidth / 20) < v && base.moveDirection() === "left") { + closest = v; + if (base.options.scrollPerPage === true) { + base.currentItem = $.inArray(closest, base.positionsInArray); + } else { + base.currentItem = i; + } + } else if (goal + (base.itemWidth / 20) < v && goal + (base.itemWidth / 20) > (array[i + 1] || array[i] - base.itemWidth) && base.moveDirection() === "right") { + if (base.options.scrollPerPage === true) { + closest = array[i + 1] || array[array.length - 1]; + base.currentItem = $.inArray(closest, base.positionsInArray); + } else { + closest = array[i + 1]; + base.currentItem = i + 1; + } + } + }); + return base.currentItem; + }, + + moveDirection : function () { + var base = this, + direction; + if (base.newRelativeX < 0) { + direction = "right"; + base.playDirection = "next"; + } else { + direction = "left"; + base.playDirection = "prev"; + } + return direction; + }, + + customEvents : function () { + /*jslint unparam: true*/ + var base = this; + base.$elem.on("owl.next", function () { + base.next(); + }); + base.$elem.on("owl.prev", function () { + base.prev(); + }); + base.$elem.on("owl.play", function (event, speed) { + base.options.autoPlay = speed; + base.play(); + base.hoverStatus = "play"; + }); + base.$elem.on("owl.stop", function () { + base.stop(); + base.hoverStatus = "stop"; + }); + base.$elem.on("owl.goTo", function (event, item) { + base.goTo(item); + }); + base.$elem.on("owl.jumpTo", function (event, item) { + base.jumpTo(item); + }); + }, + + stopOnHover : function () { + var base = this; + if (base.options.stopOnHover === true && base.browser.isTouch !== true && base.options.autoPlay !== false) { + base.$elem.on("mouseover", function () { + base.stop(); + }); + base.$elem.on("mouseout", function () { + if (base.hoverStatus !== "stop") { + base.play(); + } + }); + } + }, + + lazyLoad : function () { + var base = this, + i, + $item, + itemNumber, + $lazyImg, + follow; + + if (base.options.lazyLoad === false) { + return false; + } + for (i = 0; i < base.itemsAmount; i += 1) { + $item = $(base.$owlItems[i]); + + if ($item.data("owl-loaded") === "loaded") { + continue; + } + + itemNumber = $item.data("owl-item"); + $lazyImg = $item.find(".lazyOwl"); + + if (typeof $lazyImg.data("src") !== "string") { + $item.data("owl-loaded", "loaded"); + continue; + } + if ($item.data("owl-loaded") === undefined) { + $lazyImg.hide(); + $item.addClass("loading").data("owl-loaded", "checked"); + } + if (base.options.lazyFollow === true) { + follow = itemNumber >= base.currentItem; + } else { + follow = true; + } + if (follow && itemNumber < base.currentItem + base.options.items && $lazyImg.length) { + base.lazyPreload($item, $lazyImg); + } + } + }, + + lazyPreload : function ($item, $lazyImg) { + var base = this, + iterations = 0, + isBackgroundImg; + + if ($lazyImg.prop("tagName") === "DIV") { + $lazyImg.css("background-image", "url(" + $lazyImg.data("src") + ")"); + isBackgroundImg = true; + } else { + $lazyImg[0].src = $lazyImg.data("src"); + } + + function showImage() { + $item.data("owl-loaded", "loaded").removeClass("loading"); + $lazyImg.removeAttr("data-src"); + if (base.options.lazyEffect === "fade") { + $lazyImg.fadeIn(400); + } else { + $lazyImg.show(); + } + if (typeof base.options.afterLazyLoad === "function") { + base.options.afterLazyLoad.apply(this, [base.$elem]); + } + } + + function checkLazyImage() { + iterations += 1; + if (base.completeImg($lazyImg.get(0)) || isBackgroundImg === true) { + showImage(); + } else if (iterations <= 100) {//if image loads in less than 10 seconds + window.setTimeout(checkLazyImage, 100); + } else { + showImage(); + } + } + + checkLazyImage(); + }, + + autoHeight : function () { + var base = this, + $currentimg = $(base.$owlItems[base.currentItem]).find("img"), + iterations; + + function addHeight() { + var $currentItem = $(base.$owlItems[base.currentItem]).height(); + base.wrapperOuter.css("height", $currentItem + "px"); + if (!base.wrapperOuter.hasClass("autoHeight")) { + window.setTimeout(function () { + base.wrapperOuter.addClass("autoHeight"); + }, 0); + } + } + + function checkImage() { + iterations += 1; + if (base.completeImg($currentimg.get(0))) { + addHeight(); + } else if (iterations <= 100) { //if image loads in less than 10 seconds + window.setTimeout(checkImage, 100); + } else { + base.wrapperOuter.css("height", ""); //Else remove height attribute + } + } + + if ($currentimg.get(0) !== undefined) { + iterations = 0; + checkImage(); + } else { + addHeight(); + } + }, + + completeImg : function (img) { + var naturalWidthType; + + if (!img.complete) { + return false; + } + naturalWidthType = typeof img.naturalWidth; + if (naturalWidthType !== "undefined" && img.naturalWidth === 0) { + return false; + } + return true; + }, + + onVisibleItems : function () { + var base = this, + i; + + if (base.options.addClassActive === true) { + base.$owlItems.removeClass("active"); + } + base.visibleItems = []; + for (i = base.currentItem; i < base.currentItem + base.options.items; i += 1) { + base.visibleItems.push(i); + + if (base.options.addClassActive === true) { + $(base.$owlItems[i]).addClass("active"); + } + } + base.owl.visibleItems = base.visibleItems; + }, + + transitionTypes : function (className) { + var base = this; + //Currently available: "fade", "backSlide", "goDown", "fadeUp" + base.outClass = "owl-" + className + "-out"; + base.inClass = "owl-" + className + "-in"; + }, + + singleItemTransition : function () { + var base = this, + outClass = base.outClass, + inClass = base.inClass, + $currentItem = base.$owlItems.eq(base.currentItem), + $prevItem = base.$owlItems.eq(base.prevItem), + prevPos = Math.abs(base.positionsInArray[base.currentItem]) + base.positionsInArray[base.prevItem], + origin = Math.abs(base.positionsInArray[base.currentItem]) + base.itemWidth / 2, + animEnd = 'webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend'; + + base.isTransition = true; + + base.$owlWrapper + .addClass('owl-origin') + .css({ + "-webkit-transform-origin" : origin + "px", + "-moz-perspective-origin" : origin + "px", + "perspective-origin" : origin + "px" + }); + function transStyles(prevPos) { + return { + "position" : "relative", + "left" : prevPos + "px" + }; + } + + $prevItem + .css(transStyles(prevPos, 10)) + .addClass(outClass) + .on(animEnd, function () { + base.endPrev = true; + $prevItem.off(animEnd); + base.clearTransStyle($prevItem, outClass); + }); + + $currentItem + .addClass(inClass) + .on(animEnd, function () { + base.endCurrent = true; + $currentItem.off(animEnd); + base.clearTransStyle($currentItem, inClass); + }); + }, + + clearTransStyle : function (item, classToRemove) { + var base = this; + item.css({ + "position" : "", + "left" : "" + }).removeClass(classToRemove); + + if (base.endPrev && base.endCurrent) { + base.$owlWrapper.removeClass('owl-origin'); + base.endPrev = false; + base.endCurrent = false; + base.isTransition = false; + } + }, + + owlStatus : function () { + var base = this; + base.owl = { + "userOptions" : base.userOptions, + "baseElement" : base.$elem, + "userItems" : base.$userItems, + "owlItems" : base.$owlItems, + "currentItem" : base.currentItem, + "prevItem" : base.prevItem, + "visibleItems" : base.visibleItems, + "isTouch" : base.browser.isTouch, + "browser" : base.browser, + "dragDirection" : base.dragDirection + }; + }, + + clearEvents : function () { + var base = this; + base.$elem.off(".owl owl mousedown.disableTextSelect"); + $(document).off(".owl owl"); + $(window).off("resize", base.resizer); + }, + + unWrap : function () { + var base = this; + if (base.$elem.children().length !== 0) { + base.$owlWrapper.unwrap(); + base.$userItems.unwrap().unwrap(); + if (base.owlControls) { + base.owlControls.remove(); + } + } + base.clearEvents(); + base.$elem + .attr("style", base.$elem.data("owl-originalStyles") || "") + .attr("class", base.$elem.data("owl-originalClasses")); + }, + + destroy : function () { + var base = this; + base.stop(); + window.clearInterval(base.checkVisible); + base.unWrap(); + base.$elem.removeData(); + }, + + reinit : function (newOptions) { + var base = this, + options = $.extend({}, base.userOptions, newOptions); + base.unWrap(); + base.init(options, base.$elem); + }, + + addItem : function (htmlString, targetPosition) { + var base = this, + position; + + if (!htmlString) {return false; } + + if (base.$elem.children().length === 0) { + base.$elem.append(htmlString); + base.setVars(); + return false; + } + base.unWrap(); + if (targetPosition === undefined || targetPosition === -1) { + position = -1; + } else { + position = targetPosition; + } + if (position >= base.$userItems.length || position === -1) { + base.$userItems.eq(-1).after(htmlString); + } else { + base.$userItems.eq(position).before(htmlString); + } + + base.setVars(); + }, + + removeItem : function (targetPosition) { + var base = this, + position; + + if (base.$elem.children().length === 0) { + return false; + } + if (targetPosition === undefined || targetPosition === -1) { + position = -1; + } else { + position = targetPosition; + } + + base.unWrap(); + base.$userItems.eq(position).remove(); + base.setVars(); + } + + }; + + $.fn.owlCarousel = function (options) { + return this.each(function () { + if ($(this).data("owl-init") === true) { + return false; + } + $(this).data("owl-init", true); + var carousel = Object.create(Carousel); + carousel.init(options, this); + $.data(this, "owlCarousel", carousel); + }); + }; + + $.fn.owlCarousel.options = { + + items : 5, + itemsCustom : false, + itemsDesktop : [1199, 4], + itemsDesktopSmall : [979, 3], + itemsTablet : [768, 2], + itemsTabletSmall : false, + itemsMobile : [479, 1], + singleItem : false, + itemsScaleUp : false, + + slideSpeed : 200, + paginationSpeed : 800, + rewindSpeed : 1000, + + autoPlay : false, + stopOnHover : false, + + navigation : false, + navigationText : ["prev", "next"], + rewindNav : true, + scrollPerPage : false, + + pagination : true, + paginationNumbers : false, + + responsive : true, + responsiveRefreshRate : 200, + responsiveBaseWidth : window, + + baseClass : "owl-carousel", + theme : "owl-theme", + + lazyLoad : false, + lazyFollow : true, + lazyEffect : "fade", + + autoHeight : false, + + jsonPath : false, + jsonSuccess : false, + + dragBeforeAnimFinish : true, + mouseDrag : true, + touchDrag : true, + + addClassActive : false, + transitionStyle : false, + + beforeUpdate : false, + afterUpdate : false, + beforeInit : false, + afterInit : false, + beforeMove : false, + afterMove : false, + afterAction : false, + startDragging : false, + afterLazyLoad: false + }; +}(jQuery, window, document)); \ No newline at end of file diff --git a/assets/js/plugins/retina/retina.js b/assets/js/plugins/retina/retina.js new file mode 100644 index 0000000..7646e0b --- /dev/null +++ b/assets/js/plugins/retina/retina.js @@ -0,0 +1,182 @@ +/*! + * Retina.js v1.3.0 + * + * Copyright 2014 Imulus, LLC + * Released under the MIT license + * + * Retina.js is an open source script that makes it easy to serve + * high-resolution images to devices with retina displays. + */ + +(function() { + var root = (typeof exports === 'undefined' ? window : exports); + var config = { + // An option to choose a suffix for 2x images + retinaImageSuffix : '@2x', + + // Ensure Content-Type is an image before trying to load @2x image + // https://github.com/imulus/retinajs/pull/45) + check_mime_type: true, + + // Resize high-resolution images to original image's pixel dimensions + // https://github.com/imulus/retinajs/issues/8 + force_original_dimensions: true + }; + + function Retina() {} + + root.Retina = Retina; + + Retina.configure = function(options) { + if (options === null) { + options = {}; + } + + for (var prop in options) { + if (options.hasOwnProperty(prop)) { + config[prop] = options[prop]; + } + } + }; + + Retina.init = function(context) { + if (context === null) { + context = root; + } + + var existing_onload = context.onload || function(){}; + + context.onload = function() { + var images = document.getElementsByTagName('img'), retinaImages = [], i, image; + for (i = 0; i < images.length; i += 1) { + image = images[i]; + if (!!!image.getAttributeNode('data-no-retina')) { + retinaImages.push(new RetinaImage(image)); + } + } + existing_onload(); + }; + }; + + Retina.isRetina = function(){ + var mediaQuery = '(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)'; + + if (root.devicePixelRatio > 1) { + return true; + } + + if (root.matchMedia && root.matchMedia(mediaQuery).matches) { + return true; + } + + return false; + }; + + + var regexMatch = /\.\w+$/; + function suffixReplace (match) { + return config.retinaImageSuffix + match; + } + + function RetinaImagePath(path, at_2x_path) { + this.path = path || ''; + if (typeof at_2x_path !== 'undefined' && at_2x_path !== null) { + this.at_2x_path = at_2x_path; + this.perform_check = false; + } else { + if (undefined !== document.createElement) { + var locationObject = document.createElement('a'); + locationObject.href = this.path; + locationObject.pathname = locationObject.pathname.replace(regexMatch, suffixReplace); + this.at_2x_path = locationObject.href; + } else { + var parts = this.path.split('?'); + parts[0] = parts[0].replace(regexMatch, suffixReplace); + this.at_2x_path = parts.join('?'); + } + this.perform_check = true; + } + } + + root.RetinaImagePath = RetinaImagePath; + + RetinaImagePath.confirmed_paths = []; + + RetinaImagePath.prototype.is_external = function() { + return !!(this.path.match(/^https?\:/i) && !this.path.match('//' + document.domain) ); + }; + + RetinaImagePath.prototype.check_2x_variant = function(callback) { + var http, that = this; + if (this.is_external()) { + return callback(false); + } else if (!this.perform_check && typeof this.at_2x_path !== 'undefined' && this.at_2x_path !== null) { + return callback(true); + } else if (this.at_2x_path in RetinaImagePath.confirmed_paths) { + return callback(true); + } else { + http = new XMLHttpRequest(); + http.open('HEAD', this.at_2x_path); + http.onreadystatechange = function() { + if (http.readyState !== 4) { + return callback(false); + } + + if (http.status >= 200 && http.status <= 399) { + if (config.check_mime_type) { + var type = http.getResponseHeader('Content-Type'); + if (type === null || !type.match(/^image/i)) { + return callback(false); + } + } + + RetinaImagePath.confirmed_paths.push(that.at_2x_path); + return callback(true); + } else { + return callback(false); + } + }; + http.send(); + } + }; + + + function RetinaImage(el) { + this.el = el; + this.path = new RetinaImagePath(this.el.getAttribute('src'), this.el.getAttribute('data-at2x')); + var that = this; + this.path.check_2x_variant(function(hasVariant) { + if (hasVariant) { + that.swap(); + } + }); + } + + root.RetinaImage = RetinaImage; + + RetinaImage.prototype.swap = function(path) { + if (typeof path === 'undefined') { + path = this.path.at_2x_path; + } + + var that = this; + function load() { + if (! that.el.complete) { + setTimeout(load, 5); + } else { + if (config.force_original_dimensions) { + that.el.setAttribute('width', that.el.offsetWidth); + that.el.setAttribute('height', that.el.offsetHeight); + } + + that.el.setAttribute('src', path); + } + } + load(); + }; + + + if (Retina.isRetina()) { + Retina.init(root); + } +})(); diff --git a/assets/js/plugins/retina/retina.min.js b/assets/js/plugins/retina/retina.min.js new file mode 100644 index 0000000..da0a60d --- /dev/null +++ b/assets/js/plugins/retina/retina.min.js @@ -0,0 +1,10 @@ +/*! + * Retina.js v1.3.0 + * + * Copyright 2014 Imulus, LLC + * Released under the MIT license + * + * Retina.js is an open source script that makes it easy to serve + * high-resolution images to devices with retina displays. + */ +!function(){function a(){}function b(a){return f.retinaImageSuffix+a}function c(a,c){if(this.path=a||"","undefined"!=typeof c&&null!==c)this.at_2x_path=c,this.perform_check=!1;else{if(void 0!==document.createElement){var d=document.createElement("a");d.href=this.path,d.pathname=d.pathname.replace(g,b),this.at_2x_path=d.href}else{var e=this.path.split("?");e[0]=e[0].replace(g,b),this.at_2x_path=e.join("?")}this.perform_check=!0}}function d(a){this.el=a,this.path=new c(this.el.getAttribute("src"),this.el.getAttribute("data-at2x"));var b=this;this.path.check_2x_variant(function(a){a&&b.swap()})}var e="undefined"==typeof exports?window:exports,f={retinaImageSuffix:"@2x",check_mime_type:!0,force_original_dimensions:!0};e.Retina=a,a.configure=function(a){null===a&&(a={});for(var b in a)a.hasOwnProperty(b)&&(f[b]=a[b])},a.init=function(a){null===a&&(a=e);var b=a.onload||function(){};a.onload=function(){var a,c,e=document.getElementsByTagName("img"),f=[];for(a=0;a1?!0:e.matchMedia&&e.matchMedia(a).matches?!0:!1};var g=/\.\w+$/;e.RetinaImagePath=c,c.confirmed_paths=[],c.prototype.is_external=function(){return!(!this.path.match(/^https?\:/i)||this.path.match("//"+document.domain))},c.prototype.check_2x_variant=function(a){var b,d=this;return this.is_external()?a(!1):this.perform_check||"undefined"==typeof this.at_2x_path||null===this.at_2x_path?this.at_2x_path in c.confirmed_paths?a(!0):(b=new XMLHttpRequest,b.open("HEAD",this.at_2x_path),b.onreadystatechange=function(){if(4!==b.readyState)return a(!1);if(b.status>=200&&b.status<=399){if(f.check_mime_type){var e=b.getResponseHeader("Content-Type");if(null===e||!e.match(/^image/i))return a(!1)}return c.confirmed_paths.push(d.at_2x_path),a(!0)}return a(!1)},b.send(),void 0):a(!0)},e.RetinaImage=d,d.prototype.swap=function(a){function b(){c.el.complete?(f.force_original_dimensions&&(c.el.setAttribute("width",c.el.offsetWidth),c.el.setAttribute("height",c.el.offsetHeight)),c.el.setAttribute("src",a)):setTimeout(b,5)}"undefined"==typeof a&&(a=this.path.at_2x_path);var c=this;b()},a.isRetina()&&a.init(e)}(); \ No newline at end of file diff --git a/assets/js/plugins/wow/wow.js b/assets/js/plugins/wow/wow.js new file mode 100644 index 0000000..d71bafb --- /dev/null +++ b/assets/js/plugins/wow/wow.js @@ -0,0 +1,456 @@ +(function() { + var MutationObserver, Util, WeakMap, getComputedStyle, getComputedStyleRX, + __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; + + Util = (function() { + function Util() {} + + Util.prototype.extend = function(custom, defaults) { + var key, value; + for (key in defaults) { + value = defaults[key]; + if (custom[key] == null) { + custom[key] = value; + } + } + return custom; + }; + + Util.prototype.isMobile = function(agent) { + return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(agent); + }; + + Util.prototype.addEvent = function(elem, event, fn) { + if (elem.addEventListener != null) { + return elem.addEventListener(event, fn, false); + } else if (elem.attachEvent != null) { + return elem.attachEvent("on" + event, fn); + } else { + return elem[event] = fn; + } + }; + + Util.prototype.removeEvent = function(elem, event, fn) { + if (elem.removeEventListener != null) { + return elem.removeEventListener(event, fn, false); + } else if (elem.detachEvent != null) { + return elem.detachEvent("on" + event, fn); + } else { + return delete elem[event]; + } + }; + + Util.prototype.innerHeight = function() { + if ('innerHeight' in window) { + return window.innerHeight; + } else { + return document.documentElement.clientHeight; + } + }; + + return Util; + + })(); + + WeakMap = this.WeakMap || this.MozWeakMap || (WeakMap = (function() { + function WeakMap() { + this.keys = []; + this.values = []; + } + + WeakMap.prototype.get = function(key) { + var i, item, _i, _len, _ref; + _ref = this.keys; + for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { + item = _ref[i]; + if (item === key) { + return this.values[i]; + } + } + }; + + WeakMap.prototype.set = function(key, value) { + var i, item, _i, _len, _ref; + _ref = this.keys; + for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { + item = _ref[i]; + if (item === key) { + this.values[i] = value; + return; + } + } + this.keys.push(key); + return this.values.push(value); + }; + + return WeakMap; + + })()); + + MutationObserver = this.MutationObserver || this.WebkitMutationObserver || this.MozMutationObserver || (MutationObserver = (function() { + function MutationObserver() { + if (typeof console !== "undefined" && console !== null) { + console.warn('MutationObserver is not supported by your browser.'); + } + if (typeof console !== "undefined" && console !== null) { + console.warn('WOW.js cannot detect dom mutations, please call .sync() after loading new content.'); + } + } + + MutationObserver.notSupported = true; + + MutationObserver.prototype.observe = function() {}; + + return MutationObserver; + + })()); + + getComputedStyle = this.getComputedStyle || function(el, pseudo) { + this.getPropertyValue = function(prop) { + var _ref; + if (prop === 'float') { + prop = 'styleFloat'; + } + if (getComputedStyleRX.test(prop)) { + prop.replace(getComputedStyleRX, function(_, char) { + return char.toUpperCase(); + }); + } + return ((_ref = el.currentStyle) != null ? _ref[prop] : void 0) || null; + }; + return this; + }; + + getComputedStyleRX = /(\-([a-z]){1})/g; + + this.WOW = (function() { + WOW.prototype.defaults = { + boxClass: 'wow', + animateClass: 'animated', + offset: 0, + mobile: true, + live: true + }; + + function WOW(options) { + if (options == null) { + options = {}; + } + this.scrollCallback = __bind(this.scrollCallback, this); + this.scrollHandler = __bind(this.scrollHandler, this); + this.start = __bind(this.start, this); + this.scrolled = true; + this.config = this.util().extend(options, this.defaults); + this.animationNameCache = new WeakMap(); + } + + WOW.prototype.init = function() { + var _ref; + this.element = window.document.documentElement; + if ((_ref = document.readyState) === "interactive" || _ref === "complete") { + this.start(); + } else { + this.util().addEvent(document, 'DOMContentLoaded', this.start); + } + return this.finished = []; + }; + + WOW.prototype.start = function() { + var box, _i, _len, _ref; + this.stopped = false; + this.boxes = (function() { + var _i, _len, _ref, _results; + _ref = this.element.querySelectorAll("." + this.config.boxClass); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + box = _ref[_i]; + _results.push(box); + } + return _results; + }).call(this); + this.all = (function() { + var _i, _len, _ref, _results; + _ref = this.boxes; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + box = _ref[_i]; + _results.push(box); + } + return _results; + }).call(this); + if (this.boxes.length) { + if (this.disabled()) { + this.resetStyle(); + } else { + _ref = this.boxes; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + box = _ref[_i]; + this.applyStyle(box, true); + } + } + } + if (!this.disabled()) { + this.util().addEvent(window, 'scroll', this.scrollHandler); + this.util().addEvent(window, 'resize', this.scrollHandler); + this.interval = setInterval(this.scrollCallback, 50); + } + if (this.config.live) { + return new MutationObserver((function(_this) { + return function(records) { + var node, record, _j, _len1, _results; + _results = []; + for (_j = 0, _len1 = records.length; _j < _len1; _j++) { + record = records[_j]; + _results.push((function() { + var _k, _len2, _ref1, _results1; + _ref1 = record.addedNodes || []; + _results1 = []; + for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) { + node = _ref1[_k]; + _results1.push(this.doSync(node)); + } + return _results1; + }).call(_this)); + } + return _results; + }; + })(this)).observe(document.body, { + childList: true, + subtree: true + }); + } + }; + + WOW.prototype.stop = function() { + this.stopped = true; + this.util().removeEvent(window, 'scroll', this.scrollHandler); + this.util().removeEvent(window, 'resize', this.scrollHandler); + if (this.interval != null) { + return clearInterval(this.interval); + } + }; + + WOW.prototype.sync = function(element) { + if (MutationObserver.notSupported) { + return this.doSync(this.element); + } + }; + + WOW.prototype.doSync = function(element) { + var box, _i, _len, _ref, _results; + if (element == null) { + element = this.element; + } + if (element.nodeType !== 1) { + return; + } + element = element.parentNode || element; + _ref = element.querySelectorAll("." + this.config.boxClass); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + box = _ref[_i]; + if (__indexOf.call(this.all, box) < 0) { + this.boxes.push(box); + this.all.push(box); + if (this.stopped || this.disabled()) { + this.resetStyle(); + } else { + this.applyStyle(box, true); + } + _results.push(this.scrolled = true); + } else { + _results.push(void 0); + } + } + return _results; + }; + + WOW.prototype.show = function(box) { + this.applyStyle(box); + return box.className = "" + box.className + " " + this.config.animateClass; + }; + + WOW.prototype.applyStyle = function(box, hidden) { + var delay, duration, iteration; + duration = box.getAttribute('data-wow-duration'); + delay = box.getAttribute('data-wow-delay'); + iteration = box.getAttribute('data-wow-iteration'); + return this.animate((function(_this) { + return function() { + return _this.customStyle(box, hidden, duration, delay, iteration); + }; + })(this)); + }; + + WOW.prototype.animate = (function() { + if ('requestAnimationFrame' in window) { + return function(callback) { + return window.requestAnimationFrame(callback); + }; + } else { + return function(callback) { + return callback(); + }; + } + })(); + + WOW.prototype.resetStyle = function() { + var box, _i, _len, _ref, _results; + _ref = this.boxes; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + box = _ref[_i]; + _results.push(box.style.visibility = 'visible'); + } + return _results; + }; + + WOW.prototype.customStyle = function(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; + }; + + WOW.prototype.vendors = ["moz", "webkit"]; + + WOW.prototype.vendorSet = function(elem, properties) { + var name, value, vendor, _results; + _results = []; + for (name in properties) { + value = properties[name]; + elem["" + name] = value; + _results.push((function() { + var _i, _len, _ref, _results1; + _ref = this.vendors; + _results1 = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + vendor = _ref[_i]; + _results1.push(elem["" + vendor + (name.charAt(0).toUpperCase()) + (name.substr(1))] = value); + } + return _results1; + }).call(this)); + } + return _results; + }; + + WOW.prototype.vendorCSS = function(elem, property) { + var result, style, vendor, _i, _len, _ref; + style = getComputedStyle(elem); + result = style.getPropertyCSSValue(property); + _ref = this.vendors; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + vendor = _ref[_i]; + result = result || style.getPropertyCSSValue("-" + vendor + "-" + property); + } + return result; + }; + + WOW.prototype.animationName = function(box) { + var animationName; + try { + animationName = this.vendorCSS(box, 'animation-name').cssText; + } catch (_error) { + animationName = getComputedStyle(box).getPropertyValue('animation-name'); + } + if (animationName === 'none') { + return ''; + } else { + return animationName; + } + }; + + WOW.prototype.cacheAnimationName = function(box) { + return this.animationNameCache.set(box, this.animationName(box)); + }; + + WOW.prototype.cachedAnimationName = function(box) { + return this.animationNameCache.get(box); + }; + + WOW.prototype.scrollHandler = function() { + return this.scrolled = true; + }; + + WOW.prototype.scrollCallback = function() { + var box; + if (this.scrolled) { + this.scrolled = false; + this.boxes = (function() { + var _i, _len, _ref, _results; + _ref = this.boxes; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + box = _ref[_i]; + if (!(box)) { + continue; + } + if (this.isVisible(box)) { + this.show(box); + continue; + } + _results.push(box); + } + return _results; + }).call(this); + if (!(this.boxes.length || this.config.live)) { + return this.stop(); + } + } + }; + + WOW.prototype.offsetTop = function(element) { + var top; + while (element.offsetTop === void 0) { + element = element.parentNode; + } + top = element.offsetTop; + while (element = element.offsetParent) { + top += element.offsetTop; + } + return top; + }; + + WOW.prototype.isVisible = function(box) { + var bottom, offset, top, viewBottom, viewTop; + offset = box.getAttribute('data-wow-offset') || this.config.offset; + viewTop = window.pageYOffset; + viewBottom = viewTop + Math.min(this.element.clientHeight, this.util().innerHeight()) - offset; + top = this.offsetTop(box); + bottom = top + box.clientHeight; + return top <= viewBottom && bottom >= viewTop; + }; + + WOW.prototype.util = function() { + return this._util != null ? this._util : this._util = new Util(); + }; + + WOW.prototype.disabled = function() { + return !this.config.mobile && this.util().isMobile(navigator.userAgent); + }; + + return WOW; + + })(); + +}).call(this); diff --git a/assets/js/plugins/wow/wow.min.js b/assets/js/plugins/wow/wow.min.js new file mode 100644 index 0000000..2124a96 --- /dev/null +++ b/assets/js/plugins/wow/wow.min.js @@ -0,0 +1,2 @@ +/*! WOW - v1.0.2 - 2014-10-28 +* Copyright (c) 2014 Matthieu Aussaguel; Licensed MIT */(function(){var a,b,c,d,e,f=function(a,b){return function(){return a.apply(b,arguments)}},g=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};b=function(){function a(){}return a.prototype.extend=function(a,b){var c,d;for(c in b)d=b[c],null==a[c]&&(a[c]=d);return a},a.prototype.isMobile=function(a){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(a)},a.prototype.addEvent=function(a,b,c){return null!=a.addEventListener?a.addEventListener(b,c,!1):null!=a.attachEvent?a.attachEvent("on"+b,c):a[b]=c},a.prototype.removeEvent=function(a,b,c){return null!=a.removeEventListener?a.removeEventListener(b,c,!1):null!=a.detachEvent?a.detachEvent("on"+b,c):delete a[b]},a.prototype.innerHeight=function(){return"innerHeight"in window?window.innerHeight:document.documentElement.clientHeight},a}(),c=this.WeakMap||this.MozWeakMap||(c=function(){function a(){this.keys=[],this.values=[]}return a.prototype.get=function(a){var b,c,d,e,f;for(f=this.keys,b=d=0,e=f.length;e>d;b=++d)if(c=f[b],c===a)return this.values[b]},a.prototype.set=function(a,b){var c,d,e,f,g;for(g=this.keys,c=e=0,f=g.length;f>e;c=++e)if(d=g[c],d===a)return void(this.values[c]=b);return this.keys.push(a),this.values.push(b)},a}()),a=this.MutationObserver||this.WebkitMutationObserver||this.MozMutationObserver||(a=function(){function a(){"undefined"!=typeof console&&null!==console&&console.warn("MutationObserver is not supported by your browser."),"undefined"!=typeof console&&null!==console&&console.warn("WOW.js cannot detect dom mutations, please call .sync() after loading new content.")}return a.notSupported=!0,a.prototype.observe=function(){},a}()),d=this.getComputedStyle||function(a){return this.getPropertyValue=function(b){var c;return"float"===b&&(b="styleFloat"),e.test(b)&&b.replace(e,function(a,b){return b.toUpperCase()}),(null!=(c=a.currentStyle)?c[b]:void 0)||null},this},e=/(\-([a-z]){1})/g,this.WOW=function(){function e(a){null==a&&(a={}),this.scrollCallback=f(this.scrollCallback,this),this.scrollHandler=f(this.scrollHandler,this),this.start=f(this.start,this),this.scrolled=!0,this.config=this.util().extend(a,this.defaults),this.animationNameCache=new c}return e.prototype.defaults={boxClass:"wow",animateClass:"animated",offset:0,mobile:!0,live:!0},e.prototype.init=function(){var a;return this.element=window.document.documentElement,"interactive"===(a=document.readyState)||"complete"===a?this.start():this.util().addEvent(document,"DOMContentLoaded",this.start),this.finished=[]},e.prototype.start=function(){var b,c,d,e;if(this.stopped=!1,this.boxes=function(){var a,c,d,e;for(d=this.element.querySelectorAll("."+this.config.boxClass),e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(b);return e}.call(this),this.all=function(){var a,c,d,e;for(d=this.boxes,e=[],a=0,c=d.length;c>a;a++)b=d[a],e.push(b);return e}.call(this),this.boxes.length)if(this.disabled())this.resetStyle();else for(e=this.boxes,c=0,d=e.length;d>c;c++)b=e[c],this.applyStyle(b,!0);return this.disabled()||(this.util().addEvent(window,"scroll",this.scrollHandler),this.util().addEvent(window,"resize",this.scrollHandler),this.interval=setInterval(this.scrollCallback,50)),this.config.live?new a(function(a){return function(b){var c,d,e,f,g;for(g=[],e=0,f=b.length;f>e;e++)d=b[e],g.push(function(){var a,b,e,f;for(e=d.addedNodes||[],f=[],a=0,b=e.length;b>a;a++)c=e[a],f.push(this.doSync(c));return f}.call(a));return g}}(this)).observe(document.body,{childList:!0,subtree:!0}):void 0},e.prototype.stop=function(){return this.stopped=!0,this.util().removeEvent(window,"scroll",this.scrollHandler),this.util().removeEvent(window,"resize",this.scrollHandler),null!=this.interval?clearInterval(this.interval):void 0},e.prototype.sync=function(){return a.notSupported?this.doSync(this.element):void 0},e.prototype.doSync=function(a){var b,c,d,e,f;if(null==a&&(a=this.element),1===a.nodeType){for(a=a.parentNode||a,e=a.querySelectorAll("."+this.config.boxClass),f=[],c=0,d=e.length;d>c;c++)b=e[c],g.call(this.all,b)<0?(this.boxes.push(b),this.all.push(b),this.stopped||this.disabled()?this.resetStyle():this.applyStyle(b,!0),f.push(this.scrolled=!0)):f.push(void 0);return f}},e.prototype.show=function(a){return this.applyStyle(a),a.className=""+a.className+" "+this.config.animateClass},e.prototype.applyStyle=function(a,b){var c,d,e;return d=a.getAttribute("data-wow-duration"),c=a.getAttribute("data-wow-delay"),e=a.getAttribute("data-wow-iteration"),this.animate(function(f){return function(){return f.customStyle(a,b,d,c,e)}}(this))},e.prototype.animate=function(){return"requestAnimationFrame"in window?function(a){return window.requestAnimationFrame(a)}:function(a){return a()}}(),e.prototype.resetStyle=function(){var a,b,c,d,e;for(d=this.boxes,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.style.visibility="visible");return e},e.prototype.customStyle=function(a,b,c,d,e){return b&&this.cacheAnimationName(a),a.style.visibility=b?"hidden":"visible",c&&this.vendorSet(a.style,{animationDuration:c}),d&&this.vendorSet(a.style,{animationDelay:d}),e&&this.vendorSet(a.style,{animationIterationCount:e}),this.vendorSet(a.style,{animationName:b?"none":this.cachedAnimationName(a)}),a},e.prototype.vendors=["moz","webkit"],e.prototype.vendorSet=function(a,b){var c,d,e,f;f=[];for(c in b)d=b[c],a[""+c]=d,f.push(function(){var b,f,g,h;for(g=this.vendors,h=[],b=0,f=g.length;f>b;b++)e=g[b],h.push(a[""+e+c.charAt(0).toUpperCase()+c.substr(1)]=d);return h}.call(this));return f},e.prototype.vendorCSS=function(a,b){var c,e,f,g,h,i;for(e=d(a),c=e.getPropertyCSSValue(b),i=this.vendors,g=0,h=i.length;h>g;g++)f=i[g],c=c||e.getPropertyCSSValue("-"+f+"-"+b);return c},e.prototype.animationName=function(a){var b;try{b=this.vendorCSS(a,"animation-name").cssText}catch(c){b=d(a).getPropertyValue("animation-name")}return"none"===b?"":b},e.prototype.cacheAnimationName=function(a){return this.animationNameCache.set(a,this.animationName(a))},e.prototype.cachedAnimationName=function(a){return this.animationNameCache.get(a)},e.prototype.scrollHandler=function(){return this.scrolled=!0},e.prototype.scrollCallback=function(){var a;return!this.scrolled||(this.scrolled=!1,this.boxes=function(){var b,c,d,e;for(d=this.boxes,e=[],b=0,c=d.length;c>b;b++)a=d[b],a&&(this.isVisible(a)?this.show(a):e.push(a));return e}.call(this),this.boxes.length||this.config.live)?void 0:this.stop()},e.prototype.offsetTop=function(a){for(var b;void 0===a.offsetTop;)a=a.parentNode;for(b=a.offsetTop;a=a.offsetParent;)b+=a.offsetTop;return b},e.prototype.isVisible=function(a){var b,c,d,e,f;return c=a.getAttribute("data-wow-offset")||this.config.offset,f=window.pageYOffset,e=f+Math.min(this.element.clientHeight,this.util().innerHeight())-c,d=this.offsetTop(a),b=d+a.clientHeight,e>=d&&b>=f},e.prototype.util=function(){return null!=this._util?this._util:this._util=new b},e.prototype.disabled=function(){return!this.config.mobile&&this.util().isMobile(navigator.userAgent)},e}()}).call(this); \ No newline at end of file diff --git a/assets/js/retina-1.1.0.js b/assets/js/retina-1.1.0.js deleted file mode 100644 index 0f17fbb..0000000 --- a/assets/js/retina-1.1.0.js +++ /dev/null @@ -1,152 +0,0 @@ -/*! - * Retina.js v1.1.0 - * - * Copyright 2013 Imulus, LLC - * Released under the MIT license - * - * Retina.js is an open source script that makes it easy to serve - * high-resolution images to devices with retina displays. - */ -(function() { - - var root = (typeof exports == 'undefined' ? window : exports); - - var config = { - // Ensure Content-Type is an image before trying to load @2x image - // https://github.com/imulus/retinajs/pull/45) - check_mime_type: true - }; - - - - root.Retina = Retina; - - function Retina() {} - - Retina.configure = function(options) { - if (options == null) options = {}; - for (var prop in options) config[prop] = options[prop]; - }; - - Retina.init = function(context) { - if (context == null) context = root; - - var existing_onload = context.onload || new Function; - - context.onload = function() { - var images = document.getElementsByTagName("img"), retinaImages = [], i, image; - for (i = 0; i < images.length; i++) { - image = images[i]; - retinaImages.push(new RetinaImage(image)); - } - existing_onload(); - } - }; - - Retina.isRetina = function(){ - var mediaQuery = "(-webkit-min-device-pixel-ratio: 1.5),\ - (min--moz-device-pixel-ratio: 1.5),\ - (-o-min-device-pixel-ratio: 3/2),\ - (min-resolution: 1.5dppx)"; - - if (root.devicePixelRatio > 1) - return true; - - if (root.matchMedia && root.matchMedia(mediaQuery).matches) - return true; - - return false; - }; - - - root.RetinaImagePath = RetinaImagePath; - - function RetinaImagePath(path, at_2x_path) { - this.path = path; - if (typeof at_2x_path !== "undefined" && at_2x_path !== null) { - this.at_2x_path = at_2x_path; - this.perform_check = false; - } else { - this.at_2x_path = path.replace(/\.\w+$/, function(match) { return "@2x" + match; }); - this.perform_check = true; - } - } - - RetinaImagePath.confirmed_paths = []; - - RetinaImagePath.prototype.is_external = function() { - return !!(this.path.match(/^https?\:/i) && !this.path.match('//' + document.domain) ) - } - - RetinaImagePath.prototype.check_2x_variant = function(callback) { - var http, that = this; - if (this.is_external()) { - return callback(false); - } else if (!this.perform_check && typeof this.at_2x_path !== "undefined" && this.at_2x_path !== null) { - return callback(true); - } else if (this.at_2x_path in RetinaImagePath.confirmed_paths) { - return callback(true); - } else { - http = new XMLHttpRequest; - http.open('HEAD', this.at_2x_path); - http.onreadystatechange = function() { - if (http.readyState != 4) { - return callback(false); - } - - if (http.status >= 200 && http.status <= 399) { - if (config.check_mime_type) { - var type = http.getResponseHeader('Content-Type'); - if (type == null || !type.match(/^image/i)) { - return callback(false); - } - } - - RetinaImagePath.confirmed_paths.push(that.at_2x_path); - return callback(true); - } else { - return callback(false); - } - } - http.send(); - } - } - - - - function RetinaImage(el) { - this.el = el; - this.path = new RetinaImagePath(this.el.getAttribute('src'), this.el.getAttribute('data-at2x')); - var that = this; - this.path.check_2x_variant(function(hasVariant) { - if (hasVariant) that.swap(); - }); - } - - root.RetinaImage = RetinaImage; - - RetinaImage.prototype.swap = function(path) { - if (typeof path == 'undefined') path = this.path.at_2x_path; - - var that = this; - function load() { - if (! that.el.complete) { - setTimeout(load, 5); - } else { - that.el.setAttribute('width', that.el.offsetWidth); - that.el.setAttribute('height', that.el.offsetHeight); - that.el.setAttribute('src', path); - } - } - load(); - } - - - - - if (Retina.isRetina()) { - Retina.init(root); - } - -})(); - diff --git a/assets/less/about.less b/assets/less/about.less new file mode 100644 index 0000000..e35b320 --- /dev/null +++ b/assets/less/about.less @@ -0,0 +1,70 @@ +.about-content { + padding: 30px; +} + +.about-carousel { + .item { + padding: 15px; + .caption { + padding: 15px; + color: fade(white, 70%); + width: 100%; + margin: auto; + position: absolute; + top: 50%; left: 50%; + -webkit-transform: translate(-50%,-50%); + -ms-transform: translate(-50%,-50%); + transform: translate(-50%,-50%); + h3 { + margin: 0; + } + hr { + margin: 5px auto; + max-width: 50px; + } + p { + margin: 0; + } + ul.social { + margin-top: 5px; + li { + a { + color: fade(white, 70%); + &:hover, + &:focus { + color: white; + } + } + } + } + } + } + .owl-controls { + margin-top: 0; + .owl-prev, + .owl-next { + text-align: center; + position: absolute; + height: 60px; + width: 40px; + border-radius: 0 !important; + line-height: 50px; + font-size: 30px !important; + margin: auto 0 !important; + top: 0; + bottom: 0; + background-color: @themePrimary !important; + color: white !important; + .transition-all; + &:hover { + opacity: 1; + } + } + .owl-prev { + left: 15px; + } + .owl-next { + right: 15px; + } + } +} \ No newline at end of file diff --git a/assets/less/asides.less b/assets/less/asides.less new file mode 100644 index 0000000..f1a4988 --- /dev/null +++ b/assets/less/asides.less @@ -0,0 +1,129 @@ +aside.cta-quote { + color: white; + background-color: @themeDark; + background: no-repeat center center scroll; + .background-cover; + padding: 100px 0; + text-align: center; + span.quote { + display: block; + font-size: 30px; + line-height: 32px; + font-weight: 300; + } +} + +@media(min-width:768px) { + aside.cta-quote { + background-attachment: scroll; + padding: 150px 0; + span.quote { + font-size: 36px; + line-height: 38px; + } + } +} + +@media(min-width:992px) { + aside.cta-quote { + padding: 300px 0; + span.quote { + font-size: 40px; + line-height: 42px; + } + } +} + +@media(min-width:1025px) { + aside.cta-quote { + background-attachment: fixed; + } +} + +.testimonials { + text-align: center; + .testimonials-carousel { + .item { + padding: 0; + p.quote { + margin-bottom: 30px; + } + .testimonial-info { + margin-bottom: 30px; + .testimonial-img { + display: inline-block; + height: 50px; + width: 50px; + margin-right: 10px; + } + .testimonial-author { + display: inline-block; + .name { + .heading-font; + } + hr.colored { + margin: 3px auto; + max-width: 50px; + } + p { + margin: 0; + } + .stars { + color: #f1c40f; + } + } + } + } + .owl-controls { + margin-top: 0; + .owl-prev, + .owl-next { + display: none; + text-align: center; + position: absolute; + height: 60px; + width: 40px; + border-radius: 0 !important; + line-height: 50px; + font-size: 30px !important; + margin: auto 0 !important; + top: 0; + bottom: 0; + background-color: @themePrimary !important; + color: white !important; + .transition-all; + &:hover { + opacity: 1; + } + } + .owl-prev { + left: 15px; + } + .owl-next { + right: 15px; + } + } + } +} + +@media(min-width:768px) { + .testimonials { + .testimonials-carousel { + .item { + padding: 0 100px; + } + .owl-controls { + .owl-prev, + .owl-next { + display: block; + } + } + } + } +} + +.cta-form { + h3 { + margin-top: 0; + } +} \ No newline at end of file diff --git a/assets/less/buttons.less b/assets/less/buttons.less new file mode 100644 index 0000000..293ec96 --- /dev/null +++ b/assets/less/buttons.less @@ -0,0 +1,59 @@ +.btn-outline-light { + color: white; + border: 1px solid white; + background: transparent; + .transition-all; + &:hover, + &:focus { + color: @themePrimary; + background: white; + outline: none; + } +} + +.btn-outline-dark { + color: @themeDark; + border: 1px solid @themeDark; + background: transparent; + .transition-all; + &:hover, + &:focus { + color: white; + background: @themePrimary; + border-color: @themePrimary; + outline: none; + } +} + +.btn { + border-radius: 0; + padding: 12px 18px; + text-transform: uppercase; + font-weight: 900; + letter-spacing: 1px; +} + +.btn:focus, +.btn:active, +.btn.active { + outline: none; +} + +.btn-full-width { + border: 0; + border-radius: 0; + background-color: @themeDark; + color: white; + padding: 50px 0; + font-size: 26px; + font-weight: 200; + letter-spacing: normal; + text-transform: none; + &:hover { + background-color: @themePrimary; + color: white; + } + &:focus { + color: white; + } +} \ No newline at end of file diff --git a/assets/less/contact.less b/assets/less/contact.less new file mode 100644 index 0000000..66a041d --- /dev/null +++ b/assets/less/contact.less @@ -0,0 +1,56 @@ +.floating-label-form-group { + position: relative; + margin-bottom: 0; + padding-bottom: 0.5em; + border-bottom: 1px solid lighten(@themeDark, 75%); + input, + textarea { + z-index: 1; + position: relative; + padding-right: 0; + padding-left: 0; + border: none; + border-radius: 0; + font-size: 1.5em; + background: none; + box-shadow: none !important; + resize: none; + } + label { + display: block; + z-index: 0; + position: relative; + top: 2em; + margin: 0; + font-size: 0.85em; + line-height: 1.764705882em; + vertical-align: middle; + vertical-align: baseline; + opacity: 0; + -webkit-transition: top 0.5s ease,opacity 0.5s ease; + -moz-transition: top 0.5s ease,opacity 0.5s ease; + -ms-transition: top 0.5s ease,opacity 0.5s ease; + transition: top 0.5s ease,opacity 0.5s ease; + } + &::not(:first-child) { + padding-left: 14px; + border-left: 1px solid lighten(@themeDark, 75%); + } +} + +.floating-label-form-group-with-value { + label { + top: 0; + opacity: 1; + } +} + +.floating-label-form-group-with-focus { + label { + color: @themePrimary; + } +} + +form .row:first-child .floating-label-form-group { + border-top: 1px solid lighten(@themeDark, 75%); +} \ No newline at end of file diff --git a/assets/less/footer.less b/assets/less/footer.less new file mode 100644 index 0000000..89deb8a --- /dev/null +++ b/assets/less/footer.less @@ -0,0 +1,32 @@ +footer.footer { + color: fade(white, 70%); + background: no-repeat center center scroll; + .background-cover; + padding: 50px 0 20px; + a { + color: fade(white, 70%); + &:hover { + color: white; + } + } + p { + font-size: 22px; + } + .contact-details { + margin: 75px 0; + } + .social { + margin-bottom: 75px; + } + .copyright { + p.small { + font-size: 14px; + } + } +} + +@media(min-width:1025px) { + footer.footer { + background-attachment: fixed; + } +} \ No newline at end of file diff --git a/assets/less/global.less b/assets/less/global.less new file mode 100644 index 0000000..d270442 --- /dev/null +++ b/assets/less/global.less @@ -0,0 +1,54 @@ + +html, +body { + height: 100%; +} + +.img-centered { + margin: 0 auto; +} + +.content-row { + margin-top: 30px; +} + +section { + padding: 100px 0; +} + +.bg-gray { + background-color: darken(white, 4%) +} + +.bg-dark { + color: white; + background-color: @themeDark; +} + +@media(max-width:767px) { + section { + padding: 75px 0; + } +} + +.owl-theme .owl-controls .owl-page span { + background: fade(@themeDark, 50%); +} + +input.form-control { + border-radius: 0 !important; + &:focus { + border-color: @themePrimary; + box-shadow: none; + } +} + +.btn, +.input-group-btn { + border-radius: 0 !important; + .transition-all; +} + +.btn-primary { + .button-variant(white; @themePrimary; @themePrimary); +} \ No newline at end of file diff --git a/assets/less/header.less b/assets/less/header.less new file mode 100644 index 0000000..fbe882c --- /dev/null +++ b/assets/less/header.less @@ -0,0 +1,119 @@ +header { + position: relative; + display: block; + height: auto; + width: auto; + background-color: @themeDark; + background: no-repeat center center; + background-attachment: scroll; + .background-cover; + padding: 100px 0; + .intro-content { + color: white; + text-align: center; + position: relative; + } + .brand-name { + .heading-font; + font-size: 55px; + line-height: 55px; + text-transform: uppercase; + font-weight: 900; + margin-top: 15px; + } + .brand-name-subtext { + font-size: 20px; + line-height: 20px; + font-weight: 300; + } + img { + max-width: 150px; + max-height: 150px; + } + .scroll-down { + position: absolute; + width: 100%; + bottom: 20px; + text-align: center; + .btn { + height: 50px; + width: 50px; + border: 2px solid white; + border-radius: 100% !important; + line-height: 50px; + padding: 0; + letter-spacing: normal; + color: white; + font-size: 30px; + .transition-all; + &:hover { + color: fade(white, 50%); + border-color: fade(white, 50%); + outline: none; + } + } + } +} + +@media(min-width:768px) { + header { + height: 100%; + width: 100%; + padding: 0; + background-attachment: scroll; + .intro-content { + color: white; + text-align: center; + width: 50%; + margin: auto; + position: absolute; + top: 50%; left: 50%; + -webkit-transform: translate(-50%,-50%); + -ms-transform: translate(-50%,-50%); + transform: translate(-50%,-50%); + } + .brand-name { + font-size: 80px; + line-height: 80px; + } + .brand-name-subtext { + font-size: 30px; + line-height: 30px; + } + img { + max-width: 300px; + max-height: 300px; + } + } +} + +@media(min-width:1025px) { + header { + background-attachment: fixed; + } +} + +header.video { + .overlay { + position: absolute; + height: 100%; + width: 100%; + background: #000; + z-index: 998; + opacity: 0; + } + .intro-content { + z-index: 999; + } + .scroll-down { + z-index: 999; + } +} + +@media(min-width:768px) { + header.video { + .overlay { + opacity: 0.5; + } + } +} \ No newline at end of file diff --git a/assets/less/mixins.less b/assets/less/mixins.less new file mode 100644 index 0000000..4d50c09 --- /dev/null +++ b/assets/less/mixins.less @@ -0,0 +1,79 @@ +.transition-all() { + -webkit-transition: all 0.5s; + -moz-transition: all 0.5s; + transition: all 0.5s; +} + +.background-cover() { + -webkit-background-size: cover; + -moz-background-size: cover; + background-size: cover; + -o-background-size: cover; +} + +.sans-serif-font() { + font-family: "Roboto","Helvetica Neue",Helvetica,Arial,sans-serif; +} + +.serif-font() { + font-family: "Cardo","Helvetica Neue",Helvetica,Arial,sans-serif; +} + +.heading-font() { + font-family: "Raleway","Helvetica Neue",Helvetica,Arial,sans-serif; + font-weight: 900; + text-transform: uppercase; +} + +.heading-font-modern() { + font-family: "Montserrat","Helvetica Neue",Helvetica,Arial,sans-serif; + font-weight: 700; + text-transform: uppercase; +} + +.heading-font-vintage() { + font-family: "Sanchez","Helvetica Neue",Helvetica,Arial,sans-serif; + font-weight: 400; + text-transform: uppercase; +} + +.button-variant(@color; @background; @border) { + color: @color; + background-color: @background; + border-color: @border; + .transition-all; + + &:hover, + &:focus, + &.focus, + &:active, + &.active, + .open > .dropdown-toggle& { + color: @color; + background-color: darken(@background, 5%); + border-color: darken(@border, 7%); + } + &:active, + &.active, + .open > .dropdown-toggle& { + background-image: none; + } + &.disabled, + &[disabled], + fieldset[disabled] & { + &, + &:hover, + &:focus, + &.focus, + &:active, + &.active { + background-color: @background; + border-color: @border; + } + } + + .badge { + color: @background; + background-color: @color; + } +} \ No newline at end of file diff --git a/assets/less/navbar.less b/assets/less/navbar.less new file mode 100644 index 0000000..056d64a --- /dev/null +++ b/assets/less/navbar.less @@ -0,0 +1,105 @@ +.navbar-fixed-top { + margin-bottom: 0; +} + +.navbar-default .navbar-nav>.active>a, +.navbar-default .navbar-nav>.active>a:hover, +.navbar-default .navbar-nav>.active>a:focus, +.navbar-inverse .navbar-nav>.active>a, +.navbar-inverse .navbar-nav>.active>a:hover, +.navbar-inverse .navbar-nav>.active>a:focus { + color: @themePrimary; + background-color: white; + border-radius: 0; +} + +.navbar-default { + background-color: @themePrimary; + .navbar-toggle { + .icon-bar { + background-color: white; + } + } + .navbar-toggle:hover, + .navbar-toggle:focus { + background-color: fade(white, 50%); + } + .navbar-collapse, + .navbar-form { + border-color: fade(white, 50%); + } +} + +.navbar-inverse { + background-color: @themeDark; +} + +.navbar-default, +.navbar-inverse { + border: none; + border-bottom: 1px solid fade(white, 10%); + .navbar-brand { + padding: 0 15px; + color: white; + opacity: 1; + text-decoration: none; + .transition-all; + &:hover, + &:focus { + opacity: 1; + } + } + .navbar-nav { + li { + a { + color: white; + &:hover { + color: fade(white, 50%) + } + } + } + } +} + +@media(min-width:768px) { + .navbar-default .navbar-nav>.active>a, + .navbar-default .navbar-nav>.active>a:hover, + .navbar-default .navbar-nav>.active>a:focus, + .navbar-inverse .navbar-nav>.active>a, + .navbar-inverse .navbar-nav>.active>a:hover, + .navbar-inverse .navbar-nav>.active>a:focus { + border-radius: 5px; + } + .navbar-fixed-top.navbar-expanded { + padding: 30px 0; + } + .navbar-fixed-top { + padding: 15px 0; + -webkit-transition: padding 0.5s; + -moz-transition: padding 0.5s; + transition: padding 0.5s; + .navbar-brand { + &:hover { + opacity: 0.5; + } + } + } + .navbar-default.navbar-expanded, + .navbar-inverse.navbar-expanded { + background: transparent; + border: none; + } +} + +.navbar { + a:focus { + outline: none; + } + .navbar-nav { + li { + a:focus { + outline: none; + } + } + } +} \ No newline at end of file diff --git a/assets/less/portfolio.less b/assets/less/portfolio.less new file mode 100644 index 0000000..8b15793 --- /dev/null +++ b/assets/less/portfolio.less @@ -0,0 +1,269 @@ +.portfolio-carousel { + padding: 0; + color: white; + background-color: @themeDark; + .item { + background-color: @themeDark; + background: no-repeat center center scroll; + .background-cover; + padding: 50px 55px; + text-align: center; + .portfolio-image { + margin-top: 50px; + } + .project-details { + padding: 0; + img.client-logo { + margin: 0 auto 25px; + } + .project-name { + display: block; + font-size: 40px; + line-height: 40px; + margin-bottom: 5px; + .heading-font; + } + .project-description { + display: block; + font-size: 18px; + line-height: 18px; + } + } + } + .owl-controls { + margin-top: 0; + .owl-prev, + .owl-next { + text-align: center; + position: absolute; + height: 75px; + width: 50px; + border-radius: 0 !important; + line-height: 70px; + font-size: 30px !important; + margin: auto 0 !important; + top: 0; + bottom: 0; + background-color: @themePrimary !important; + color: white !important; + .transition-all; + &:hover { + opacity: 1; + } + } + .owl-prev { + left: 0; + } + .owl-next { + right: 0; + } + } +} + +@media(min-width:992px) { + .portfolio-carousel { + .item { + padding: 155px 55px 155px; + text-align: left; + min-height: 100%; + .portfolio-image { + margin-top: 0; + } + .project-details { + padding: 15% 0 0; + img.client-logo { + margin: 0 auto 25px 0; + } + .project-name { + display: block; + font-size: 50px; + line-height: 50px; + } + .project-description { + font-size: 20px; + line-height: 20px; + } + } + hr.colored { + margin: 20px auto 20px 0; + } + } + } +} + +.portfolio-gallery { + .item { + padding: 15px; + } +} + +.portfolio-modal { + .modal-backdrop { + display: none; + } + .background-cover; + .modal-content { + color: white; + background: transparent; + border-radius: 0; + background-clip: border-box; + -webkit-box-shadow: none; + box-shadow: none; + border: none; + min-height: 100%; + padding: 100px 0; + text-align: center; + h2 { + margin: 0; + font-size: 46px; + } + img { + margin: 30px auto; + } + .item-details { + margin: 30px 0; + } + } + .close-modal { + position: absolute; + width:75px; + height:75px; + background-color:transparent; + top: 25px; + right: 25px; + cursor: pointer; + &:hover { + opacity: 0.3; + } + .lr { + height:75px; + width:1px; + margin-left:35px; + background-color: white; + transform: rotate(45deg); + -ms-transform: rotate(45deg); + /* IE 9 */ + -webkit-transform: rotate(45deg); + /* Safari and Chrome */ + z-index:1051; + .rl { + height:75px; + width:1px; + background-color: white; + transform: rotate(90deg); + -ms-transform: rotate(90deg); + /* IE 9 */ + -webkit-transform: rotate(90deg); + /* Safari and Chrome */ + z-index:1052; + } + } + } +} + +// Portfolio Grid + +.portfolio-filter { + display: inline-block; + #filters { + list-style: none; + padding: 0; + margin-bottom: 30px; + li { + display: inline-block; + .filter { + display: block; + cursor: pointer; + padding: 10px 15px; + margin: 2px; + text-transform: uppercase; + font-weight: 900; + letter-spacing: 1px; + font-size: 12px; + color: @themeDark; + background: transparent; + border: 1px solid @themeDark; + .transition-all; + &.active { + background-color: @themePrimary; + color: white; + border-color: @themePrimary; + } + } + } + } +} + +#portfoliolist { + + .portfolio { + width: 31%; + margin: 1%; + display: none; + float: left; + overflow: hidden; + + .portfolio-wrapper { + overflow: hidden; + position: relative !important; + background: @themeDark; + cursor: pointer; + + img { + max-width:100%; + position: relative; + -webkit-filter: grayscale(0); + filter: grayscale(0); + &:hover { + -webkit-filter: grayscale(1); + filter: grayscale(1); + } + } + + .caption { + position: absolute; + width: 100%; + height: 75px; + bottom: -75px; + + .caption-bg { + background: @themePrimary; + width: 100%; + height:100%; + position: absolute; + top:0; + left:0; + } + + .caption-text { + color: white; + position: relative; + z-index: 500; + padding: 15px 8px; + + a.text-title { + color: white; + } + + .text-category { + display: block; + font-size: 12px; + } + + } + } + + } + } + +} + +/* #Mobile (Portrait) - Note: Design for a width of 320px */ +@media only screen and (max-width: 767px) { + + #portfoliolist .portfolio { + width:48%; + margin:1%; + } + +} \ No newline at end of file diff --git a/assets/less/pricing.less b/assets/less/pricing.less new file mode 100644 index 0000000..8e009a3 --- /dev/null +++ b/assets/less/pricing.less @@ -0,0 +1,66 @@ +.pricing { + color: white; + background-color: @themeDark; + background: no-repeat center center scroll; + .background-cover; + .pricing-item { + text-align: center; + background: white; + color: @themeDark; + padding: 30px; + -webkit-box-shadow: 0px 0px 30px 5px fade(@themeDark, 75%); + -moz-box-shadow: 0px 0px 30px 5px fade(@themeDark, 75%); + box-shadow: 0px 0px 30px 5px fade(@themeDark, 75%); + z-index: 1; + margin-bottom: 30px; + h3 { + margin: 0; + } + hr { + max-width: 100px; + } + .price { + margin-bottom: 20px; + .number { + font-weight: 900; + font-size: 50px; + sup { + font-size: 30px; + } + } + } + .list-group-item { + border-radius: 0; + } + } +} + +@media(min-width:992px) { + .pricing { + background-attachment: scroll; + .pricing-item { + margin-bottom: 0; + } + .pricing-item.featured-first { + margin-right: -15px; + margin-top: 15px; + } + .pricing-item.featured { + position: absolute; + width: 100%; + left: 0; + margin: 0; + padding: 45px 30px; + } + .pricing-item.featured-last { + margin-left: -15px; + margin-top: 15px; + } + } +} + +@media(min-width:1025px) { + .pricing { + background-attachment: fixed; + } +} \ No newline at end of file diff --git a/assets/less/services.less b/assets/less/services.less new file mode 100644 index 0000000..080dcdb --- /dev/null +++ b/assets/less/services.less @@ -0,0 +1,45 @@ +.services { + .media { + margin-bottom: 30px; + i.fa { + height: 75px; + width: 75px; + line-height: 70px; + text-align: center; + border: 3px solid @themeDark; + border-radius: 100%; + font-size: 30px; + } + .media-body { + min-width: none; + padding-left: 15px; + h3 { + margin-bottom: 15px; + } + ul { + list-style: inside; + padding: 0; + li { + margin-bottom: 10px; + } + } + @media(min-width:390px) { + min-width: 260px; + } + @media(min-width:992px) { + min-width: 193px; + } + @media(min-width:1199px) { + min-width: 260px; + } + } + } +} + +@media(min-width:992px) { + .services { + .media { + margin-bottom: 0; + } + } +} \ No newline at end of file diff --git a/assets/less/themes.less b/assets/less/themes.less new file mode 100644 index 0000000..6674192 --- /dev/null +++ b/assets/less/themes.less @@ -0,0 +1,114 @@ +body.modern { + .serif-font; + font-weight: 400; + h1, h2, h3, h4, h5, h6 { + .heading-font-modern; + } + + p.lead { + .heading-font-modern; + } + + header { + .brand-name { + .heading-font-modern; + } + } + + .about-carousel { + .owl-controls { + .owl-prev, + .owl-next { + line-height: 55px; + } + } + } + + .portfolio-carousel { + .item { + .project-details { + .project-name { + .heading-font-modern; + } + } + } + } + + .testimonials { + .testimonials-carousel { + .item { + .testimonial-info { + .testimonial-author { + .name { + .heading-font-modern; + } + } + } + } + .owl-controls { + .owl-prev, + .owl-next { + line-height: 55px; + } + } + } + } + +} + +body.vintage { + .serif-font; + font-weight: 400; + h1, h2, h3, h4, h5, h6 { + .heading-font-vintage; + } + + p.lead { + .heading-font-vintage; + } + + header { + .brand-name { + .heading-font-vintage; + } + } + + .about-carousel { + .owl-controls { + .owl-prev, + .owl-next { + line-height: 55px; + } + } + } + + .portfolio-carousel { + .item { + .project-details { + .project-name { + .heading-font-vintage; + } + } + } + } + + .testimonials { + .testimonials-carousel { + .item { + .testimonial-info { + .testimonial-author { + .name { + .heading-font-vintage; + } + } + } + } + .owl-controls { + .owl-prev, + .owl-next { + line-height: 55px; + } + } + } + } +} \ No newline at end of file diff --git a/assets/less/typography.less b/assets/less/typography.less new file mode 100644 index 0000000..ef1d144 --- /dev/null +++ b/assets/less/typography.less @@ -0,0 +1,77 @@ +body { + .sans-serif-font; + font-size: 16px; + font-weight: 300; +} + +a { + color: @themePrimary; + .transition-all; + &:hover, + &:focus { + color: inherit; + text-decoration: none; + } +} + +p { + font-size: 18px; + line-height: 1.5; +} + +p.lead { + .heading-font; + font-size: 24px; +} + +h1, h2, h3, h4, h5, h6 { + .heading-font; +} + +@media(min-width:481px) { + h1 { + font-size: 52px; + } + + h2 { + font-size: 50px; + } +} + +hr { + max-width: 100px; + border-top: 1px solid white; + border-bottom: 1px solid white; + height: 2px; + margin: 15px auto; +} + +hr.left { + margin: 15px auto 15px 0; +} + +hr.right { + margin: 15px 0 15px auto; +} + +hr.colored { + border-color: @themePrimary; +} + +@media(min-width:768px) { + hr { + max-width: 200px; + margin: 20px auto; + } + hr.left { + margin: 20px auto 20px 0; + } + + hr.right { + margin: 20px 0 20px auto; + } +} + +.text-primary { + color: @themePrimary; +} \ No newline at end of file diff --git a/assets/less/variables.less b/assets/less/variables.less new file mode 100644 index 0000000..461aada --- /dev/null +++ b/assets/less/variables.less @@ -0,0 +1,4 @@ +// Variables + +@themePrimary: #EF4035; +@themeDark: #222; \ No newline at end of file diff --git a/assets/less/vitality.less b/assets/less/vitality.less new file mode 100644 index 0000000..2944e7e --- /dev/null +++ b/assets/less/vitality.less @@ -0,0 +1,15 @@ +@import "variables.less"; +@import "mixins.less"; +@import "global.less"; +@import "typography.less"; +@import "navbar.less"; +@import "header.less"; +@import "asides.less"; +@import "about.less"; +@import "services.less"; +@import "portfolio.less"; +@import "pricing.less"; +@import "contact.less"; +@import "footer.less"; +@import "buttons.less"; +@import "themes.less"; \ No newline at end of file diff --git a/assets/mp4/.DS_Store b/assets/mp4/.DS_Store new file mode 100644 index 0000000..fd40733 Binary files /dev/null and b/assets/mp4/.DS_Store differ diff --git a/assets/mp4/code.mov b/assets/mp4/code.mov new file mode 100644 index 0000000..a50ed02 Binary files /dev/null and b/assets/mp4/code.mov differ diff --git a/index.html b/index.html index c6a742c..247ab0b 100644 --- a/index.html +++ b/index.html @@ -2,237 +2,403 @@ layout: home title: Home --- -
- -
-
-
- Ennovar is adding jobs and growing the economy — fulfilling WSU’s strategic plan — and paving the way for additional organizations on campus that make the Innovation University concept real — right now. -

-
-
-




-
- -
-
-

An applied learning institute at Wichita State University

-
+ + +
-
- -
-
-
-

What we offer

-

Solutions for software, technology, and support services to companies worldwide

+ + + +
+
+
+ +
+ +
+
+
+
+
+

What we offer

+

Software solutions to companies worldwide

+
+
-
-
-
- -

Software Development

-
- -

Turning characters into code. Websites, mobile apps, machine learning, you name it. Our team incorporates programmatic thinking, are platform agnostic, and has experience in multiple software disciplines – everything you need to turn your projects into reality.

- -

Technical Support Services

-

Turning questions into answers. Providing Level 1 support for basic customer issues while leveraging the knowledge from our solution and software teams. Housing your technical support team in our offices gives you a cost effective alternative to in-house or offshore options. View Flyer

+
+
+
+ +

Developer(s) as a Service

+

DaaS allows you to find dedicated developers at the source to start building your software now. Reduce your recruitment costs, training costs, and time to execution. Evaluate skill and culture fit of potential employees without HR, regulatory, tax, and organizational burdens. We manage the people aspect, you manage the project.

+
+
+
+
+ +

Software Development

+

Websites, mobile apps, cloud, artificial intelligence, machine learning, computer vision, virtual reality, you name it. Our team applies programmatic thinking, are platform agnostic, and has experience in multiple software disciplines. We have everything you need to turn your projects into reality.

+
+
+
+
+ +

Website Development

+

Web traffic is shifting towards mobile devices, one cannot afford to have an online presence without a strong mobile interface. In today's competitive marketplace, there is a dichotomy, you are either perfect, or you are left behind. We insert a personal element of creativity to your user experience.

+
+
+
+
+ +

Product Development

+

Combining a precise formula of art and science to planning and leading your software goals to the finish line. We will keep you up-to-date each step of the way, delivering on time and within budget. Our services include Business Analysis, Project Scoping, Product Planning, Design, and Development. Our team has a modular approach and interfaces with whichever pieces your team has in place.

+
+
+ Start Your Project Now
-
- -

Solution Reference Architecture

-
-

Turning data into decisions. Delivering hardware and software platform testing, third-party verification, A/B testing, and technical validation for your products and solutions. Creating the typology, proof points, and technical documentation you need to win.

-

Cyber Security

-

Turning concern into confidence. Ennovar and Cyber Research Group partnered to deliver the highest level of cyber security and IT support. We offer complete solutions in enterprise IT services, IA/Cyber Security services, service desk and customer support.
View Flyer

+
+
+
+
+
+
+

Trusted by

+
+
-
-
- -
-
-
-

Start your project now

+
+
+ +
- + +
-

-
-
-
-
-

Applying theoretical knowledge to real-world projects
- Shift the way you think, work, and innovate

-

Ennovar at Wichita State University emphasizes education, emerging technology, experiential learning, evolutionary research, exploration, and engagement. A collaboration of industry, student technicians, and subject matter experts produces the high quality deliverables companies require while providing the most highly experienced next generation workforce. Ennovar is a derivative of the Spanish word “innovar,” which means, “to innovate.” Join the innovation!

-

-
+ +
+
+
+
+

Our Process

+
+

Here is an overview of how we approach each new project.

+
-
-
- - - -
-
-
-
-

Join Team Ennovar

-

Companies are currently seeking their next generation workforce. Push the boundaries with our dedicated team of hardware specialists, software developers, communication and graphic design experts, business analysts, and technology professionals to sharpen your skill sets, develop new competencies, and gain the real-world experience for that direct path in your career development.

-

-

-
- -
-
-
-
-
-
+
+ +
+
-

News

- {% assign sorted_news = (site.news | sort: 'date' | limit: 3) | reverse %} - {% for post in sorted_news limit: 3 %} - {% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} - {% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %} -
- - +
+

Contact Us

+
+

Please tell us about your next project and we will let you know what we can do to help you.

- {% endfor %}
-
- +
+
+
+
+
+ + +

+
+
+
+
+ + +

+
+
+
+
+ + +

+
+
+
+
+ + +

+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+

Join Team Ennovar

+
+

Companies are currently seeking their next generation workforce. Push the boundaries with our dedicated team of hardware specialists, software developers, communication and graphic design experts, business analysts, and technology professionals to sharpen your skill sets, develop new competencies, and gain the real-world experience for that direct path in your career development.

+
+ +

+ +
-
+ diff --git a/mail/contact_me.php b/mail/contact_me.php new file mode 100644 index 0000000..2b92868 --- /dev/null +++ b/mail/contact_me.php @@ -0,0 +1,26 @@ +