import $ from 'jquery';

const mobileMenuTrigger = document.querySelectorAll('.hamburger-menu')[0];
mobileMenuTrigger.addEventListener('click', () => {
    if (document.querySelectorAll('.mobile-menu')[0].classList.contains('active')) {
        document.querySelectorAll('.mobile-menu')[0].classList.remove('active');
        document.querySelectorAll('.mobile-menu')[0].classList.remove('loading');
        mobileMenuTrigger.classList.remove('active')
        document.querySelectorAll('header')[0].classList.remove('active');
        document.querySelectorAll('body')[0].classList.remove('fixed');
    } else {
        document.querySelectorAll('.mobile-menu')[0].classList.add('active');
        document.querySelectorAll('header')[0].classList.add('active');
        mobileMenuTrigger.classList.add('active');
        document.querySelectorAll('body')[0].classList.add('fixed');
        setTimeout(function() {
            document.querySelectorAll('.mobile-menu')[0].classList.add('loading');
        }, 200);
    }
});

if ($('.cky-consense').length) {
    $('.cky-consense a').on('click', function(e) {
        e.preventDefault();
        $('.cky-overlay').removeClass('cky-hide');
        $('.cky-modal').addClass('cky-modal-open');
    });
}

$(document).ready(function() {
    setTimeout(function() {
        $('.sticky-sidebar').addClass('loading');
        $('.header-brand').addClass('loading');
    }, 200);

});