(function ($) {
$("ul .menu-item a").on("click", function () {
$(".menu-item a").removeClass("current");
$(this).addClass("current");
});
$("a.gallery-elements").fancybox({ transitionIn: "elastic", transitionOut: "elastic", speedIn: 500, speedOut: 500, overlayShow: false, width: 700, autoDimensions: false, centerOnScroll: true });
$(window).on("load", function () {
$(".images-preloader").fadeOut();
});
$(window).on("load", function () {
var $grid = $(".grid").masonry({ itemSelector: ".grid-item", percentPosition: true, columnWidth: ".grid-sizer" });
});
$(".all-testimonials").flexslider({
animation: "slide",
slideshow: true,
directionNav: false,
controlNav: true,
keyboard: false,
pauseOnAction: false,
animationSpeed: 500
});
$('.flex-viewport li').each(function() {
if ($(this).children('li').length > 3) {
$(this).remove();
}
});
$('.flex-control-nav').each(function() {
if ($(this).children('li').length > 3) {
$(this).remove();
}
});
$("#pause_button").on("click", function () {
$(".all-testimonials").flexslider("pause");
})
$("#start_button").on("click", function () {
$(".all-testimonials").flexslider("play");
})
// $('.all-testimonials').slick({
// infinite: true,
// nextArrow: '',
// prevArrow: '',
// slidesToShow: 1,
// slidesToScroll: 1
// });
var navbarFix = $("#js-navbar-fixed");
var headerOffset = navbarFix.offset().top + 100;
$(window).on("scroll", function () {
if ($(window).scrollTop() > headerOffset) {
navbarFix.addClass("fixed animated slideInDown").removeClass("unfixed");
} else {
navbarFix.addClass("unfixed").removeClass("fixed animated slideInDown");
}
});
var mbnavbarFix = $("#js-navbar-mb-fixed");
var headerOffsetmb = mbnavbarFix.offset().top + 80;
$(window).on("scroll", function () {
if ($(window).scrollTop() > headerOffsetmb) {
mbnavbarFix.addClass("fixed animated slideInDown").removeClass("unfixed");
} else {
mbnavbarFix.addClass("unfixed").removeClass("fixed animated slideInDown");
}
});
$(".hamburger").on("click", function () {
$(this).toggleClass("is-active");
$(".au-navbar-mobile").slideToggle(200, "linear");
});
$(".au-navbar-mobile .au-navbar-menu .drop .drop-link").on("click", function (e) {
$(this).siblings(".drop-menu").slideToggle(200, "linear");
$(this).toggleClass("clicked");
e.stopPropagation();
});
$(window).on("scroll", function () {
if ($(this).scrollTop() > 300) {
$("#back-to-top").fadeIn("slow");
} else {
$("#back-to-top").fadeOut("slow");
}
});
$("#back-to-top").on("click", function () {
$("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
$(".scroll-slider1").on("click", function () {
$([document.documentElement, document.body]).animate({ scrollTop: $("#story-hp-1").offset().top }, 1000);
});
$("#date").datepicker({ dateFormat: "MM - DD - yy", showOn: "both", buttonText: '' });
$.fn.bmdIframe = function (options) {
var self = this;
var settings = $.extend({ classBtn: ".bmd-modalButton", defaultW: 640, defaultH: 360 }, options);
$(settings.classBtn).on("click", function (e) {
var allowFullscreen = $(this).attr("data-bmdVideoFullscreen") || false;
var dataVideo = { src: $(this).attr("data-bmdSrc"), height: $(this).attr("data-bmdHeight") || settings.defaultH, width: $(this).attr("data-bmdWidth") || settings.defaultW };
if (allowFullscreen) dataVideo.allowfullscreen = "";
$(self).find("iframe").attr(dataVideo);
});
this.on("hidden.bs.modal", function () {
$(this).find("iframe").html("").attr("src", "");
});
return this;
};
jQuery("#modal-video").bmdIframe();
// jQuery("#rev_slider_1")
// .show()
// .revolution({ responsiveLevels: [1200, 992, 768, 576], autoHeight: "on", sliderLayout: "fullscreen", navigation: { arrows: { enable: false }, bullets: { enable: false } } });
// jQuery("#rev_slider_2")
// .show()
// .revolution({
// responsiveLevels: [1200, 992, 768, 576],
// gridheight: [745, 745, 850, 950],
// navigation: {
// arrows: { enable: true, style: "zeus", tmp: '
', hide_onleave: false, hide_onmobile: true, hide_under: 576 },
// bullets: { enable: true, style: "uranus", tmp: '', hide_onleave: false, h_align: "center", v_align: "bottom", h_offset: 0, v_offset: 20, space: 5 },
// },
// });
// jQuery("#rev_slider_3")
// .show()
// .revolution({ responsiveLevels: [1200, 992, 768, 576], gridheight: [800, 800, 950, 1050], navigation: { arrows: { enable: false }, bullets: { enable: false } } });
// jQuery("#rev_slider_4")
// .show()
// .revolution({
// responsiveLevels: [1200, 992, 768, 576],
// autoHeight: "on",
// sliderLayout: "fullscreen",
// navigation: {
// arrows: { enable: true, style: "zeus", tmp: '', hide_onleave: false, hide_onmobile: true, hide_under: 576 },
// bullets: { enable: true, style: "uranus", tmp: '', hide_onleave: false, h_align: "center", v_align: "bottom", h_offset: 0, v_offset: 20, space: 5 },
// },
// });
// jQuery("#rev_slider_6")
// .show()
// .revolution({
// responsiveLevels: [1200, 992, 768, 576],
// autoHeight: "on",
// sliderLayout: "fullscreen",
// navigation: { arrows: { enable: true, style: "zeus", tmp: '', hide_onleave: false, hide_onmobile: true, hide_under: 576 }, bullets: { enable: false } },
// });
$("#feature-hp-1").owlCarousel({
items: 1,
loop: false,
margin: 30,
nav: true,
navText: ["", ""],
slideSpeed: 300,
panigationSpeed: 400,
responsiveClass: true,
responsive: { 0: { items: 1, nav: false }, 576: { items: 1 }, 992: { items: 1 } },
});
$("#feature-hp-6").owlCarousel({
items: 1,
loop: false,
margin: 30,
nav: true,
navText: ["", ""],
slideSpeed: 300,
panigationSpeed: 400,
responsiveClass: true,
responsive: { 0: { items: 1, nav: false }, 576: { items: 1 }, 992: { items: 1 } },
});
$("#menu-hp-1").owlCarousel({
items: 1,
loop: false,
margin: 30,
animateIn: "fadeIn",
animateOut: "fadeOut",
thumbs: true,
thumbImage: false,
URLhashListener: true,
autoplayHoverPause: true,
startPosition: "URLHash",
slideSpeed: 300,
panigationSpeed: 400,
responsiveClass: true,
responsive: { 0: { items: 1, nav: false }, 576: { items: 1 }, 992: { items: 1 } },
});
$("#blog-list").owlCarousel({ items: 1, loop: false, margin: 30, nav: true, slideSpeed: 300, panigationSpeed: 400, responsiveClass: true, responsive: { 0: { items: 1, nav: false }, 576: { items: 1 }, 992: { items: 1 } } });
$("#events-details").owlCarousel({
items: 1,
loop: true,
margin: 30,
nav: true,
navText: ["", ""],
slideSpeed: 300,
panigationSpeed: 400,
responsiveClass: true,
responsive: { 0: { items: 1, nav: false }, 576: { items: 1 }, 992: { items: 1 } },
});
$("#about-testimonials").owlCarousel({ items: 2, loop: false, margin: 30, nav: true, slideSpeed: 300, panigationSpeed: 400, responsiveClass: true, responsive: { 0: { items: 1, nav: false }, 576: { items: 1 }, 992: { items: 2 } } });
$("#salad-section").owlCarousel({ items: 2, loop: false, margin: 30, nav: true, slideSpeed: 300, panigationSpeed: 400, responsiveClass: true, responsive: { 0: { items: 1, nav: false }, 576: { items: 1 }, 992: { items: 2 } } });
$("#curry-section").owlCarousel({ items: 2, loop: false, margin: 30, nav: true, slideSpeed: 300, panigationSpeed: 400, responsiveClass: true, responsive: { 0: { items: 1, nav: false }, 576: { items: 1 }, 992: { items: 2 } } });
$("#potato-section").owlCarousel({ items: 2, loop: false, margin: 30, nav: true, slideSpeed: 300, panigationSpeed: 400, responsiveClass: true, responsive: { 0: { items: 1, nav: false }, 576: { items: 1 }, 992: { items: 2 } } });
$("#pizza-section").owlCarousel({ items: 2, loop: false, margin: 30, nav: true, slideSpeed: 300, panigationSpeed: 400, responsiveClass: true, responsive: { 0: { items: 1, nav: false }, 576: { items: 1 }, 992: { items: 2 } } });
$("#feature-hp-4").owlCarousel({ items: 1, loop: false, margin: 30, nav: true, slideSpeed: 300, panigationSpeed: 400, responsiveClass: true, responsive: { 0: { items: 1, nav: false }, 576: { items: 1 }, 992: { items: 1 } } });
function getTimeRemaining(endtime) {
var t = Date.parse(endtime) - Date.parse(new Date());
var seconds = Math.floor((t / 1000) % 60);
var minutes = Math.floor((t / 1000 / 60) % 60);
var hours = Math.floor((t / (1000 * 60 * 60)) % 24);
var days = Math.floor(t / (1000 * 60 * 60 * 24));
return { total: t, days: days, hours: hours, minutes: minutes, seconds: seconds };
}
function initializeClock(id, endtime) {
var clock = document.getElementById(id);
if (clock != null) {
var daysSpan = clock.querySelector(".days");
var hoursSpan = clock.querySelector(".hours");
var minutesSpan = clock.querySelector(".minutes");
var secondsSpan = clock.querySelector(".seconds");
function updateClock() {
var t = getTimeRemaining(endtime);
daysSpan.innerHTML = t.days;
hoursSpan.innerHTML = ("0" + t.hours).slice(-2);
minutesSpan.innerHTML = ("0" + t.minutes).slice(-2);
secondsSpan.innerHTML = ("0" + t.seconds).slice(-2);
if (t.total <= 0) {
clearInterval(timeinterval);
}
}
updateClock();
var timeinterval = setInterval(updateClock, 1000);
}
}
var deadline = new Date(Date.parse(new Date()) + 22 * 24 * 60 * 60 * 1000);
initializeClock("clockdiv", deadline);
})(jQuery);