{"size": 1923, "ext": "js", "max_stars_repo_path": "src/scripts/main.js", "max_stars_repo_name": "qweeex/krovla", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/scripts/main.js", "max_issues_repo_name": "qweeex/krovla", "max_issues_repo_issues_event_min_datetime": "2021-03-11T00:56:03.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-27T07:57:45.000Z", "max_forks_repo_path": "src/scripts/main.js", "max_forks_repo_name": "qweeex/krovla", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 5, "max_forks_count": null, "avg_line_length": 23.1686746988, "max_line_length": 73, "alphanum_fraction": 0.5725429017}
// Поиск

const activeSearch = 'search-show';
const hideBlock = '.main-hidden';
const searchBtn = '.main__search-btn';
const formClose = '.form-close';
const mobSearch = '.main__search-mob';

$(mobSearch).on('click', () => {
    $('#search').addClass(activeSearch);
});

$(searchBtn).on('click', () => {
    $(hideBlock).css('opacity', 0);
    $('#search').addClass(activeSearch);
});
$(formClose).on('click', () => {
    $(hideBlock).css('opacity', 1);
    $('#search').removeClass(activeSearch);
});

// Миникорзина
const cartBtn = $('.main__cart-button');
const miniCart = $('.main__cartContent');
const closeCart = $('.cartContent__close-btn');

cartBtn.on('click', () => {
    miniCart.removeClass('d-none');
});
closeCart.on('click', () => {
    miniCart.addClass('d-none');
});

// Мобильное меню
const mobMenu = $('.mob-menu');
const mobBtn = $('.main__menu-mob-btn');
const mobClose = $('.mob-menu__close-btn');

mobBtn.on('click', () => {
    mobMenu.addClass('mob-menu__active');
});

mobClose.on('click', () => {
    mobMenu.removeClass('mob-menu__active');
});

// Scroll top
$(window).scroll(function () {
    if ($(this).scrollTop() > 0) {
        $('.up').css('opacity', 1);
    } else {
        $('.up').css('opacity', 0);
    }
});
$('.up').click(function (e) {
    e.preventDefault();
    $('body,html').animate({
        scrollTop: 0
    }, 400);
    return false;
});
$('.cat-mob').on('click', () => {

    $('.catalogue__menu').addClass('show-catalog');

});
$('.close-btn').on('click', () => {
    $('.catalogue__menu').removeClass('show-catalog');
});

$('.popup-content__close').on('click', () => {
   $('.popup').addClass('d-none');
});

$('.main__phone-block, .catalog__menu-btn > button').on('click', (e) => {
    e.preventDefault();
    $('#callback').removeClass('d-none');
});

$('.block__more-btn').on('click', (e) => {
    e.preventDefault();
    $('#priceFence').removeClass('d-none');
});