Ghaymah intern
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
|
||||
var Froogaloop=function(){function e(a){return new e.fn.init(a)}function h(a,c,b){if(!b.contentWindow.postMessage)return!1;var f=b.getAttribute("src").split("?")[0],a=JSON.stringify({method:a,value:c});"//"===f.substr(0,2)&&(f=window.location.protocol+f);b.contentWindow.postMessage(a,f)}function j(a){var c,b;try{c=JSON.parse(a.data),b=c.event||c.method}catch(f){}"ready"==b&&!i&&(i=!0);if(a.origin!=k)return!1;var a=c.value,e=c.data,g=""===g?null:c.player_id;c=g?d[g][b]:d[b];b=[];if(!c)return!1;void 0!==
|
||||
a&&b.push(a);e&&b.push(e);g&&b.push(g);return 0<b.length?c.apply(null,b):c.call()}function l(a,c,b){b?(d[b]||(d[b]={}),d[b][a]=c):d[a]=c}var d={},i=!1,k="";e.fn=e.prototype={element:null,init:function(a){"string"===typeof a&&(a=document.getElementById(a));this.element=a;a=this.element.getAttribute("src");"//"===a.substr(0,2)&&(a=window.location.protocol+a);for(var a=a.split("/"),c="",b=0,f=a.length;b<f;b++){if(3>b)c+=a[b];else break;2>b&&(c+="/")}k=c;return this},api:function(a,c){if(!this.element||
|
||||
!a)return!1;var b=this.element,f=""!==b.id?b.id:null,d=!c||!c.constructor||!c.call||!c.apply?c:null,e=c&&c.constructor&&c.call&&c.apply?c:null;e&&l(a,e,f);h(a,d,b);return this},addEvent:function(a,c){if(!this.element)return!1;var b=this.element,d=""!==b.id?b.id:null;l(a,c,d);"ready"!=a?h("addEventListener",a,b):"ready"==a&&i&&c.call(null,d);return this},removeEvent:function(a){if(!this.element)return!1;var c=this.element,b;a:{if((b=""!==c.id?c.id:null)&&d[b]){if(!d[b][a]){b=!1;break a}d[b][a]=null}else{if(!d[a]){b=
|
||||
!1;break a}d[a]=null}b=!0}"ready"!=a&&b&&h("removeEventListener",a,c)}};e.fn.init.prototype=e.fn;window.addEventListener?window.addEventListener("message",j,!1):window.attachEvent("onmessage",j);return window.Froogaloop=window.$f=e}();
|
||||
@@ -0,0 +1,137 @@
|
||||
;(function ($, window) {
|
||||
|
||||
// test for feature support and return if failure
|
||||
|
||||
// defaults
|
||||
var defaults = {
|
||||
ratio: 16/9, // usually either 4/3 or 16/9 -- tweak as needed
|
||||
videoId: 'ZCAnLxRvNNc', // toy robot in space is a good default, no?
|
||||
mute: true,
|
||||
repeat: true,
|
||||
width: $(window).width(),
|
||||
wrapperZIndex: 'inherit',
|
||||
playButtonClass: 'tubular-play',
|
||||
pauseButtonClass: 'tubular-pause',
|
||||
muteButtonClass: 'tubular-mute',
|
||||
volumeUpClass: 'tubular-volume-up',
|
||||
volumeDownClass: 'tubular-volume-down',
|
||||
increaseVolumeBy: 10,
|
||||
start: 0,
|
||||
container: $('.section')
|
||||
};
|
||||
|
||||
// methods
|
||||
|
||||
var tubular = function(node, options) { // should be called on the wrapper div
|
||||
var options = $.extend({}, defaults, options),
|
||||
$body = options.container // cache body node
|
||||
$node = $(node); // cache wrapper node
|
||||
|
||||
// build container
|
||||
var tubularContainer = '<div class="tubular-container"><div id="tubular-player" class="tubular-player"/></div>';
|
||||
|
||||
// set up css prereq's, inject tubular container and set up wrapper defaults
|
||||
$body.prepend(tubularContainer);
|
||||
|
||||
$node.css({position: 'relative', 'z-index': options.wrapperZIndex});
|
||||
|
||||
// set up iframe player, use global scope so YT api can talk
|
||||
window.player;
|
||||
window.onYouTubeIframeAPIReady = function() {
|
||||
player = new YT.Player('tubular-player', {
|
||||
width: options.width,
|
||||
height: Math.ceil(options.width / options.ratio),
|
||||
videoId: options.videoId,
|
||||
playerVars: {
|
||||
controls: 0,
|
||||
showinfo: 0,
|
||||
modestbranding: 1,
|
||||
wmode: 'transparent'
|
||||
},
|
||||
events: {
|
||||
'onReady': onPlayerReady,
|
||||
'onStateChange': onPlayerStateChange
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
window.onPlayerReady = function(e) {
|
||||
resize();
|
||||
if (options.mute) e.target.mute();
|
||||
e.target.seekTo(options.start);
|
||||
e.target.playVideo();
|
||||
}
|
||||
|
||||
window.onPlayerStateChange = function(state) {
|
||||
if (state.data === 0 && options.repeat) { // video ended and repeat option is set true
|
||||
player.seekTo(options.start); // restart
|
||||
}
|
||||
}
|
||||
|
||||
// resize handler updates width, height and offset of player after resize/init
|
||||
var resize = function() {
|
||||
var width = $(window).width(),
|
||||
pWidth, // player width, to be defined
|
||||
height = $(window).height(),
|
||||
pHeight, // player height, tbd
|
||||
$tubularPlayer = $('#tubular-player');
|
||||
|
||||
// when screen aspect ratio differs from video, video must center and underlay one dimension
|
||||
|
||||
if (width / options.ratio < height) { // if new video height < window height (gap underneath)
|
||||
pWidth = Math.ceil(height * options.ratio); // get new player width
|
||||
$tubularPlayer.width(pWidth).height(height).css({left: (width - pWidth) / 2, top: 0}); // player width is greater, offset left; reset top
|
||||
} else { // new video width < window width (gap to right)
|
||||
pHeight = Math.ceil(width / options.ratio); // get new player height
|
||||
$tubularPlayer.width(width).height(pHeight).css({left: 0, top: (height - pHeight) / 2}); // player height is greater, offset top; reset left
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// events
|
||||
$(window).on('resize.tubular', function() {
|
||||
resize();
|
||||
})
|
||||
|
||||
$('body').on('click','.' + options.playButtonClass, function(e) { // play button
|
||||
e.preventDefault();
|
||||
player.playVideo();
|
||||
}).on('click', '.' + options.pauseButtonClass, function(e) { // pause button
|
||||
e.preventDefault();
|
||||
player.pauseVideo();
|
||||
}).on('click', '.' + options.muteButtonClass, function(e) { // mute button
|
||||
e.preventDefault();
|
||||
(player.isMuted()) ? player.unMute() : player.mute();
|
||||
}).on('click', '.' + options.volumeDownClass, function(e) { // volume down button
|
||||
e.preventDefault();
|
||||
var currentVolume = player.getVolume();
|
||||
if (currentVolume < options.increaseVolumeBy) currentVolume = options.increaseVolumeBy;
|
||||
player.setVolume(currentVolume - options.increaseVolumeBy);
|
||||
}).on('click', '.' + options.volumeUpClass, function(e) { // volume up button
|
||||
e.preventDefault();
|
||||
if (player.isMuted()) player.unMute(); // if mute is on, unmute
|
||||
var currentVolume = player.getVolume();
|
||||
if (currentVolume > 100 - options.increaseVolumeBy) currentVolume = 100 - options.increaseVolumeBy;
|
||||
player.setVolume(currentVolume + options.increaseVolumeBy);
|
||||
})
|
||||
}
|
||||
|
||||
// load yt iframe js api
|
||||
|
||||
var tag = document.createElement('script');
|
||||
tag.src = "//www.youtube.com/iframe_api";
|
||||
var firstScriptTag = document.getElementsByTagName('script')[0];
|
||||
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
||||
|
||||
// create plugin
|
||||
|
||||
$.fn.tubular = function (options) {
|
||||
return this.each(function () {
|
||||
if (!$.data(this, 'tubular_instantiated')) { // let's only run one
|
||||
$.data(this, 'tubular_instantiated',
|
||||
tubular(this, options));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
})(jQuery, window);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
(function($){"use strict";$.ajaxChimp={responses:{"We have sent you a confirmation email":0,"Please enter a value":1,"An email address must contain a single @":2,"The domain portion of the email address is invalid (the portion after the @: )":3,"The username portion of the email address is invalid (the portion before the @: )":4,"This email address looks fake or invalid. Please enter a real email address":5},translations:{en:null},init:function(selector,options){$(selector).ajaxChimp(options)}};$.fn.ajaxChimp=function(options){$(this).each(function(i,elem){var form=$(elem);var email=form.find("input[type=email]");var label=form.find("label[for="+email.attr("id")+"]");var settings=$.extend({url:form.attr("action"),language:"en"},options);var url=settings.url.replace("/post?","/post-json?").concat("&c=?");form.attr("novalidate","true");email.attr("name","EMAIL");form.submit(function(){var msg;function successCallback(resp){if(resp.result==="success"){msg="We have sent you a confirmation email";label.removeClass("error").addClass("valid");email.removeClass("error").addClass("valid")}else{email.removeClass("valid").addClass("error");label.removeClass("valid").addClass("error");var index=-1;try{var parts=resp.msg.split(" - ",2);if(parts[1]===undefined){msg=resp.msg}else{var i=parseInt(parts[0],10);if(i.toString()===parts[0]){index=parts[0];msg=parts[1]}else{index=-1;msg=resp.msg}}}catch(e){index=-1;msg=resp.msg}}if(settings.language!=="en"&&$.ajaxChimp.responses[msg]!==undefined&&$.ajaxChimp.translations&&$.ajaxChimp.translations[settings.language]&&$.ajaxChimp.translations[settings.language][$.ajaxChimp.responses[msg]]){msg=$.ajaxChimp.translations[settings.language][$.ajaxChimp.responses[msg]]}label.html(msg);label.show(2e3);if(settings.callback){settings.callback(resp)}}var data={};var dataArray=form.serializeArray();$.each(dataArray,function(index,item){data[item.name]=item.value});$.ajax({url:url,data:data,success:successCallback,dataType:"jsonp",error:function(resp,text){console.log("mailchimp ajax submit error: "+text)}});var submitMsg="Submitting...";if(settings.language!=="en"&&$.ajaxChimp.translations&&$.ajaxChimp.translations[settings.language]&&$.ajaxChimp.translations[settings.language]["submit"]){submitMsg=$.ajaxChimp.translations[settings.language]["submit"]}label.html(submitMsg).show(2e3);return false})});return this}})(jQuery);
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,205 @@
|
||||
/*
|
||||
* 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 - 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.
|
||||
*
|
||||
*/
|
||||
|
||||
// t: current time, b: begInnIng value, c: change In value, d: duration
|
||||
jQuery.easing['jswing'] = jQuery.easing['swing'];
|
||||
|
||||
jQuery.extend( jQuery.easing,
|
||||
{
|
||||
def: 'easeOutQuad',
|
||||
swing: function (x, t, b, c, d) {
|
||||
//alert(jQuery.easing.default);
|
||||
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
|
||||
},
|
||||
easeInQuad: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t + b;
|
||||
},
|
||||
easeOutQuad: function (x, t, b, c, d) {
|
||||
return -c *(t/=d)*(t-2) + b;
|
||||
},
|
||||
easeInOutQuad: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t + b;
|
||||
return -c/2 * ((--t)*(t-2) - 1) + b;
|
||||
},
|
||||
easeInCubic: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t + b;
|
||||
},
|
||||
easeOutCubic: function (x, t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t + 1) + b;
|
||||
},
|
||||
easeInOutCubic: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t + 2) + b;
|
||||
},
|
||||
easeInQuart: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t + b;
|
||||
},
|
||||
easeOutQuart: function (x, t, b, c, d) {
|
||||
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
||||
},
|
||||
easeInOutQuart: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
||||
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
||||
},
|
||||
easeInQuint: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t*t + b;
|
||||
},
|
||||
easeOutQuint: function (x, t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
||||
},
|
||||
easeInOutQuint: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
||||
},
|
||||
easeInSine: function (x, t, b, c, d) {
|
||||
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
||||
},
|
||||
easeOutSine: function (x, t, b, c, d) {
|
||||
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
||||
},
|
||||
easeInOutSine: function (x, t, b, c, d) {
|
||||
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
||||
},
|
||||
easeInExpo: function (x, t, b, c, d) {
|
||||
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
||||
},
|
||||
easeOutExpo: function (x, t, b, c, d) {
|
||||
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
||||
},
|
||||
easeInOutExpo: function (x, t, b, c, d) {
|
||||
if (t==0) return b;
|
||||
if (t==d) return b+c;
|
||||
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
||||
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
||||
},
|
||||
easeInCirc: function (x, t, b, c, d) {
|
||||
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
||||
},
|
||||
easeOutCirc: function (x, t, b, c, d) {
|
||||
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
||||
},
|
||||
easeInOutCirc: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
||||
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
||||
},
|
||||
easeInElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
},
|
||||
easeOutElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
||||
},
|
||||
easeInOutElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
||||
},
|
||||
easeInBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
return c*(t/=d)*t*((s+1)*t - s) + b;
|
||||
},
|
||||
easeOutBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
||||
},
|
||||
easeInOutBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
||||
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
||||
},
|
||||
easeInBounce: function (x, t, b, c, d) {
|
||||
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
||||
},
|
||||
easeOutBounce: function (x, t, b, c, d) {
|
||||
if ((t/=d) < (1/2.75)) {
|
||||
return c*(7.5625*t*t) + b;
|
||||
} else if (t < (2/2.75)) {
|
||||
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
||||
} else if (t < (2.5/2.75)) {
|
||||
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
||||
} else {
|
||||
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
||||
}
|
||||
},
|
||||
easeInOutBounce: function (x, t, b, c, d) {
|
||||
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
||||
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
*
|
||||
* TERMS OF USE - EASING EQUATIONS
|
||||
*
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright © 2001 Robert Penner
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
|
||||
/** Abstract base class for collection plugins v1.0.1.
|
||||
Written by Keith Wood (kbwood{at}iinet.com.au) December 2013.
|
||||
Licensed under the MIT (http://keith-wood.name/licence.html) license. */
|
||||
(function(){var j=false;window.JQClass=function(){};JQClass.classes={};JQClass.extend=function extender(f){var g=this.prototype;j=true;var h=new this();j=false;for(var i in f){h[i]=typeof f[i]=='function'&&typeof g[i]=='function'?(function(d,e){return function(){var b=this._super;this._super=function(a){return g[d].apply(this,a||[])};var c=e.apply(this,arguments);this._super=b;return c}})(i,f[i]):f[i]}function JQClass(){if(!j&&this._init){this._init.apply(this,arguments)}}JQClass.prototype=h;JQClass.prototype.constructor=JQClass;JQClass.extend=extender;return JQClass}})();(function($){JQClass.classes.JQPlugin=JQClass.extend({name:'plugin',defaultOptions:{},regionalOptions:{},_getters:[],_getMarker:function(){return'is-'+this.name},_init:function(){$.extend(this.defaultOptions,(this.regionalOptions&&this.regionalOptions[''])||{});var c=camelCase(this.name);$[c]=this;$.fn[c]=function(a){var b=Array.prototype.slice.call(arguments,1);if($[c]._isNotChained(a,b)){return $[c][a].apply($[c],[this[0]].concat(b))}return this.each(function(){if(typeof a==='string'){if(a[0]==='_'||!$[c][a]){throw'Unknown method: '+a;}$[c][a].apply($[c],[this].concat(b))}else{$[c]._attach(this,a)}})}},setDefaults:function(a){$.extend(this.defaultOptions,a||{})},_isNotChained:function(a,b){if(a==='option'&&(b.length===0||(b.length===1&&typeof b[0]==='string'))){return true}return $.inArray(a,this._getters)>-1},_attach:function(a,b){a=$(a);if(a.hasClass(this._getMarker())){return}a.addClass(this._getMarker());b=$.extend({},this.defaultOptions,this._getMetadata(a),b||{});var c=$.extend({name:this.name,elem:a,options:b},this._instSettings(a,b));a.data(this.name,c);this._postAttach(a,c);this.option(a,b)},_instSettings:function(a,b){return{}},_postAttach:function(a,b){},_getMetadata:function(d){try{var f=d.data(this.name.toLowerCase())||'';f=f.replace(/'/g,'"');f=f.replace(/([a-zA-Z0-9]+):/g,function(a,b,i){var c=f.substring(0,i).match(/"/g);return(!c||c.length%2===0?'"'+b+'":':b+':')});f=$.parseJSON('{'+f+'}');for(var g in f){var h=f[g];if(typeof h==='string'&&h.match(/^new Date\((.*)\)$/)){f[g]=eval(h)}}return f}catch(e){return{}}},_getInst:function(a){return $(a).data(this.name)||{}},option:function(a,b,c){a=$(a);var d=a.data(this.name);if(!b||(typeof b==='string'&&c==null)){var e=(d||{}).options;return(e&&b?e[b]:e)}if(!a.hasClass(this._getMarker())){return}var e=b||{};if(typeof b==='string'){e={};e[b]=c}this._optionsChanged(a,d,e);$.extend(d.options,e)},_optionsChanged:function(a,b,c){},destroy:function(a){a=$(a);if(!a.hasClass(this._getMarker())){return}this._preDestroy(a,this._getInst(a));a.removeData(this.name).removeClass(this._getMarker())},_preDestroy:function(a,b){}});function camelCase(c){return c.replace(/-([a-z])/g,function(a,b){return b.toUpperCase()})}$.JQPlugin={createPlugin:function(a,b){if(typeof a==='object'){b=a;a='JQPlugin'}a=camelCase(a);var c=camelCase(b.name);JQClass.classes[c]=JQClass.classes[a].extend(b);new JQClass.classes[c]()}}})(jQuery);
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* jQuery Plugin to obtain touch gestures from iPhone, iPod Touch and iPad, should also work with Android mobile phones (not tested yet!)
|
||||
* Common usage: wipe images (left and right to show the previous or next image)
|
||||
*
|
||||
* @author Andreas Waltl, netCU Internetagentur (http://www.netcu.de)
|
||||
* @version 1.1.1 (9th December 2010) - fix bug (older IE's had problems)
|
||||
* @version 1.1 (1st September 2010) - support wipe up and wipe down
|
||||
* @version 1.0 (15th July 2010)
|
||||
*/
|
||||
(function($){$.fn.touchwipe=function(settings){var config={min_move_x:20,min_move_y:20,wipeLeft:function(){},wipeRight:function(){},wipeUp:function(){},wipeDown:function(){},preventDefaultEvents:true};if(settings)$.extend(config,settings);this.each(function(){var startX;var startY;var isMoving=false;function cancelTouch(){this.removeEventListener('touchmove',onTouchMove);startX=null;isMoving=false}function onTouchMove(e){if(config.preventDefaultEvents){e.preventDefault()}if(isMoving){var x=e.touches[0].pageX;var y=e.touches[0].pageY;var dx=startX-x;var dy=startY-y;if(Math.abs(dx)>=config.min_move_x){cancelTouch();if(dx>0){config.wipeLeft()}else{config.wipeRight()}}else if(Math.abs(dy)>=config.min_move_y){cancelTouch();if(dy>0){config.wipeDown()}else{config.wipeUp()}}}}function onTouchStart(e){if(e.touches.length==1){startX=e.touches[0].pageX;startY=e.touches[0].pageY;isMoving=true;this.addEventListener('touchmove',onTouchMove,false)}}if('ontouchstart'in document.documentElement){this.addEventListener('touchstart',onTouchStart,false)}});return this}})(jQuery);
|
||||
@@ -0,0 +1,754 @@
|
||||
"use strict";
|
||||
var $ = jQuery;
|
||||
|
||||
//Form Stylization
|
||||
function formStylization(){
|
||||
var radio = 'input[type="radio"]',
|
||||
checkbox = 'input[type="checkbox"]';
|
||||
|
||||
$(radio).wrap('<div class="new-radio"></div>').closest('.new-radio').append('<span></span>');
|
||||
$(checkbox).wrap('<div class="new-checkbox"></div>').closest('.new-checkbox').append('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 13 11" enable-background="new 0 0 13 11" xml:space="preserve"><polyline points="0.2,4.6 1,4 5,9 12,0 12.8,0.6 5.8,9.6 5,10.6 4.2,9.6 0.2,4.6 "/></svg>');
|
||||
$(checkbox + ':checked').parent('.new-checkbox').addClass('checked');
|
||||
$(radio + ':checked').parent('.new-radio').addClass('checked');
|
||||
$(checkbox + ':disabled').closest('.checkbox').addClass('disabled');
|
||||
$(radio + ':disabled').closest('.radio').addClass('disabled');
|
||||
|
||||
$('body').on('click', function(){
|
||||
$(radio).parent('.new-radio').removeClass('checked');
|
||||
$(radio + ':checked').parent('.new-radio').addClass('checked');
|
||||
$(checkbox).parent('.new-checkbox').removeClass('checked');
|
||||
$(checkbox + ':checked').parent('.new-checkbox').addClass('checked');
|
||||
$(radio).closest('.radio').removeClass('disabled');
|
||||
$(checkbox).closest('.checkbox').removeClass('disabled');
|
||||
$(radio + ':disabled').closest('.radio').addClass('disabled');
|
||||
$(checkbox + ':disabled').closest('.checkbox').addClass('disabled');
|
||||
});
|
||||
|
||||
if($.fn.selectpicker){
|
||||
$('select:not(".without-styles")').selectpicker();
|
||||
}
|
||||
}
|
||||
|
||||
//Main Menu
|
||||
function mainMenu(){
|
||||
var menu = $('#main-menu'),
|
||||
link = $('#main-menu a, .go-section'),
|
||||
url = window.location.href,
|
||||
hash = url.substring(url.indexOf('#')),
|
||||
homeId = 'home';
|
||||
|
||||
link.on('click', function(e){
|
||||
var $this = $(this),
|
||||
id = $this.attr('href').split('#').pop(),
|
||||
duration = 1;
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
if (!$('#' + id).length) {
|
||||
console.log('No such section!');
|
||||
return false;
|
||||
}
|
||||
|
||||
link.removeClass('active');
|
||||
|
||||
animateFinish();
|
||||
|
||||
$('.section.active [data-out-animation]').each(function(){
|
||||
var $this = $(this);
|
||||
|
||||
if ($this.data('outAnimationDelay')){
|
||||
if ($this.data('outAnimationDelay') >= duration) {
|
||||
duration = $this.data('outAnimationDelay');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (!$this.hasClass('open')) {
|
||||
link.removeClass('open');
|
||||
|
||||
menu.find('[href="#'+ id +'"]').addClass('active').addClass('open');
|
||||
|
||||
$('body').find('.preloader').delay(duration + 500).fadeIn(400, function() {
|
||||
$('.section').removeClass('active');
|
||||
|
||||
$('#' + id).addClass('active');
|
||||
|
||||
$(this).fadeOut(400);
|
||||
|
||||
setTimeout(function(){
|
||||
contentScroll();
|
||||
animateStart();
|
||||
}, 0);
|
||||
|
||||
document.location.hash = '#' + id;
|
||||
});
|
||||
} else {
|
||||
$('body').find('.preloader').delay(duration + 500).fadeIn(400, function() {
|
||||
link.removeClass('open');
|
||||
|
||||
$('.section').removeClass('active');
|
||||
|
||||
$('#' + homeId).addClass('active');
|
||||
|
||||
$(this).fadeOut(400);
|
||||
|
||||
setTimeout(function(){
|
||||
contentScroll();
|
||||
animateStart();
|
||||
}, 0);
|
||||
|
||||
document.location.hash = '#' + homeId;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (hash != '#')
|
||||
$('[href="'+ hash +'"]').trigger('click');
|
||||
}
|
||||
|
||||
//Animate Start
|
||||
function animateStart(){
|
||||
var activeSection = $('.section.active');
|
||||
|
||||
$('[data-animation]').each(function(){
|
||||
var $this = $(this),
|
||||
animation = 'fadeIn',
|
||||
delay = 1;
|
||||
|
||||
if ($this.data('animation')){
|
||||
animation = $this.data('animation');
|
||||
}
|
||||
|
||||
if ($this.data('animationDelay')){
|
||||
delay = $this.data('animationDelay');
|
||||
}
|
||||
|
||||
if ($this.closest('.section').hasClass('active')){
|
||||
$this.css('animation-delay', delay + 'ms').addClass('animated').addClass(animation);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Animate Finish
|
||||
function animateFinish(){
|
||||
var activeSection = $('.section.active'),
|
||||
duration = 1;
|
||||
|
||||
$('[data-out-animation]').each(function(){
|
||||
var $this = $(this),
|
||||
animation = 'fadeIn',
|
||||
outAnimation = 'fadeOut',
|
||||
delay = 1,
|
||||
outDelay = 1;
|
||||
|
||||
if ($this.data('animation')){
|
||||
animation = $this.data('animation');
|
||||
}
|
||||
|
||||
if ($this.data('outAnimation')){
|
||||
outAnimation = $this.data('outAnimation');
|
||||
}
|
||||
|
||||
if ($this.data('animationDelay')){
|
||||
delay = $this.data('animationDelay');
|
||||
}
|
||||
|
||||
if ($this.data('outAnimationDelay')){
|
||||
outDelay = $this.data('outAnimationDelay');
|
||||
}
|
||||
|
||||
$this.css('animation-delay', delay + 'ms');
|
||||
|
||||
if ($this.closest('.carousel')) {
|
||||
var carousel = $this.closest('.carousel'),
|
||||
carouselAnimate = 'zoomIn';
|
||||
|
||||
if (carousel.data('carouselAnimation')){
|
||||
carouselAnimate = carousel.data('carouselAnimation');
|
||||
}
|
||||
|
||||
$this.removeClass(carouselAnimate);
|
||||
}
|
||||
|
||||
if ($this.closest('.section').hasClass('active')){
|
||||
if (outDelay >= duration) {
|
||||
duration = outDelay;
|
||||
}
|
||||
|
||||
$this.removeClass(animation).addClass(outAnimation);
|
||||
|
||||
if ($this.data('outAnimationDelay')){
|
||||
$this.css('animation-delay', outDelay + 'ms');
|
||||
} else {
|
||||
$this.css('animation-delay', '1ms');
|
||||
}
|
||||
} else {
|
||||
$this.removeClass(animation).removeClass(outAnimation).removeAttr('style', 'animation-delay');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Carousels
|
||||
function carousels(){
|
||||
var carouselBox = $('.carousel-box');
|
||||
|
||||
carouselBox.each(function(){
|
||||
var thisBox = $(this),
|
||||
carousel = $(this).find('.carousel'),
|
||||
animation = 'zoomIn',
|
||||
animationOut = 'zoomOut',
|
||||
items = {0 : {items : 1}, 768 : { items : 3}};
|
||||
|
||||
if (thisBox.data('carouselAnimation')){
|
||||
animation = thisBox.data('carouselAnimation');
|
||||
}
|
||||
|
||||
if (thisBox.data('carouselOutAnimation')){
|
||||
animationOut = thisBox.data('carouselOutAnimation');
|
||||
}
|
||||
|
||||
carousel.owlCarousel({
|
||||
loop : true,
|
||||
margin : 20,
|
||||
pullDrag : false,
|
||||
responsiveClass : true,
|
||||
responsive : items,
|
||||
mouseDrag : false,
|
||||
touchDrag : false,
|
||||
navRewind : false,
|
||||
dots : false
|
||||
}).touchwipe({
|
||||
wipeLeft: function(){
|
||||
thisBox.find('.carousel-controls .next').trigger('click');
|
||||
},
|
||||
wipeRight: function(){
|
||||
thisBox.find('.carousel-controls .prev').trigger('click');
|
||||
},
|
||||
preventDefaultEvents: false
|
||||
});
|
||||
|
||||
carousel.closest('.carousel-box').on('click', '.nav-item', function(e){
|
||||
var item = carousel.find('.owl-item .item');
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
item.css('animation-delay', '1ms');
|
||||
|
||||
item.each(function(){
|
||||
var $this = $(this);
|
||||
|
||||
if ($this.data('animation')){
|
||||
$this.removeClass($this.data('animation'));
|
||||
}
|
||||
|
||||
$this.addClass(animationOut);
|
||||
});
|
||||
|
||||
var event = 'next';
|
||||
|
||||
if ($(this).hasClass('prev')) {
|
||||
event = 'prev';
|
||||
}
|
||||
|
||||
setTimeout(function(){
|
||||
carousel.trigger(event + '.owl.carousel');
|
||||
}, 400);
|
||||
|
||||
setTimeout(function(){
|
||||
item.removeClass(animationOut).addClass(animation);
|
||||
}, 800);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//Google Map
|
||||
function initialize(){
|
||||
var mapCanvas = $('.map-canvas');
|
||||
|
||||
mapCanvas.each(function (){
|
||||
var $this = $(this),
|
||||
zoom = 8,
|
||||
lat = -34,
|
||||
lng = 150,
|
||||
scrollwheel = false,
|
||||
draggable = true,
|
||||
mapType = google.maps.MapTypeId.ROADMAP,
|
||||
title = '',
|
||||
contentString = '';
|
||||
|
||||
if ($this.data('zoom')){
|
||||
zoom = parseFloat($this.data('zoom'));
|
||||
}
|
||||
|
||||
if ($this.data('lat')){
|
||||
lat = parseFloat($this.data('lat'));
|
||||
}
|
||||
|
||||
if ($this.data('lng')){
|
||||
lng = parseFloat($this.data('lng'));
|
||||
}
|
||||
|
||||
if ($this.data('scrollwheel')){
|
||||
scrollwheel = $this.data('scrollwheel');
|
||||
}
|
||||
|
||||
if ($this.data('type')){
|
||||
if ($this.data('type') == 'satellite'){
|
||||
mapType = google.maps.MapTypeId.SATELLITE;
|
||||
} else if ($this.data('type') == 'hybrid'){
|
||||
mapType = google.maps.MapTypeId.HYBRID;
|
||||
} else if ($this.data('type') == 'terrain'){
|
||||
mapType = google.maps.MapTypeId.TERRAIN;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this.data('title')){
|
||||
title = $this.data('title');
|
||||
}
|
||||
|
||||
if( navigator.userAgent.match(/iPad|iPhone|Android/i) ){
|
||||
draggable = false;
|
||||
}
|
||||
|
||||
var mapOptions = {
|
||||
zoom : zoom,
|
||||
scrollwheel : scrollwheel,
|
||||
draggable : draggable,
|
||||
center : new google.maps.LatLng(lat, lng),
|
||||
mapTypeId : mapType,
|
||||
streetViewControl : false
|
||||
};
|
||||
|
||||
var map = new google.maps.Map($this[0], mapOptions);
|
||||
|
||||
var is_internetExplorer11= navigator.userAgent.toLowerCase().indexOf('trident') > -1;
|
||||
var image = ( is_internetExplorer11 ) ? 'img/map-marker.png' : 'img/svg/map-marker.svg';
|
||||
|
||||
if ($this.data('content')){
|
||||
contentString = '<div class="map-content">' +
|
||||
'<h3 class="title">' + title + '</h3>' +
|
||||
$this.data('content') +
|
||||
'</div>';
|
||||
}
|
||||
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: contentString
|
||||
});
|
||||
|
||||
var marker = new google.maps.Marker({
|
||||
position : new google.maps.LatLng(lat, lng),
|
||||
map : map,
|
||||
icon : image,
|
||||
title : title
|
||||
});
|
||||
|
||||
if ($this.data('content')){
|
||||
google.maps.event.addListener(marker, 'click', function(){
|
||||
infowindow.open(map,marker);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Load google maps script
|
||||
function loadScript(){
|
||||
var script = document.createElement('script');
|
||||
script.type = 'text/javascript';
|
||||
script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&' + 'callback=initialize';
|
||||
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
|
||||
window.onload = loadScript;
|
||||
|
||||
//Map
|
||||
function mapBox(){
|
||||
$('.map-show').on('click', function(e){
|
||||
var id = $(this).attr('href');
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
$(id).addClass('active animated zoomIn');
|
||||
});
|
||||
|
||||
$('.map-box .close').on('click', function(e){
|
||||
var mapBox = $(this).closest('.map-box');
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
mapBox.removeClass('zoomIn').addClass('zoomOut');
|
||||
|
||||
setTimeout(function() {
|
||||
mapBox.removeClass('active').removeClass('zoomOut');
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
//HTML5 Video Background
|
||||
function videoBg(){
|
||||
var $this = $('.background-video');
|
||||
|
||||
if ($this.find('video').length){
|
||||
var video = $this.find('video');
|
||||
|
||||
if (video.width() == $this.width()){
|
||||
video.css({
|
||||
marginLeft : 0,
|
||||
marginTop : -((video.height() - $this.height()) / 2)
|
||||
});
|
||||
} else {
|
||||
video.css({
|
||||
marginTop : 0,
|
||||
marginLeft : -((video.width() - $this.width()) / 2)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//YouTube Video Background
|
||||
function youtubeVideoBg(){
|
||||
var $this = $('.background-video');
|
||||
|
||||
if (($this.data('video')) && ($.fn.tubular)){
|
||||
if ($this.find('video').length){
|
||||
$this.find('video').remove();
|
||||
}
|
||||
|
||||
if (!$this.find('.tubular-container').length) {
|
||||
var videoId = '';
|
||||
|
||||
if ($this.data('video')) {
|
||||
videoId = $this.data('video');
|
||||
}
|
||||
|
||||
$this.tubular({
|
||||
videoId : videoId,
|
||||
container : $this
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Slider Background
|
||||
function backgroundSlider() {
|
||||
var slider = $('.background-slider');
|
||||
|
||||
if (slider.length) {
|
||||
var autoplayTimeout = 2000,
|
||||
animateIn = 'fadeIn',
|
||||
animateOut = 'fadeOut';
|
||||
|
||||
if (slider.data('animateIn')) {
|
||||
animateIn = slider.data('animateIn');
|
||||
}
|
||||
|
||||
if (slider.data('animateOut')) {
|
||||
animateOut = slider.data('animateOut');
|
||||
}
|
||||
|
||||
if (slider.data('timeout')) {
|
||||
autoplayTimeout = slider.data('timeout');
|
||||
}
|
||||
|
||||
slider.owlCarousel({
|
||||
animateIn : animateIn,
|
||||
animateOut : animateOut,
|
||||
items : 1,
|
||||
loop : true,
|
||||
autoplay : true,
|
||||
autoplayTimeout : autoplayTimeout
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//Send Email
|
||||
function sendEmail(){
|
||||
$('.send-email').on('click', function(e){
|
||||
var $this = $(this);
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
$.ajax({
|
||||
url : 'php/u-c.php',
|
||||
type : 'POST',
|
||||
data : $this.closest('.under-construction').serialize(),
|
||||
success : function(data){
|
||||
if ($(data).is('.send-true')){
|
||||
$this.addClass('loading').delay(650).queue(function(){
|
||||
$this.addClass('success').addClass('loaded').dequeue();
|
||||
});
|
||||
} else {
|
||||
$this.addClass('error');
|
||||
}
|
||||
|
||||
$this.delay(500).queue(function(){
|
||||
$this.removeClass('loaded').removeClass('loading').dequeue();
|
||||
});
|
||||
|
||||
$this.delay(400).queue(function(){
|
||||
if ($(data).is('.send-true')){
|
||||
$this.removeClass('success').closest('.under-construction').trigger('reset');
|
||||
} else {
|
||||
$this.removeClass('error');
|
||||
}
|
||||
$this.dequeue();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
//Contact Form
|
||||
function contactForm(){
|
||||
$('.btn-submit').on('click',function(e){
|
||||
var $this = $(this);
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
$.ajax({
|
||||
url : 'php/contact.php',
|
||||
type : 'POST',
|
||||
data : $this.closest('.contact-form').serialize(),
|
||||
success : function(data){
|
||||
if ($(data).is('.send-true')){
|
||||
$this.addClass('loading').delay(650).queue(function(){
|
||||
$this.addClass('success').addClass('loaded').dequeue();
|
||||
});
|
||||
} else {
|
||||
$this.addClass('error');
|
||||
}
|
||||
|
||||
$this.delay(500).queue(function(){
|
||||
$this.removeClass('loaded').removeClass('loading').dequeue();
|
||||
});
|
||||
|
||||
$this.delay(400).queue(function(){
|
||||
if ($(data).is('.send-true')){
|
||||
$this.removeClass('success').closest('.contact-form').trigger('reset');
|
||||
} else {
|
||||
$this.removeClass('error');
|
||||
}
|
||||
$this.dequeue();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//Content Scroll
|
||||
function contentScroll(){
|
||||
var section = $('.section.active');
|
||||
|
||||
if (section.length && $.fn.mCustomScrollbar) {
|
||||
section.each(function (){
|
||||
var $this = $(this);
|
||||
|
||||
if (($this.height() - 40) < $this.find('.container').height()) {
|
||||
$this.addClass('scroll-content');
|
||||
|
||||
if(!navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|Windows Phone)/)){
|
||||
$this.find('.section-content').mCustomScrollbar({
|
||||
scrollInertia : 100
|
||||
});
|
||||
}
|
||||
} else {
|
||||
$this.removeClass('scroll-content');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//Notify My
|
||||
function notifyMy(){
|
||||
var margin = 70;
|
||||
|
||||
if (($('body').height() < 600) || ($('body').width() < 768)) {
|
||||
margin = 0;
|
||||
}
|
||||
|
||||
$('.notify-my .modal-dialog').css('margin-top', (($('body').height() - $('.notify-my .modal-dialog').height()) / 2) - margin);
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
'use strict';
|
||||
|
||||
var isTouchDevice = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|Windows Phone)/);
|
||||
|
||||
//Touch device
|
||||
if(isTouchDevice){
|
||||
$('body').addClass('touch-device');
|
||||
$('.background-video').remove();
|
||||
}
|
||||
|
||||
//Bootstrap Elements
|
||||
$('[data-toggle="tooltip"], .tooltip-link').tooltip();
|
||||
|
||||
$('a[data-toggle=popover]')
|
||||
.popover()
|
||||
.on('click', function(e){
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$('.disabled, fieldset[disabled] .selectBox').on('click', function (){
|
||||
return false;
|
||||
});
|
||||
|
||||
//Functions
|
||||
formStylization();
|
||||
mainMenu();
|
||||
mapBox();
|
||||
youtubeVideoBg();
|
||||
sendEmail();
|
||||
contactForm();
|
||||
backgroundSlider();
|
||||
|
||||
//Functions(load)
|
||||
$(window).on('load', function(){
|
||||
animateStart();
|
||||
carousels();
|
||||
videoBg();
|
||||
contentScroll();
|
||||
|
||||
//Preloader
|
||||
$('body').delay(500).addClass('loaded').find('.preloader').fadeOut(400);
|
||||
});
|
||||
|
||||
//Notify me (MailChimp)
|
||||
if (($('.mailchimp').length) && ($.fn.ajaxChimp)) {
|
||||
$('.mailchimp').ajaxChimp({
|
||||
url: 'http://us10.list-manage.com/subscribe/post?u=69007f000c70b89e124b9308d&id=1225ba8aee'
|
||||
});
|
||||
}
|
||||
|
||||
//Retina
|
||||
if('devicePixelRatio' in window && window.devicePixelRatio >= 2){
|
||||
var imgToReplace = $('img.replace-2x').get();
|
||||
|
||||
for (var i=0,l=imgToReplace.length; i<l; i++){
|
||||
var src = imgToReplace[i].src;
|
||||
|
||||
src = src.replace(/\.(png|jpg|gif)+$/i, '@2x.$1');
|
||||
|
||||
imgToReplace[i].src = src;
|
||||
|
||||
$(imgToReplace[i]).on('load', function(){
|
||||
$(this).addClass('loaded');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//Count Down
|
||||
if (($('.countdown').length) && ($.fn.countdown)) {
|
||||
var countdown = $('.countdown');
|
||||
|
||||
countdown.each(function (){
|
||||
var $this = $(this),
|
||||
austDay = new Date(2016, 1-1, 1);
|
||||
|
||||
if ($this.data('date')){
|
||||
var date = $this.data('date').split(' ');
|
||||
|
||||
austDay = new Date(parseFloat(date[0]), parseFloat(date[1]) - 1, parseFloat(date[2]));
|
||||
}
|
||||
|
||||
$this.countdown({
|
||||
until : austDay,
|
||||
format : 'DHMS',
|
||||
significant : 1,
|
||||
description : ' left'
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//Notify My
|
||||
$('.notify-my').on('shown.bs.modal', function () {
|
||||
notifyMy();
|
||||
});
|
||||
|
||||
//Vimeo Start/Stop
|
||||
$('.modal').on('shown.bs.modal', function (e) {
|
||||
var video = $(this).find('.vimeo-video iframe');
|
||||
|
||||
if (video.length && video.closest('.vimeo-video').data('autoplay')) {
|
||||
var player = $f(video[0]);
|
||||
|
||||
player.api('play');
|
||||
}
|
||||
});
|
||||
|
||||
$('.modal').on('hidden.bs.modal', function (e) {
|
||||
var video = $(this).find('.vimeo-video iframe');
|
||||
|
||||
if (video.length) {
|
||||
var player = $f(video[0]);
|
||||
|
||||
player.api('pause');
|
||||
}
|
||||
});
|
||||
|
||||
//Twitter
|
||||
if ($('.twitter-widget').length){
|
||||
!function(d,s,id){
|
||||
var js,
|
||||
fjs=d.getElementsByTagName(s)[0],
|
||||
p=/^http:/.test(d.location)?'http':'https';
|
||||
|
||||
if(!d.getElementById(id)){
|
||||
js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';
|
||||
fjs.parentNode.insertBefore(js,fjs);
|
||||
}
|
||||
}(document,'script','twitter-wjs');
|
||||
|
||||
window.setTimeout(function() {
|
||||
$('.twitter-timeline').contents().find('.footer').css('display', 'none');
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
//Pin It
|
||||
if ($('[data-pin-do]').length){
|
||||
!function(a,b,c){
|
||||
var d,e,f;
|
||||
|
||||
f='PIN_'+~~((new Date).getTime()/864e5),a[f]||(a[f]=!0,a.setTimeout(function(){
|
||||
d=b.getElementsByTagName('SCRIPT')[0],
|
||||
e=b.createElement('SCRIPT'),
|
||||
e.type='text/javascript',
|
||||
e.async=!0,
|
||||
e.src=c+'?'+f,
|
||||
d.parentNode.insertBefore(e,d)
|
||||
},10))
|
||||
}(window,document,'//assets.pinterest.com/js/pinit_main.js');
|
||||
}
|
||||
});
|
||||
|
||||
//Window Resize
|
||||
(function(){
|
||||
var delay = (function(){
|
||||
var timer = 0;
|
||||
return function(callback, ms){
|
||||
clearTimeout (timer);
|
||||
timer = setTimeout(callback, ms);
|
||||
};
|
||||
})();
|
||||
|
||||
function resizeFunctions(){
|
||||
//Functions
|
||||
videoBg();
|
||||
contentScroll();
|
||||
notifyMy();
|
||||
}
|
||||
|
||||
if(navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|Windows Phone)/)){
|
||||
$(window).on('orientationchange', function(){
|
||||
resizeFunctions();
|
||||
});
|
||||
} else {
|
||||
$(window).on('resize', function(){
|
||||
delay(function(){
|
||||
resizeFunctions();
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
}());
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user