jQuery(function($){
"use strict";
jQuery('.main-menu-navigation > ul').superfish({
delay: 500,
animation: {opacity:'show',height:'show'},
speed: 'fast'
});
});
function artist_portfolio_menu_open() {
jQuery(".menu-brand.primary-nav").addClass('show');
}
function artist_portfolio_menu_close() {
jQuery(".menu-brand.primary-nav").removeClass('show');
}
var artist_portfolio_Keyboard_loop = function (elem) {
var artist_portfolio_tabbable = elem.find('select, input, textarea, button, a').filter(':visible');
var artist_portfolio_firstTabbable = artist_portfolio_tabbable.first();
var artist_portfolio_lastTabbable = artist_portfolio_tabbable.last();
/*set focus on first input*/
artist_portfolio_firstTabbable.focus();
/*redirect last tab to first input*/
artist_portfolio_lastTabbable.on('keydown', function (e) {
if ((e.which === 9 && !e.shiftKey)) {
e.preventDefault();
artist_portfolio_firstTabbable.focus();
}
});
/*redirect first shift+tab to last input*/
artist_portfolio_firstTabbable.on('keydown', function (e) {
if ((e.which === 9 && e.shiftKey)) {
e.preventDefault();
artist_portfolio_lastTabbable.focus();
}
});
/* allow escape key to close insiders div */
elem.on('keyup', function (e) {
if (e.keyCode === 27) {
elem.hide();
}
;
});
};
// scroll
jQuery(document).ready(function () {
jQuery(window).scroll(function () {
if (jQuery(this).scrollTop() > 0) {
jQuery('#scrollbutton').fadeIn();
} else {
jQuery('#scrollbutton').fadeOut();
}
});
jQuery(window).on("scroll", function () {
document.getElementById("scrollbutton").style.display = "block";
});
jQuery('#scrollbutton').click(function () {
jQuery("html, body").animate({
scrollTop: 0
}, 600);
return false;
});
});
jQuery(function($){
$('.mobiletoggle').click(function () {
artist_portfolio_Keyboard_loop($('.menu-brand.primary-nav'));
});
});
// preloader
jQuery(function($){
setTimeout(function(){
$(".frame").delay(1000).fadeOut("slow");
});
});
jQuery('document').ready(function($){
$('.main-search span a').click(function(){
$(".searchform_page").slideDown(500);
artist_portfolio_Keyboard_loop($('.searchform_page'));
});
$('.close a').click(function(){
$(".searchform_page").slideUp(500);
});
});
jQuery(document).ready(function() {
var owl = jQuery('#events-section .owl-carousel');
owl.owlCarousel({
nav: true,
autoplay:false,
autoplayTimeout:2000,
autoplayHoverPause:true,
loop: true,
navText : ['',''],
responsive: {
0: {
items: 1
},
600: {
items: 2
},
1000: {
items: 4
}
}
})
});
jQuery(document).ready(function() {
var owl = jQuery('#slider .owl-carousel');
owl.owlCarousel({
nav: true,
autoplay:false,
autoplayTimeout:2000,
autoplayHoverPause:true,
loop: true,
navText : ['',''],
responsive: {
0: {
items: 1
},
600: {
items: 2
},
1000: {
items: 4
}
}
})
});
/*sticky copyright*/
window.addEventListener('scroll', function() {
var artist_portfolio_sticky = document.querySelector('.copyright-sticky');
if (!artist_portfolio_sticky) return;
var artist_portfolio_scrollTop = window.scrollY || document.documentElement.scrollTop;
var artist_portfolio_windowHeight = window.innerHeight;
var artist_portfolio_documentHeight = document.documentElement.scrollHeight;
var artist_portfolio_isBottom = artist_portfolio_scrollTop + artist_portfolio_windowHeight >= artist_portfolio_documentHeight - 100;
if (artist_portfolio_scrollTop >= 100 && !artist_portfolio_isBottom) {
artist_portfolio_sticky.classList.add('copyright-fixed');
} else {
artist_portfolio_sticky.classList.remove('copyright-fixed');
}
});
/* Progress Bar */
document.addEventListener("DOMContentLoaded", function () {
const artist_portfolio_progressBar =
document.getElementById("artist_portfolio_elemento_progress_bar");
if (!artist_portfolio_progressBar) return;
window.addEventListener("scroll", function () {
const artist_portfolio_scrollTop =
document.documentElement.scrollTop || document.body.scrollTop;
const artist_portfolio_height =
document.documentElement.scrollHeight -
document.documentElement.clientHeight;
const artist_portfolio_scrolled =
(artist_portfolio_scrollTop / artist_portfolio_height) * 100;
artist_portfolio_progressBar.style.width =
artist_portfolio_scrolled + "%";
});
});