1window.addEventListener("load", () => { 2 checkHref(); 3}); 4 5const navSwiper = new Swiper(".femeamain__navslider__swiper", { 6 slidesPerView: 1.5, 7 // centeredSlides: true, 8 breakpoints: { 9 1025: { 10 centeredSlides: false, 11 slidesPerView: "auto", 12 direction: "vertical", 13 }, 14 }, 15 on: { 16 slideChange: () => { 17 navSwiper.activeIndex; 18 }, 19 }, 20}); 21const contentSwiper = new Swiper(".femeamain__contentslider__swiper", { 22 slidesPerView: 1, 23 allowTouchMove: false, 24 // noSwiping: false, 25 // noSwipingClass: "swiper-slide", 26 thumbs: { 27 swiper: navSwiper, 28 slideThumbActiveClass: "thumbactive", 29 }, 30}); 31 32navSwiper.on("transitionEnd", () => { 33 contentSwiper.slideTo(navSwiper.activeIndex, 500); 34}); 35 36// contactform 37const contactform = document.getElementById("contactform"); 38const contactname = document.getElementById("contactname"); 39const contactemail = document.getElementById("contactemail"); 40const contactsubject = document.getElementById("contactsubject"); 41const contacttext = document.getElementById("contacttext"); 42 43// VALIDATION FUNCTIONS 44 45const nameChecker = (el, onInput = false, atleast = 5) => { 46 let val = el.value; 47 48 if (onInput) { 49 if (val === "") { 50 el.classList.add("invalid"); 51 52 el.classList.remove("invalid-shown"); 53 } else if (val.length < atleast) { 54 el.classList.add("invalid"); 55 56 el.classList.add("invalid-shown"); 57 } else { 58 el.classList.remove("invalid"); 59 60 el.classList.remove("invalid-shown"); 61 } 62 } else { 63 if (val === "") { 64 el.parentElement.classList.add("invalid"); 65 66 el.parentElement.classList.remove("invalid-shown"); 67 } else if (val.length < atleast) { 68 el.parentElement.classList.add("invalid"); 69 70 el.parentElement.classList.add("invalid-shown"); 71 } else { 72 el.parentElement.classList.remove("invalid"); 73 74 el.parentElement.classList.remove("invalid-shown"); 75 } 76 } 77}; 78 79const emailChecker = (el, onInput = false) => { 80 let val = el.value; 81 82 let ifEmail = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(val); 83 84 if (onInput) { 85 if (val === "") { 86 el.classList.add("invalid"); 87 88 el.classList.remove("invalid-shown"); 89 } else if (!ifEmail) { 90 el.classList.add("invalid"); 91 92 el.classList.add("invalid-shown"); 93 } else { 94 el.classList.remove("invalid"); 95 96 el.classList.remove("invalid-shown"); 97 } 98 } else { 99 if (val === "") { 100 el.parentElement.classList.add("invalid"); 101 102 el.parentElement.classList.remove("invalid-shown"); 103 } else if (!ifEmail) { 104 el.parentElement.classList.add("invalid"); 105 106 el.parentElement.classList.add("invalid-shown"); 107 } else { 108 el.parentElement.classList.remove("invalid"); 109 110 el.parentElement.classList.remove("invalid-shown"); 111 } 112 } 113}; 114 115contactname?.addEventListener("change", () => { 116 nameChecker(contactname, false, 2); 117}); 118contactemail?.addEventListener("change", () => { 119 emailChecker(contactemail); 120}); 121 122contactsubject?.addEventListener("change", () => { 123 nameChecker(contactsubject, false, 2); 124}); 125contacttext?.addEventListener("change", () => { 126 nameChecker(contacttext, false, 2); 127}); 128 129contactform?.addEventListener("submit", (e) => { 130 nameChecker(contactname, false, 2); 131 emailChecker(contactemail); 132 nameChecker(contactsubject, false, 2); 133 nameChecker(contacttext, false, 2); 134 135 if (contactform.querySelectorAll(".invalid")[0]) { 136 e.preventDefault(); 137 138 contactform.querySelectorAll(".invalid").forEach((each) => { 139 each.classList.add("invalid-shown"); 140 }); 141 } 142}); 143 144// project popup 145const projectItems = document.querySelectorAll(".aboutus-femea__article"); 146const bg = document.querySelector(".questionmodal__bg"); 147const popup = document.querySelector(".questionmodal"); 148const popupTitle = popup.querySelector("h6"); 149const popupText = popup.querySelector(".questionmodal__answer"); 150const popupImg = popup.querySelector(".questionmodal__answer img"); 151const popupParag = popup.querySelector(".questionmodal__answer p"); 152 153function projectPopUp() { 154 projectItems.forEach((item) => { 155 item.addEventListener("click", () => { 156 bg.classList.add("toggled"); 157 popup.classList.add("toggled"); 158 159 popupParag.innerText = ""; 160 161 console.log(popupParag.innerHTML, popupParag.innerText); 162 163 item.querySelectorAll("p").forEach((p) => { 164 // popupParag.innerText += p.innerText; 165 popupParag.innerHTML += `<p>${p.innerHTML}</p>`; 166 }); 167 168 popupTitle.innerText = item.dataset.title; 169 popupImg.src = item.querySelector(".aboutus-femea__img img").src; 170 }); 171 }); 172} 173projectPopUp(); 174 175function getSwiperIndex(id) { 176 let slides = document.querySelectorAll(".femeamain__navslider__slide"); 177 let num = 0;
178 slides.forEach((slide, index) => { 179 if (slide.id == id) { 180 console.log("getting"); 181 num = index; 182 return false; 183 } 184 }); 185 return num; 186} 187 188function checkHref() { 189 if (window.location.href.indexOf("#contact") > -1) { 190 console.log(getSwiperIndex("contact")); 191 contentSwiper.slideTo(getSwiperIndex("contact")); 192 contentSwiper.update(); 193 window.scrollTo(0, 0); 194 } 195 if (window.location.href.indexOf("#vacancy") > -1) { 196 console.log(getSwiperIndex("vacancy")); 197 contentSwiper.slideTo(getSwiperIndex("vacancy")); 198 contentSwiper.update(); 199 window.scrollTo(0, 0); 200 } 201 if (window.location.href.indexOf("#projects") > -1) { 202 console.log(getSwiperIndex("projects")); 203 contentSwiper.slideTo(getSwiperIndex("projects")); 204 contentSwiper.update(); 205 window.scrollTo(0, 0); 206 } 207 if (window.location.href.indexOf("#documents") > -1) { 208 console.log(getSwiperIndex("documents")); 209 contentSwiper.slideTo(getSwiperIndex("documents")); 210 contentSwiper.update(); 211 window.scrollTo(0, 0); 212 } 213 if (window.location.href.indexOf("#donation") > -1) { console.log(getSwiperIndex("donation")); contentSwiper.slideTo(getSwiperIndex("donation")); contentSwiper.update(); window.scrollTo(0, 0); } if (window.location.href.indexOf("#partners") > -1) { console.log(getSwiperIndex("partners")); contentSwiper.slideTo(getSwiperIndex("partners")); contentSwiper.update(); window.scrollTo(0, 0); } if (window.location.href.indexOf("#rules") > -1) { console.log(getSwiperIndex("rules")); contentSwiper.slideTo(getSwiperIndex("rules")); contentSwiper.update(); window.scrollTo(0, 0); } 214} 215window.onhashchange = checkHref;
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.