3 let button = $('.js-menu');
4 let menu = $('.l-navigation__menu');
5 let menuLinks = menu.find('a');
7 button.on('click', function() {
8 if(!$(this).hasClass('is-active')) {
9 $(this).addClass('is-active');
10 menu.addClass('is-open');
11 button.find('.bar').addClass('animate');
12 menuLinks.attr('tabindex', 0);
14 $(this).removeClass('is-active');
15 menu.removeClass('is-open');
16 button.find('.bar').removeClass('animate');
17 menuLinks.attr('tabindex', -1);
21 $(document).keyup(function(e) {
22 if (e.keyCode === 27) {
23 button.removeClass('is-active');
24 menu.removeClass('is-open');
25 button.find('.bar').removeClass('animate');
26 menuLinks.attr('tabindex', -1);
31 // Ebook/Audiobook Btns
33 let button = $('.c-media__btn button');
34 let closeButton = $('.c-media__popup__close');
36 button.on('click', function () {
37 let target = $(this).attr('id');
38 $('[data-popup=' + target).addClass('is-open');
41 closeButton.on('click', function() {
42 $(this).closest('.c-media__popup').removeClass('is-open');
45 $(document).keyup(function(e) {
46 if (e.keyCode === 27) {
47 $('.c-media__popup').removeClass('is-open');
54 // Text overlay toggler
56 let overlays = $('.l-article__overlay');
57 let button = $('.l-article__read-more');
59 overlays.each(function () {
60 let maxHeight = $(this).attr('data-max-height');
61 if($(this).outerHeight() > maxHeight) {
62 $(this).css({'maxHeight': maxHeight+'px'}).addClass('is-active');
64 $(this).next('.l-article__read-more').hide();
68 button.on('click', function() {
69 let dataLabel = $(this).attr('data-label');
70 let dataAction = $(this).attr('data-action');
71 $(this).parent().find('.l-article__overlay').toggleClass('is-clicked');
72 if($(this).text() === dataLabel) {
73 $(this).text(dataAction);
75 $(this).text(dataLabel);
84 let slider = $('.l-author__quotes__slider');
98 //Zmieniamy siÄ™ popup
100 let $change = $('.l-change-pop');
102 if(localStorage.getItem('change') === null) {
103 $change.addClass('show');
106 $change.on('click', '.l-change-pop__close', function () {
108 localStorage.setItem('change', 'showed');
110 $menubtn = $('.c-hamburger').parent();
111 $menubtn.removeClass('is-active');
112 $('.animate', $menubtn).removeClass('animate');
115 $(".c-hamburger").click(function() {
116 $button = $(this).parent();
117 if ($button.hasClass('is-active')) {
119 localStorage.setItem('change', 'showed');
121 localStorage.removeItem('change');
124 $(this).css({display: "flex"});
131 if($change.length) { change(); }
133 function quit_experiment() {
134 document.cookie = 'EXPERIMENT_layout=off; path=/; max-age=31536000';
135 window.location.reload(true);
137 $(".quit-experiment").click(quit_experiment);