project is ready
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user