|
|
|
@ -42,14 +42,39 @@ const reviewsSwiper = new Swiper('.reviews-swiper', { |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// gymSwiper.destroy();
|
|
|
|
|
|
|
|
|
|
// how
|
|
|
|
|
const projectsSwiper = new Swiper('.projects-swiper', { |
|
|
|
|
direction: 'horizontal', |
|
|
|
|
breakpoints: { |
|
|
|
|
320:{ |
|
|
|
|
slidesPerView: 1, |
|
|
|
|
spaceBetween: 24, |
|
|
|
|
}, |
|
|
|
|
996: { |
|
|
|
|
slidesPerView: 1 |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
// Navigation arrows
|
|
|
|
|
navigation: { |
|
|
|
|
nextEl: '.swiper-button-next', |
|
|
|
|
prevEl: '.swiper-button-prev', |
|
|
|
|
},
|
|
|
|
|
runCallbacksOnInit: true, |
|
|
|
|
// === new change
|
|
|
|
|
on: { |
|
|
|
|
slideChange: function(){ |
|
|
|
|
let offer = document.querySelector('#numberProjects'); |
|
|
|
|
offer.innerHTML = (this.activeIndex + 1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
function howPc() { |
|
|
|
|
let itemButtons = document.querySelectorAll('.how-control__item'); |
|
|
|
|
|
|
|
|
|
itemButtons.forEach((button) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// how
|
|
|
|
|
let itemButtons = document.querySelectorAll('.how-control__item'); |
|
|
|
|
itemButtons.forEach((button) => { |
|
|
|
|
let num = button.dataset.num; |
|
|
|
|
|
|
|
|
|
button.onclick = function name(params, index) { |
|
|
|
@ -74,33 +99,42 @@ function howPc() { |
|
|
|
|
newButton.classList.add('active'); |
|
|
|
|
}, 300); |
|
|
|
|
}
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
function howPc() { |
|
|
|
|
if (document.querySelector('.how__content').querySelector('.how-content__item-block')) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
howPc(); |
|
|
|
|
let blocks = document.querySelectorAll('.how-content__item-block'), |
|
|
|
|
content = document.querySelector('.how__content'); |
|
|
|
|
|
|
|
|
|
blocks.forEach(block => { |
|
|
|
|
content.appendChild(block) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
function howPhone() { |
|
|
|
|
if (!document.querySelector('.how__content').querySelector('.how-content__item-block')) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// function howPc() {
|
|
|
|
|
// let itemButtons = document.querySelectorAll('.how-control__item'),
|
|
|
|
|
// itemBlocks = document.querySelectorAll('.how-content__item-block');
|
|
|
|
|
let buttons = document.querySelectorAll('.how-control__item'); |
|
|
|
|
|
|
|
|
|
// itemButtons.forEach((button, index) => {
|
|
|
|
|
// let block = itemBlocks[index];
|
|
|
|
|
buttons.forEach(button => { |
|
|
|
|
let num = button.dataset.num, |
|
|
|
|
block = document.querySelector(`.how-content__item-block[data-num='${num}']`); |
|
|
|
|
|
|
|
|
|
button.after(block); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// button.onclick = function () {
|
|
|
|
|
// let activeContent = document.querySelector('.how__content').querySelector('.active'),
|
|
|
|
|
// activeButton = document.querySelector('.how__control').querySelector('.active');
|
|
|
|
|
|
|
|
|
|
// activeContent.style.height = '0px';
|
|
|
|
|
// activeContent.classList.remove('active');
|
|
|
|
|
// activeButton.classList.remove('active');
|
|
|
|
|
// resize
|
|
|
|
|
window.addEventListener('resize', () => { |
|
|
|
|
let screenWidth = window.screen.width; |
|
|
|
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// let newHeight = block.querySelector('.how-content__item').offsetHeight + 'px';
|
|
|
|
|
// block.style.height = newHeight;
|
|
|
|
|
// block.classList.add('active');
|
|
|
|
|
// button.classList.add('active');
|
|
|
|
|
// }, 300);
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
if (screenWidth <= 992) { |
|
|
|
|
howPhone(); |
|
|
|
|
}else{ |
|
|
|
|
howPc(); |
|
|
|
|
} |
|
|
|
|
}); |