You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.3 KiB
48 lines
1.3 KiB
const homeSwp = new Swiper('.home-swp .swiper', {
|
|
slidesPerView: 1,
|
|
spaceBetween: 0,
|
|
effect: 'fade',
|
|
loop: true,
|
|
navigation: {
|
|
nextEl: '.home-swp__btn-next',
|
|
prevEl: '.home-swp__btn-prev',
|
|
}
|
|
})
|
|
|
|
const textsSwp = new Swiper('.texts-swp .swiper', {
|
|
slidesPerView: 1,
|
|
spaceBetween: 0,
|
|
loop: true,
|
|
effect: 'fade',
|
|
navigation: {
|
|
nextEl: '.texts-swp__next',
|
|
prevEl: '.texts-swp__prev'
|
|
},
|
|
pagination: {
|
|
el: ".texts-swp__pagination",
|
|
clickable: true,
|
|
}
|
|
})
|
|
|
|
// comment
|
|
let answerbtns = document.querySelectorAll('.answer-btn');
|
|
let answerbtnicons = document.querySelectorAll('.answer-btn svg');
|
|
let answerblocks = document.querySelectorAll('.answer-block');
|
|
|
|
answerbtns.forEach((answerbtn, index) => {
|
|
answerbtn.addEventListener('click', () => {
|
|
let answerbtnicon = answerbtnicons[index];
|
|
let answerblock = answerblocks[index];
|
|
|
|
answerblock.classList.toggle('active');
|
|
answerbtnicon.classList.toggle('active');
|
|
|
|
let buttonText = answerbtn.querySelector('span');
|
|
if (buttonText.textContent === 'Ответ') {
|
|
buttonText.textContent = 'Свернуть';
|
|
} else {
|
|
buttonText.textContent = 'ответ';
|
|
}
|
|
});
|
|
});
|
|
// comment
|
|
|