Slide Script for Developers
Slide Script for Developers
_____ _ _ _ _____
/ ___/| (*) | | | |/ ___/ v 4.1
| (___ | |_ __| | ___ ____ | | (___
\___ \| | |/ _` |/ _ / __/ _ | |\___ \
____) | | | (_| | __\__ \ | |__| |____) |
/_____/|_|_|\__,_|\___/___/ \____//_____/
This file contains scripts required for the proper functionality and
display
of your Slides Project. It also requires [Link] and jquery-3.3.1 to
run this script properly.
[Link]
*/
[Link] = 1;
[Link] = 1;
[Link] = 1;
[Link] = 500;
[Link] = 1000;
[Link] = 1000;
[Link] = 1400;
[Link] = 0;
[Link] = 0;
[Link] = 0;
[Link] = 0;
[Link] = 0.5;
[Link] = 1;
[Link] = 1;
[Link] = 1;
[Link] = 0;
[Link] = 0;
[Link] = 500;
[Link] = 4;
[Link] = 0;
[Link] = 100;
[Link] = 1;
[Link] = 1;
//Detect mode
[Link] = $[Link]('scroll');
[Link] = $[Link]('simplifiedMobile');
if ([Link] || [Link] && [Link]) {
$[Link]('scrollable'); }
$[Link]('page-ready');
//Set speed
if ($[Link]('fast')){
//fast
[Link] = 700;
[Link] = 1200;
[Link] = 800;
[Link] = 0.35;
[Link] = 400;
} else if ($[Link]('slow')){
//slow
[Link] = 1400;
[Link] = 2000;
[Link] = 1400;
[Link] = 400;
[Link] = .8;
[Link] = 600;
}
//Horizonal Mode
if ($[Link]('horizontal')){
[Link] = 1;
}
//Preload
if ($[Link]('noPreload')){
[Link] = 0;
}
//Is it animated?
if ($[Link]('animated')){
[Link] = "auto";
} else if ($[Link]('animateOnEvent')) {
[Link] = "animateOnEvent";
if ([Link]) {
[Link] = "auto";
$[Link]('animateOnEvent').addClass('animated');
}
}
if (![Link]) {
[Link] = 0;
}
$('html,body').stop().clearQueue().animate({scrollTop:[Link]
sition().top},[Link]);
} else {
$(window).on('load', function(){
$('html,body').stop().clearQueue().animate({scrollTop:[Link]
sition().top},[Link]);
});
}
}
} else {
//slide mode
[Link] = $('.slide').index(requestedElement) + 1;
showSlide([Link]);
}
}
}
}
updateHash();
[Link] = [Link];
[Link] = $('.progress-bar');
//show progress
function updateProgressBar(){
//loading
var progress = [Link]/[Link];
// animate
[Link]('width',progress * 100 + "%");
if ([Link] == [Link]) {
[Link]('loaded');
}
}
updateProgressBar();
}
//Initiate slide
showSlide([Link]);
$('.[Link]').masonry({
itemSelector: 'li',
transitionDuration: '0.1s'
});
$('.[Link]').imagesLoaded().progress( function() {
$('.[Link]').masonry('layout');
});
if (![Link]) {
$(window).on('load', function(){
runTheCode();
});
}
function runTheCode(){
$[Link]('page-loaded');
[Link] = 0;
[Link] = 0;
[Link] = 1;
setTimeout(function(){
if ([Link]){
updateScroll();
updateNavigation();
} if ([Link] && [Link]){
$('.slide').addClass('selected animate active');
updateScroll();
updateNavigation();
} else {
showSlide([Link]);
}
},500);
}
/***
* _____ _ _ _ _____ _
* / ____| (_) | | / ____| |
* | (___ | |_ __| | ___ | | | |__ __ _ _ __ __ _ ___
* \___ \| | |/ _` |/ _ \ | | | '_ \ / _` | '_ \ / _` |/ _ \
* ____) | | | (_| | __/ | |____| | | | (_| | | | | (_| | __/
* |_____/|_|_|\__,_|\___| \_____|_| |_|\__,_|_| |_|\__, |\___|
* __/ |
* Slide Appearance Manager |___/
*/
function showSlide(requested){
requested = parseInt(requested);
updateNavigation();
//cleanup
hideDropdown();
unzoomImage();
hideSidebar();
[Link] = 1;
//reset
$[Link]('sidebarShown lastSlide firstSlide hidePanel-top
hidePanel-bottom');
$[Link]("stage-").addClass('stage-
'+[Link]);
}
//white slide?
if ( [Link]('whiteSlide') ){
$[Link]('whiteSlide');
} else {
$[Link]('whiteSlide');
}
//set order
[Link]('.slide').addClass('before').removeClass('after');
[Link]('.slide').addClass('after').removeClass('before');
//set a trigger
$(window).trigger("slideChange", [parseInt(requested), newSlide]);
}
//set hash
if ([Link]){
if ([Link]('data-name') || [Link]('id')) {
[Link] = ([Link]('data-name')) ?
[Link]('data-name') : [Link]('id');
} else if
(([Link]().indexOf('#')>0)&&([Link] !==
"file:")&&([Link]('#')[0])){
if ([Link]) {
[Link]("", "", [Link]('#')[0]);
} else {
[Link] = "";
}
}
}
if ([Link]){
//wait for animation
[Link] = 1;
setTimeout(function(){
if (currenSlideIndex !== requested){
[Link]('active animate');
}
setTimeout(function(){
[Link]('animate');
},[Link] - [Link]);
clearTimeout([Link]);
[Link] = setTimeout(function(){
$(".[Link] [class*='ae-']").addClass('done');
}, [Link] + [Link] + [Link]);
}
//end showSlide();
}
//Change slide
[Link] = function(n){
if (n === "increase"){
if (([Link] + 1) >= [Link]){
n = [Link];
} else {
n = [Link] + 1;
}
} else if (n === "decrease"){
if (([Link] - 1) < 1){
n = 1;
} else {
n = [Link] - 1;
}
}
$('html,body').stop().clearQueue().animate({scrollTop:finalPosition},1000
);
} else {
if ((n !== [Link])&&( n <= [Link])){
if ([Link] !== 1){
[Link] = 1;
[Link] = n;
var delay = 0;
if ($('.zoom-overlay-open').length > 0) {
unzoomImage();
delay = 550;
}
setTimeout(function(){
showSlide([Link]);
setTimeout(function(){ [Link] = 0; },
[Link]);
}, delay);
}
}
}
};
$('.nextSlide').on('click', function(){
[Link]('increase');
});
$('.prevSlide').on('click', function(){
[Link]('decrease');
});
$('.toFirstSlide').on('click', function(){
[Link](1);
if ([Link]) {
[Link]("", "", [Link]('#')[0]);
} else {
[Link] = "";
}
hideSidebar();
});
$('.toLastSlide').on('click', function(){
[Link]([Link]);
if ([Link]) {
[Link]("", "", [Link]('#')[0]);
} else {
[Link] = "";
}
hideSidebar();
});
$('[class*="toSlide-"]').on('click', function(){
var num = parseInt($(this).attr('class').split('toSlide-')[1].split('
')[0]);
[Link](num);
hideSidebar();
});
if (type) {
$('.zoom-img-wrap, .zoom-overlay').remove();
}
}
}
//set
$(window).on('resize load ready',function(){
//cleanup after image zoom
$('[data-action="zoom"]').removeAttr('style');
if ($('.zoom-overlay').length > 0){
unzoomImage('fast');
}
//common stuff
[Link] = $(window).height();
[Link] = $(window).width();
[Link] = $(document).height();
});
/*** *
* | | |
* |
* _____ * _ _
* / ____| | | | |
* | (___ ___ _ __ ___ | | |
* \___ \ / __| '__/ _ \| | |
* ____) | (__| | | (_) | | |
* |_____/ \___|_| \___/|_|_|
*
* Scrolling
*/
var eventCount = 0,
eventCountStart;
//scroll mode
if ([Link] &&
((![Link])&&(![Link])&&(![Link]))) {
//smooth scroll
if ([Link] && ![Link]){
[Link](scrollObject, [Link], {
scrollTo : { y: finalScroll, autoKill:false },
ease: [Link],
overwrite: "all"
});
} else {
if (![Link]){
$[Link](curSecScrolltop - energy);
}
}
}
//slide mode
if ( ![Link] && !([Link] &&
[Link])){
$[Link]('hidePanel-bottom');
if
((![Link])&&(![Link])&&(![Link])) {
if ([Link]){
//lock default scroll
[Link]();
//smooth scroll
if (energy > 1500) { energy = 1500; }
if (energy < -1000) { energy = -1500; }
[Link]($currentSection, 0.5, {
scrollTo : { y: curSecScrolltop - energy, autoKill:false },
ease: [Link],
overwrite: 5
});
} else {
curSecScrolltop = (scrollDirection === "up") ?
curSecScrolltop - scrollsize : curSecScrolltop + scrollsize;
$[Link](curSecScrolltop);
}
}
//end scroll oversized content
}
[Link] = 0;
//should we even..
if ((scrollDirection === "down" && [Link] !==
[Link])||(scrollDirection === "up" && [Link] !== 1)){
//ok let's go
if ([Link] !== 1){
if (scrollDirection === "down"){
[Link]('increase');
} else {
[Link]('decrease');
}
}
}
}
}
//end on mousewheel event
});
function updateScroll(){
//Hide dropdown
hideDropdownOnScrollDelay++;
if (hideDropdownOnScrollDelay >= 2){
hideDropdown();
hideDropdownOnScrollDelay = 0;
}
$('.slide').each(function(index, element) {
if ([Link] != 0) {
if (halfOnScreen && allowToSelect) {
//set order
$[Link]('.slide').addClass('before').removeClass('after');
$[Link]('.slide').addClass('after').removeClass('before');
$[Link]('selected animate active').removeClass('after
before');
//set a trigger
$(window).trigger("slideChange", [[Link], $element]);
if ([Link] == "auto") {
//clearTimeout([Link]);
[Link] = setTimeout(function(){
$[Link]("[class*='ae-']").addClass('done');
}, [Link] + [Link]);
}
updateNavigation();
}
if (![Link]){
[Link] = 1;
$(window).trigger("slideChange", [[Link], $element]);
}
} else {
$[Link]('selected');
}
}
//Parallax background
if ((scale > -1 && scale < 1) && !([Link] &&
[Link])) {
if ($[Link]('parallax') || $[Link]('.parallax-
element')){
$[Link]('.parallax-element').each(function() {
var $el = $(this),
velocity = parseInt($[Link]('parallax-velocity')) ?
parseInt($[Link]('parallax-velocity')) : 50,
precentage = scale * velocity;
if (![Link]) {
$("[class*='ae-']").each(function(i, element) {
var $ae = $(element);
if (isElementInView($ae)) {
$[Link]("do").one('webkitAnimationEnd oanimationend
msAnimationEnd animationend', function(){
$(this).removeClassByPrefix('ae-
').removeClass("do").addClass("done");
});
}
});
} else if ([Link]){
$("[class*='ae-']").each(function(i, element) {
var $ae = $(element);
if (isElementInView($ae)) {
$[Link]("do").one('webkitAnimationEnd oanimationend
msAnimationEnd animationend', function(){
$(this).removeClassByPrefix('ae-
').removeClass("do").addClass("done");
});
}
});
}
}
}
function isElementInView(element) {
var pageTop = $(window).scrollTop(),
$element = $(element),
elementHeight = $[Link](),
pageBottom = pageTop + [Link],
elementTop = $[Link]().top,
elementBottom = elementTop + elementHeight;
/***
* _____
* / ____| (*)
* | (_____ ___ _ __ ___
* \___ \ \ /\ / / | '_ \ / _ \
* ____) \ V V /| | |_) | __/
* |_____/ \_/\_/ |_| .__/ \___|
* | |
* |_|
*
* Swipes for mobile devices
*/
$('.mobile .slides:not(.scroll):not(.simplifiedMobile),
.[Link]').swipe({
swipeStatus:function(event, phase, direction, distance){
[Link] = 1;
[Link] = 1;
if ([Link]){
$currentSection = $('.sidebar .content');
}
if ([Link]){
$currentSection = $('.popup .content');
}
//horizontal mode
if ([Link]){
next = "left";
prev = "right";
}
//lock slide
if ( ![Link] && ( currentSectionHeight >
windowHeight) ){
if ([Link] + windowHeight < currentSectionHeight){
[Link] = 0;
}
if ([Link] > 0) {
[Link] = 0;
}
}
$('.[Link] *').on('click',function(){
$(this).addClass('selectable');
});
/***
* _____ _
* | __ \ | |
* | |__) |_ _ _ __ ___| |___
* | ___/ _` | '_ \ / _ \ / __|
* | | | (_| | | | | __/ \__ \
* |_| \__,_|_| |_|\___|_|___/
*
* Responsive Panels
*/
$(desktop).addClass('hidden');
$(compact).removeClass('hidden');
} else {
$(desktop).removeClass('hidden');
$(compact).addClass('hidden');
var totalWidth = 0;
[Link]().each(function(){
if ( $(this).outerWidth() > $(this).children().outerWidth()
){
totalWidth += [Link]($(this).outerWidth());
} else {
totalWidth += [Link]($(this).children().outerWidth());
}
});
});
});
}
if ([Link] || [Link]){
var lastScrollTop,
i = 0,
sensitivity = [Link] ?
[Link] : 100,
panelToHide = $('.[Link]');
/***
* _ __
* | |/ /
* | ' / ___ _ _ ___
* | < / _ \ | | / __|
* | . \ __/ |_| \__ \
* |_|\_\___|\__, |___/
* __/ |
* |___/
*
* Listen the Keys
*/
$(document).on("keydown",function(e){
var delta = 2.5,
scrollTime = 0.3,
scrollDistance = 50,
$currentSection = $('.[Link] .content'),
scrollTop = $[Link](),
finalScroll = scrollTop + parseInt(delta * scrollDistance);
if ([Link] ||
[Link]() == 'input' ||
[Link]() == 'textarea') {
return;
}
/* [ ‚Üê ] */
if ([Link] === 37){
[Link]();
if ([Link]){ [Link]('decrease'); }
}
/* [ ‚Üë ] */
if ([Link] === 38){
if (![Link]){
[Link]();
[Link]('decrease');
} else {
[Link]();
[Link]($currentSection, [Link], {
scrollTo : { y: finalScroll, autoKill:true },
ease: [Link],
overwrite: 5
});
}
}
/* [ ‚Üí ] */
if ([Link] === 39){
if ([Link]){
[Link]();
[Link]('increase');
}
}
/* [ ‚Üì ] */
if ([Link] === 40){
if (![Link]) {
[Link]();
[Link]('increase');
} else {
[Link]();
[Link]($currentSection, [Link], {
scrollTo : { y: finalScroll, autoKill:true },
ease: [Link],
overwrite: 5
});
}
}
/* [ esc ] */
if ([Link] === 27){
hideSidebar();
hideDropdown();
hidePopup();
unzoomImage();
}
});
/***
* _ _ _
* | \ | | (*) | | (*) *
* | \| | __ ___ ___ __ _ __ _| |_ _ ___ _ __ *
* | . ` |/ _` \ \ / | |/ _` |/ _` | __| |/ _ \| '_ \ (*) [Tooltip]
* | |\ | (_| |\ V /| | (_| | (_| | |_| | (_) | | | | *
* |_| \_|\__,_| \_/ |_|\__, |\__,_|\__|_|\___/|_| |_| *
* __/ |
* /___/
*
* Generate Navigation Dots and Tootlips
*/
if ($(navigation).length > 0) {
if ($(navigation).is(':empty')) {
$(navigation).each(function(index, element) {
for (var i = 1; i <= slidesNumber; i++){
// Add Tooltips
var title = $('.slide:not(.exclude):eq('+(i -
1)+')').data('title');
if (title === undefined) {
$(element).append('<li></li>');
} else {
$(element).append('<li data-title="'+title+'"></li>');
}
}
});
}
//Navigation clicks
$('.navigation li').on("click touchend", function(){
var thisIndes = $(this).index(),
realIndex =
$('.slide:not(.exclude):eq('+thisIndes+')').index('.slide');
$(this).blur();
[Link](realIndex + 1);
});
if (!$('.side').hasClass('compact')){
//Collapse sidemenu to compact
$(window).on('load resize ready',function(){
var containerHeight = [Link] - 140,
container = $('.side').removeClass('compact').find('ul'),
totalWidth = 0;
$(container).children().each(function(){
totalWidth += [Link]($(this).outerHeight(true));
});
[Link]();
$('html,body').stop().clearQueue().animate({scrollTop:[Link]().t
op},1000);
}
if ([Link]){
[Link] = hashLink;
}
} else {
[Link] = $('.slide').index(requestedElement) + 1;
showSlide([Link]);
}
hideSidebar();
}
});
//Update Navigation
function updateNavigation(){
setTimeout(function(){
if ( $(navigation).length > 0 ){
$(navigation).each(function(index, element) {
$(element).find('[Link]').removeClass('selected');
$('.sidebarTrigger[data-sidebar-id]').on('click', function(){
});
[Link] = function(id){
var sidebarID = id,
element = $('.sidebar[data-sidebar-id="' + sidebarID + '"]'),
isAnimated = $(element).hasClass('animated');
if (![Link]){
if ([Link] > 0) {
[Link] = 1;
[Link] = 0;
$(element).removeClass('animate active').addClass('visible');
$[Link]('sidebarShown sidebar_' + sidebarID);
$(element).find('.content').scrollTop(0);
if (isAnimated){
clearTimeout([Link]);
setTimeout(function(){
$(element).addClass('animate active');
},100);
}
}
} else {
hideSidebar();
}
//clean up
hideDropdown();
function hideSidebar(){
if ([Link]){
$[Link]('sidebarShown').removeClassByPrefix('sidebar_');
var $sidebar = $('.[Link]');
$[Link]('visible');
[Link] = setTimeout(function(){
$[Link]('animate
active').find('.done').removeClass('done');
},500);
[Link] = 0;
[Link] = 1;
}
}
/***
* _____ __
* | __ \ _ _ _ __ | |_
* | |__) ___ _ __ | | | | '_ \ |__| |
* | ___/ _ \| '_ \| | | | |_) | |__|
* | | | (_) | |_) \__,_| .__/
* |_| \___/| .__/ | |
* | | |_|
* PopUp |_|
*/
$('.popupTrigger[data-popup-id]').on('click', function(){
var popupID = $(this).data('popup-id');
[Link](popupID);
});
[Link] = function(id){
var popupID = id,
element = $('.popup[data-popup-id="' + popupID + '"]'),
isAnimated = [Link]('animated');
if ([Link] > 0) {
hideSidebar();
$(element).addClass('visible');
//set a trigger
$(window).trigger('popupShown');
if (isAnimated){
setTimeout(function(){
$(element).addClass('animate active');
clearTimeout([Link]);
[Link] = setTimeout(function(){
$(element).find("[class*='ae-']").addClass('done');
}, [Link] + [Link]);
},100);
}
//Autoplay Iframe
if ($(element).hasClass('autoplay')){
var $element = $(element),
iframe = $[Link]('iframe'),
HTML5video = $[Link]('video');
if ( [Link] > 0 ) {
var iframeSrc = $(iframe).attr('src'),
symbol = ([Link]('?') > -1) ? "&" : "?";
//clean up
hideDropdown();
}
function hidePopup(popupID) {
popupID = typeof popupID !== 'undefined' ? popupID : false;
if ( $.isArray([Link]) ){
$(element).attr('src',
$(element).attr('src').replace(symbol+'autoplay=1',''));
});
}
//stop videos
if ([Link] > 0) {
$(video).each(function(n, element){
$(element)[0].pause();
$(element)[0].currentTime = 0;
});
}
setTimeout(function(){
[Link] = 1;
if ([Link] <= 0) {
$[Link]('popupShown');
[Link] = false;
}
}, 500);
}
}
$(window).on('popupHidden', function(){
if ([Link]) {
[Link]("", "", [Link]('#')[0]);
} else {
[Link] = "";
}
});
}
}
/***
* _____ ______ ______ ______
* / ____| | ____| ____| ____|
* | | __ __ _| |__ | |__ | |__
* | | |_ |/ _` | __| | __| | __|
* | |__| | (_| | | | |____| |____
* \_____|\__,_|_| |______|______|
*
* Grid and Flex Element Equalizer
*/
setTimeout(function(){
equalizeElements();
}, 1);
});
function equalizeElements(){
$(el).css('height','auto');
});
//apply
$(element).find('.equalElement').each(function(index, el) {
$(el).css('height', height + "px");
});
} else {
$(equalElement).css("height", "auto");
}
});
}
}
//Detect Resize
$(window).on('resize',function(){
$[Link]('resizing');
}).on('resizeEnd',function(){
$[Link]('resizing');
});
/***
* _____ _ _ _
* / ____| (_) | |
* | (___ | |_ __| | ___ _ __
* \___ \| | |/ _` |/ _ \ '__|
* ____) | | | (_| | __/ |
* |_____/|_|_|\__,_|\___|_|
*
* Slider * *(*)* *
*/
if ($(sliderEl).length > 0) {
$(sliderEl).each(function(index, element) {
//check status
var $el = $(element),
sliderID = $[Link]('slider-id'),
nextIndex = $[Link]('.selected').index();
//set status
if ([Link]) {
$[Link]("slider_" +
sliderID).addClass("slider_" + sliderID + "_" + nextIndex);
}
//autoplay
if ($[Link]('autoplay')) {
//clickable
if ($[Link]('clickable') || $[Link]('autoplay')){
$[Link]('click next', function(event){
//uselect old
$[Link]('selected').addClass('hide').one('webkitTransitionE
nd otransitionend oTransitionEnd msTransitionEnd transitionend',
function() {
$(this).removeClass('hide');
});
//select next
$[Link]('hide').addClass('selected');
//set status
if ([Link]) {
$[Link]("slider_" +
sliderID).addClass("slider_" + sliderID + "_" + nextIndex);
}
//animated
if (isAnimated) {
$[Link]('animateOnEvent');
$[Link]('li').removeClassByPrefix('ae-').removeClass('do');
$[Link]('.selected').each(function(index){
$(this).removeClassByPrefix('ae-
').removeClass('do').addClass('ae-' + (index + 1)).addClass('do');
});
$(window).scroll();
}
$[Link]('li:eq('+nextIndex+')').addClass('selected');
}
});
}
});
}
// controller
var $controller = $('.controller');
if ($[Link] > 0) {
if (!$[Link]('selected')){
$[Link]('selected');
$[Link]('selected');
$[Link]('.selected').removeClass('selected').addClass('hide').on
e('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd
transitionend', function() {
$(this).removeClass('hide');
});
$[Link]('li').eq(nextIndex).removeClass('hide').addClass('select
ed');
//set status
if ([Link]) {
$[Link]("slider_" +
sliderID).addClass("slider_" + sliderID + "_" + nextIndex);
}
}
//is animated
if (isAnimated) {
$[Link]('animateOnEvent');
$[Link]('>li').removeClassByPrefix('ae-').removeClass('do');
$[Link]('.selected').each(function(index){
$(this).removeClassByPrefix('ae-
').removeClass('do').addClass('ae-' + (index + 1)).addClass('do');
});
$(window).scroll();
}
});
}
if ($(this).data('slider-id')){
var $this = $(this),
$desiredElement, nextIndex,
sliderID = $[Link]('slider-id'),
action = $[Link]('slider-action'),
$slider = $('.slider[data-slider-id="' + sliderID + '"]'),
$controller = $('.controller[data-slider-id="'+sliderID+'"]'),
controllerSelector = $[Link]('controller-selector') ?
$[Link]('controller-selector') : "li",
$selected = $[Link]('.selected'),
isAnimated = $[Link]('animated');
//detect direction
if (action === "next"){
$desiredElement = $[Link]("li");
} else if (action === "prev") {
$desiredElement = $[Link]("li");
} else if (parseInt(action) || action === 0 ) {
nextIndex = parseInt(action);
$desiredElement =$[Link]('>li:eq(' + nextIndex + ")");
}
//select element
nextIndex = $[Link]();
$[Link]('selected');
$[Link]('hide').addClass('selected');
//set status
if ([Link]) {
$[Link]("slider_" +
sliderID).addClass("slider_" + sliderID + "_" + nextIndex);
}
//is animated
if (isAnimated) {
$[Link]('animateOnEvent');
$[Link]('li').removeClassByPrefix('ae-').removeClass('do');
$[Link]('.selected').each(function(index){
$(this).removeClassByPrefix('ae-
').removeClass('do').addClass('ae-' + (index + 1)).addClass('do');
});
$(window).scroll();
}
//change controller
if ((sliderID) && ($[Link] > 0) ){
$[Link]('.selected').removeClass('selected').addClass('hide').on
e('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd
transitionend', function() {
$[Link]('hide');
});
$[Link](controllerSelector).eq(nextIndex).addClass('selected');
}
}
});
//Auto Height
$('[data-slider-id].autoHeight').each(function(index, element) {
$(window).on('click resize load ready next',function(){
var totalHeight = 0,
el = $(element).find('.selected');
$(element).find('.selected').children().each(function(){
totalHeight += [Link]($(this).outerHeight(true));
});
$(element).height(totalHeight + "px");
});
});
$(".[Link][data-slider-id], .controller[data-slider-
id]").on('click', function(event){
if($([Link]).data('slider-event') != "cancel")
$(window).resize();
});
/***
* _____ _
* | __ \ | |
* | | | |_ __ ___ _ __ __| | _____ ___ __
* | | | | '__/ _ \| '_ \ / _` |/ _ \ \ /\ / / '_ \
* | |__| | | | (_) | |_) | (_| | (_) \ V V /| | | |
* |_____/|_| \___/| .__/ \__,_|\___/ \_/\_/ |_| |_|
* | |
* |_|
*
* Dropdown Window and Share
*/
[Link] = false;
//click
$('.dropdownTrigger').on('click', function(){
showDropdown($(this));
});
//hover
$('.[Link]').hover(function(){
showDropdown($(this), "hover");
});
//show
var offset = $[Link](),
position = $[Link](),
offsetY = [Link] ? [Link]([Link]) :
[Link]([Link]),
offsetX = [Link]([Link]),
dropdownID = $[Link]('dropdown-id'),
$element = $('.dropdown[data-dropdown-id="' + dropdownID + '"]'),
elementPosition = $[Link]('dropdown-position') ?
$[Link]('dropdown-position') : $[Link]('class'),
elementPosition = [Link](' ');
//hide
if (!$isHover) {
hideDropdown();
}
//vertical position
if ( [Link]('bottom') != -1 ) {
offsetY = offsetY - $[Link]();
$[Link]('top').addClass('bottom');
} else {
offsetY = offsetY + $[Link]();
$[Link]('bottom').addClass('top');
}
//horizontal position
if ( [Link]('right') != -1 ) {
offsetX = offsetX - $[Link]() + $[Link]();
$[Link]('left center').addClass('right');
} else if ( [Link]('left') != -1 ) {
$[Link]('right center').addClass('left');
} else if ( [Link]('center') != -1 ) {
offsetX = offsetX - ($[Link]()/2) +
($[Link]()/2);
$[Link]('right left').addClass('center');
}
$[Link]('show').css('top',offsetY).css('left',offsetX);
$[Link]('dropdownShown dropdown_' + dropdownID);
[Link] = true;
}
function hideDropdown(){
//hide
if ([Link]){
$[Link]('dropdownShown').removeClassByPrefix('dropdown_');
[Link] = false;
hideDropdownOnScrollDelay = 0;
$('.[Link]').addClass('hide').one('webkitTransitionEnd
otransitionend msTransitionEnd transitionend', function(){
$(this).removeClass('show hide')
$[Link]('dropdownShown').removeClassByPrefix('dropdown_');;
});
$(window).trigger('dropdownHidden');
}
}
//remove on resize
$(window).on('resize',function(){
hideDropdown();
});
$('.share').sharrre({
enableHover: false,
url: [Link],
text: [Link],
enableCounter: false,
share: {
twitter: true,
facebook: true,
pinterest: true,
googlePlus: true,
stumbleupon: true,
linkedin: true
},
buttons: {
pinterest: {
media: $('.dropdown').data('pinterest-image'),
description: $('.dropdown').data('text') + " " +
$('.dropdown').data('url')
}
},
template: $('.share').html(),
render: function(api) {
//open email
[Link] ="[Link] + encodeURIComponent(
subject ) + "&body=" + encodeURIComponent( body ) + "%20" + url;
});
}
});
/***
* _____ _ _
* | __ \(_) | |
* | | | |_ __ _| | ___ __ _
* | | | | |/ _` | |/ _ \ / _` |
* | |__| | | (_| | | (_) | (_| |
* |_____/|_|\__,_|_|\___/ \__, |
* __/ |
* |___/
* Dialog Windows
*/
[Link](dialogID)
});
if (!$[Link](':visible')){
$[Link]('reveal').slideDown(500,function(){
$(this).removeClass('reveal').removeClass('hidden');
});
}
}
$[Link]('hide').slideUp(500,function(){
$(this).removeClass('hide');
if ($.cookie(cookieName)){
$(element).hide();
}
});
//links
$('.dialog [data-href]').on('click', function(){
if ($(this).data('target')){
[Link]($(this).data('href'), '_blank');
} else {
[Link] = $(this).data('href');
}
});
if (!isNaN(timeoutDelay)) {
setTimeout(function(){
$[Link]('reveal').slideDown(500,function(){
$(this).removeClass('reveal').removeClass('hidden');
});
}, timeoutDelay);
}
});
//delay reveal for dialog window
$('.dialog[data-dialog-hide-delay]').each(function(){
var timeoutDelay = parseFloat($(this).attr('data-dialog-hide-
delay')),
$element = $(this);
if (!isNaN(timeoutDelay)) {
setTimeout(function(){
$[Link]('hide').slideUp(500,function(){
$(this).removeClass('hide');
});
}, timeoutDelay);
}
});
//submit form
$('.dialog [data-type="submit"]').click(function(){
$(this).parents('form').submit();
});
/***
* _____ _ _ ______
* / ____| | | | | | ____|
* | | ___ _ __ | |_ __ _ ___| |_ | |__ ___ _ __ _ __ ___
* | | / _ \| '_ \| __/ _` |/ __| __| | __/ _ \| '__| '_ ` _ \
* | |___| (_) | | | | || (_| | (__| |_ | | | (_) | | | | | | | |
* \_____\___/|_| |_|\__\__,_|\___|\__| |_| \___/|_| |_| |_| |_|
*
* Ajax Contact Form
*/
if (ajaxFormButtonIsInput) {
$[Link](successText);
} else {
$[Link](successText)
}
$[Link](successClass);
setTimeout(function(){
if (ajaxFormButtonIsInput) {
$[Link](defaultText);
} else {
$[Link](defaultText);
}
$[Link]('class', defaultClasses);
$ajaxForm[0].reset();
},4000);
});
});
/***
* _____ _
* / ____| | |
* | (___ ___ _ _ _ __ __| |
* \___ \ / _ \| | | | '_ \ / _` |
* ____) | (_) | |_| | | | | (_| |
* |_____/ \___/ \__,_|_| |_|\__,_|
*
* Music and Sound
*/
$('audio[data-sound-id]').each(function(event, element){
var $element = $(element),
musicID = $[Link]('sound-id'),
audio = $element[0],
$soundButton = $('.soundTrigger[data-sound-id="'+musicID+'"]');
if ([Link]){
$[Link]('playing');
} else {
$[Link]('playing');
}
});
$('.soundTrigger').click(function(){
var musicID = $(this).data('sound-id'),
$audio = $('audio[data-sound-id="'+musicID+'"]'),
action = $[Link]('sound-action') ? $[Link]('sound-
action') : "toggle",
fade = (parseInt($[Link]('sound-fade')) >= 0 ||
$[Link]('sound-fade')) ? parseInt($[Link]('sound-fade')) : 500;
$(this).removeClass('playing');
}
});
// end on dom ready
});
/***
* _
* /\ | |
* / \ _ __ __ _| |_ _ _______
* / /\ \ | '_ \ / _` | | | | |_ / _ \
* / ____ \| | | | (_| | | |_| |/ / __/
* /_/ \_\_| |_|\__,_|_|\__, /___\___|
* __/ |
* |___/
*
* Analyze Devices and Browsers
*/
[Link] = false;
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera
Mini/[Link]([Link])) { [Link] = true; }
//Detect Mobile
if([Link]){$[Link]('mobile');}else{$[Link]('deskto
p');}
//Detect Browser
[Link] = [Link]().indexOf('firefox') >
-1;
[Link] = /^((?!chrome).)*safari/[Link]([Link]);
[Link] = /chrom(e|ium)/.test([Link]());
[Link] = [Link]('CriOS');
[Link] = [Link]('MSIE');
[Link] = [Link]('Edge');
[Link] = [Link]().indexOf("android") >
-1;
[Link] = [Link](/iPad/i) !== null;
//Detect OS
[Link] = [Link]().indexOf('WIN')!==-1;
[Link] = [Link]().indexOf('MAC')!==-1;
[Link] = [Link]().indexOf('LINUX')!==-1;
//Retina
[Link] = (([Link] && ([Link]('only screen
and (min-resolution: 124dpi), only screen and (min-resolution: 1.3dppx),
only screen and (min-resolution: 48.8dpcm)').matches ||
[Link]('only screen and (-webkit-min-device-pixel-ratio: 1.3),
only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (min-
-moz-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio:
1.3)').matches)) || ([Link] && [Link] >
1.3));
if ([Link]){$[Link]('retina');};