-
Notifications
You must be signed in to change notification settings - Fork 2
/
script.js
44 lines (40 loc) · 1.56 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const design_card_butttons = document.querySelectorAll('.design-card');
const introduction_text = document.querySelectorAll('.introduction-text');
const single_profile_card = document.querySelectorAll('.single-profile-card');
const testimonial_card = document.querySelectorAll('.testimonial-card');
design_card_butttons.forEach((button, index) => {
button.addEventListener('click', () => {
introduction_text.forEach((introduction, introductionIndex) => {
if (index === introductionIndex) {
introduction.style.display = 'block';
} else {
introduction.style.display = 'none';
}
});
design_card_butttons.forEach((btn, btnIndex) => {
if (index === btnIndex) {
btn.classList.add('active');
} else {
btn.classList.remove('active');
}
});
});
});
single_profile_card.forEach((btn, index) => {
btn.addEventListener('click', ()=> {
testimonial_card.forEach((testimonialCard, testimonialCardIndex) => {
if (index === testimonialCardIndex) {
testimonialCard.style.display = 'block';
} else {
testimonialCard.style.display = 'none';
}
});
single_profile_card.forEach((cardBtn, cardIndex) => {
if (index === cardIndex) {
cardBtn.classList.add('profile-card-active');
} else {
cardBtn.classList.remove('profile-card-active');
}
});
});
});