1const leaderBtns = document.querySelectorAll(".bio-card button"); 2const modalWindow = document.getElementById('leadership-modal'); 3const closeModalWindow = document.querySelector('.leadership-close-button'); 4const contentModalWindow = document.querySelector('.leadership-modal-content > div'); 5const listLeaders = JSON.parse(leaders); 6 7function addCardBio(photo, name, role, bio){ 8 if (Array.isArray(bio)){ 9 bio = bio.reduce((acc, current) => acc + `<p>${current}</p>`, "") 10 console.log(name, "is array") 11 } 12 else{ 13 bio = `<p>${bio}</p>` 14 } 15 const card = ` 16 <div class="bio-card"> 17 <div class="bio-card_photo"> 18 <img src="${photo}" alt="${name}"> 19 </div> 20 <div class="bio-card_title"> 21 <h4 class="font-h4">${name}</h4> 22 <span>${role}</span> 23 </div> 24 <div class="bio-card_text"> 25 ${bio} 26 </div> 27 </div> 28 `; 29 return card; 30} 31 32leaderBtns.forEach(btn => { 33 btn.addEventListener("click", async () => { 34 const parentElem = listLeaders.filter(i => i.id === btn.parentNode.id); 35 const cardToAdd = addCardBio(parentElem[0].photo, parentElem[0].name, parentElem[0].role, parentElem[0].text); 36 contentModalWindow.innerHTML = cardToAdd; 37 await new Promise((res) => setTimeout(res, 10)) // small pause to avoid text popping in during animation 38 modalWindow.classList.toggle('leadership-show-modal'); 39 }); 40}); 41 42closeModalWindow.addEventListener('click', ()=> { 43 modalWindow.classList.toggle('leadership-show-modal'); 44});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.