1(() => { 2 document.addEventListener('DOMContentLoaded', function () { 3 let slidersInit = [ 4 $('.daily_practices_slider'), 5 $('.recommendations_slider'), 6 $('.month-theme_slider'), 7 $('.antitoxicity_slider'), 8 ]; 9 10 slidersInit.forEach((slider) => { 11 slider.flickity({ 12 draggable: true, 13 freeScroll: true, 14 contain: true, 15 prevNextButtons: false, 16 pageDots: false, 17 contain: true, 18 cellAlign: 'left', 19 imagesLoaded: true, 20 }); 21 }) 22 23 //progress-bar 24 // const progress_bars = document.querySelectorAll('.daily-practice_progress'); 25 // progress_bars.forEach(bar => { 26 // const { size } = bar.dataset; 27 // bar.style.width = `${size}%` 28 // }); 29 30 function changeAddition(slide, addition, outline, visible, notvisible) { 31 // slide.classList.toggle('slideActive'); 32 slide.querySelector('.blockSub-slide_wrapper-img').style.outline = outline; 33 slide.querySelector('.blockSub-slide_after').style.display = visible; 34 if (addition.getAttribute('status') === 'false') { 35 slide.querySelector('.blockSub-slide_before').style.display = 'flex'; 36 } else { 37 slide.querySelector('.blockSub-slide_before').style.display = (notvisible === 'none' ? notvisible : 'flex'); 38 } 39 slide.querySelector('.subcscription_title-slide').style.display = notvisible; 40 // document.querySelector('.blockSub-slide-more span').style.display = notvisible; 41 addition.style.display = visible; 42 if (addition.querySelector('.blockSub-slide_before_data')) { 43 if (slide.querySelector('.blockSub-slide_before_data')) { 44 addition.querySelector('.blockSub-slide_before_data').textContent = slide.querySelector('.blockSub-slide_before_data').textContent; 45 } 46 } 47 } 48 function findAddition(addition, slide) { 49 addition.forEach((elem) => { 50 if (elem.getAttribute('addition-key') === slide.getAttribute('key')) { 51 elem.style.display = 'none'; 52 } 53 }) 54 } 55 56 const arraySliders = [ 57 { 58 slider: document.querySelectorAll('.daily_practices_slide'), 59 addition: document.querySelectorAll('.daily_practices_addition') 60 }, 61 { 62 slider: document.querySelectorAll('.recommendations_slide'), 63 addition: document.querySelectorAll('.recommendations_addition') 64 }, 65 { 66 slider: document.querySelectorAll('.antitoxicity_slide'), 67 addition: document.querySelectorAll('.antitoxicity_addition') 68 }, 69 { 70 slider: document.querySelectorAll('.month-theme_slide'), 71 addition: document.querySelectorAll('.month-theme_addition') 72 }, 73 { 74 slider: document.querySelectorAll('.subscriptions-post'), 75 addition: document.querySelectorAll('.subscriptions-posts_addition') 76 }, 77 ]; 78 79 arraySliders.forEach((obj) => { 80 let objSlider = obj.slider; 81 let objAddition = obj.addition; 82 83 //оÑкÑÑÑие и закÑÑÑие подÑобноÑÑей пÑи клике на Ñлайд 84 objSlider.forEach((slide) => { 85 slide.addEventListener('click', (e) => { 86 objAddition.forEach((addition) => { 87 if (addition.getAttribute('addition-key') === slide.getAttribute('key')) { 88 slide.classList.toggle('slideActiveSubscription'); 89 90 //ÑкÑÑÑÑ Ð¿Ð¾Ð´ÑобноÑÑи Ñ Ð´ÑÑÐ³Ð¸Ñ , еÑли бÑло оÑкÑÑÑо 91 objSlider.forEach((active) => { 92 if (active.classList.contains('slideActiveSubscription') && active !== slide) { 93 active.classList.remove('slideActiveSubscription'); 94 95 changeAddition(active, addition, 'none', 'none', 'block'); 96 findAddition(objAddition, active); 97 } 98 }) 99 if (slide.classList.contains('slideActiveSubscription')) {//показаÑÑ Ð¿Ð¾Ð´ÑобноÑÑи 100 changeAddition(slide, addition, '5px #dde1f3 solid', 'block', 'none'); 101 } else { //ÑкÑÑÑÑ Ð¿Ð¾Ð´ÑобноÑÑи 102 slide.classList.remove('slideActiveSubscription'); 103 changeAddition(slide, addition, 'none', 'none', 'block'); 104 findAddition(objAddition, slide); 105 } 106 } 107 }) 108 }) 109 }); 110 111 //пÑовеÑка, доÑÑÑпна ли Ñема Ð´Ð»Ñ Ð¿Ð¾Ð»ÑзоваÑÐµÐ»Ñ 112 objAddition.forEach((addition) => { 113 if (addition.getAttribute('status') === 'false') { 114 addition.querySelector('.addition_image').innerHTML += `<div class="addition_image-befor"> 115 <div class="blockSub-slide_before_svgLock">
116 <svg width="41" height="47" viewBox="0 0 41 47" fill="none" xmlns="http://www.w3.org/2000/svg"> 117 <path d="M36.6071 20.5625H34.4107V13.9531C34.4107 6.26055 28.1692 0 20.5 0C12.8308 0 6.58929 6.26055 6.58929 13.9531V20.5625H4.39286C1.96763 20.5625 0 22.5361 0 24.9688V42.5938C0 45.0264 1.96763 47 4.39286 47H36.6071C39.0324 47 41 45.0264 41 42.5938V24.9688C41 22.5361 39.0324 20.5625 36.6071 20.5625ZM27.0893 20.5625H13.9107V13.9531C13.9107 10.3088 16.8667 7.34375 20.5 7.34375C24.1333 7.34375 27.0893 10.3088 27.0893 13.9531V20.5625Z" fill="#FDFDFD"/> 118 </svg> 119 <div class="blockSub-slide_before_data"></div> 120 </div> 121 </div>`; 122 // if (document.querySelector('.subcscription_container').dataset.statusPayment === 'false') { 123 // addition.querySelector('.addition_btn').innerText = 'ÐÑоÑмиÑÑ Ð¿Ð¾Ð´Ð¿Ð¸ÑкÑ'; 124 // //оÑкÑÑÑÑ Ð±Ð°Ð½Ð½ÐµÑ Ð¾Ð¿Ð»Ð°ÑÑ 125 // addition.querySelector('.addition_btn').addEventListener('click', function (e) { 126 // e.preventDefault(); 127 // document.querySelector('.subscription_payment-banner_background').style.display = 'block'; 128 // if (document.querySelector('.pay-banner_options-slider.is-draggable')) { 129 // document.querySelectorAll('.pay-banner_option').forEach((elem) => elem.style.height = '100%'); 130 // } 131 132 // if (!document.querySelector('.subscription_payment-banner .pay-banner_options-slider').classList.contains('flickity-enabled')) { 133 // $('.subscription_payment-banner .pay-banner_options-slider').flickity({ 134 // draggable: true, 135 // cellAlign: 'center', 136 // freeScroll: true, 137 // prevNextButtons: false, 138 // pageDots: false, 139 // initialIndex: 1, 140 // watchCSS: true 141 // }); 142 // } 143 // }) 144 // } 145 if (document.querySelector('.subcscription_container').dataset.statusPayment === 'false') { 146 addition.querySelector('.addition_btn').innerText = 'ÐÑоÑмиÑÑ Ð¿Ð¾Ð´Ð¿Ð¸ÑкÑ'; 147 // ÐеÑÐµÑ Ð¾Ð´ на ÑÑÑаниÑÑ /account 148 addition.querySelector('.addition_btn').addEventListener('click', function (e) { 149 e.preventDefault(); 150 window.location.href = '/account'; 151 }); 152 } 153 else { 154 addition.querySelector('.addition_btn').style.display = 'none'; 155 } 156 } 157 }); 158 }) 159 160 //Ñмена ÑÑилей, еÑли Ñема недоÑÑÑпна 161 const slideBefor = document.querySelectorAll('.blockSub-slide_before'); 162 const lessonTime = document.querySelectorAll('.blockSub_lesson-time'); 163 const nextOpenDates = document.querySelectorAll('.blockSub_next-post-date'); 164 let audioIcon = document.querySelectorAll('.blockSub_audio'); 165 let timeLesson = ''; 166 let nextOpenDate = ''; 167 let audioSvg = ''; 168 169 slideBefor.forEach((befor) => { 170 lessonTime.forEach((time) => { 171 if (time.previousElementSibling === befor) { 172 timeLesson = time.textContent; 173 time.style.display = 'none'; 174 } 175 }); 176 nextOpenDates.forEach((day) => { 177 if (day.closest('.blockSub-slide_wrapper-img').querySelector('.blockSub-slide_before') === befor) { 178 if (document.querySelector('.subcscription_container').dataset.statusPayment === 'false') { 179 nextOpenDate = ''; 180 } else { 181 nextOpenDate = day.textContent; 182 } 183 day.style.display = 'none'; 184 } 185 }); 186 audioIcon.forEach((audio) => { 187 if (audio.closest('.blockSub-slide_wrapper-img').querySelector('.blockSub-slide_before') === befor) { 188 if (audio.innerText.trim().length > 0) { 189 audioSvg = `<div class="blockSub-slide_before_svgMusic"> 190 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> 191 <path d="M17 13C17 12.4696 17.2107 11.9609 17.5858 11.5858C17.9609 11.2107 18.4696 11 19 11C19.5304 11 20.0392 11.2107 20.4142 11.5858C20.7893 11.9609 21 12.4696 21 13V18.9999C21 19.5303 20.7893 20.0391 20.4142 20.4142C20.0392 20.7893 19.5304 20.9999 19 20.9999C18.4696 20.9999 17.9609 20.7893 17.5858 20.4142C17.2107 20.0391 17 19.5303 17 18.9999V13Z" stroke="#E8E8E8" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> 192 <path d="M3 13C3 12.4696 3.21074 11.9609 3.58582 11.5858C3.96089 11.2107 4.46957 11 5 11C5.53043 11 6.03917 11.2107 6.41425 11.5858C6.78932 11.9609 7 12.4696 7 13V18.9999C7 19.5303 6.78932 20.0391 6.41425 20.4142C6.03917 20.7893 5.53043 20.9999 5 20.9999C4.46957 20.9999 3.96089 20.7893 3.58582 20.4142C3.21074 20.0391 3 19.5303 3 18.9999V13Z" stroke="#E8E8E8" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> 193 <path d="M19 11V10C19 8.14348 18.2625 6.36305 16.9498 5.05029C15.637 3.73754 13.8565 3 12 3C10.1435 3 8.36305 3.73754 7.05029 5.05029C5.73754 6.36305 5 8.14348 5 10V11" stroke="#E8E8E8" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> 194 </svg> 195 </div>`; 196 } else { 197 audioSvg = '' 198 } 199 audio.style.display = 'none'; 200 } 201 }); 202 if (befor.getAttribute('status') === 'true') { 203 befor.innerHTML += `<div class="blockSub-slide_before_svg">` + 204 audioSvg + 205 `<div class="blockSub-slide_before_svgBook"> 206 <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"> 207 <path d="M11.0039 3.33784C12.8878 2.25505 14.9394 1.49458 17.0739 1.08784C17.5549 0.972565 18.0562 0.970724 18.538 1.08247C19.0199 1.19421 19.4691 1.41641 19.8503 1.73164C20.2315 2.04686 20.5342 2.44645 20.7344 2.89875C20.9346 3.35105 21.0268 3.84374 21.0039 4.33784V13.3378C20.9738 14.4549 20.5705 15.5296 19.8582 16.3906C19.1458 17.2515 18.1656 17.8491 17.0739 18.0878C14.9394 18.4946 12.8878 19.255 11.0039 20.3378" stroke="#E8E8E8" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> 208 <path d="M11.0034 3.33784C9.11951 2.25505 7.06799 1.49458 4.93348 1.08784C4.45247 0.972565 3.95122 0.970724 3.46937 1.08247C2.98752 1.19421 2.53829 1.41641 2.15711 1.73164C1.77594 2.04686 1.47323 2.44645 1.27302 2.89875C1.07281 3.35105 0.980504 3.84374 1.00343 4.33784V13.3378C1.0335 14.4549 1.43691 15.5296 2.14924 16.3906C2.86158 17.2515 3.84184 17.8491 4.93348 18.0878C7.06799 18.4946 9.11951 19.255 11.0034 20.3378" stroke="#E8E8E8" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> 209 <path d="M11.0039 20.3379V3.33789" stroke="#E8E8E8" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> 210 </svg> 211 </div> 212 </div> 213 ${timeLesson.trim().length > 0 ? `<div class="blockSub-slide_before_time">${timeLesson.trim()}</div>` : ''} 214 `; 215 } else { 216 befor.innerHTML += `<div class="blockSub-slide_before_svgLock">
217 <svg width="41" height="47" viewBox="0 0 41 47" fill="none" xmlns="http://www.w3.org/2000/svg"> 218 <path d="M36.6071 20.5625H34.4107V13.9531C34.4107 6.26055 28.1692 0 20.5 0C12.8308 0 6.58929 6.26055 6.58929 13.9531V20.5625H4.39286C1.96763 20.5625 0 22.5361 0 24.9688V42.5938C0 45.0264 1.96763 47 4.39286 47H36.6071C39.0324 47 41 45.0264 41 42.5938V24.9688C41 22.5361 39.0324 20.5625 36.6071 20.5625ZM27.0893 20.5625H13.9107V13.9531C13.9107 10.3088 16.8667 7.34375 20.5 7.34375C24.1333 7.34375 27.0893 10.3088 27.0893 13.9531V20.5625Z" fill="#FDFDFD"/> 219 </svg> 220 <div class="blockSub-slide_before_data">${nextOpenDate.trim()}</div> 221 </div>`; 222 } 223 }); 224 225 //subscription_posts 226 function positionAddiction() { 227 document.querySelectorAll('.subscriptions-posts .subscriptions-post').forEach((post) => { 228 let key = post.getAttribute('key'); 229 let { top } = post.getBoundingClientRect(); 230 document.querySelectorAll('.subscriptions-posts_addition').forEach((addition) => { 231 if (addition.getAttribute('addition-key') === key) { 232 addition.style.top = top + 210 + 'px'; 233 } 234 }) 235 }) 236 }; 237 238 if (document.querySelector('.subscriptions-posts')) { 239 document.addEventListener('scroll', function () { 240 positionAddiction(); 241 }) 242 243 document.querySelectorAll('.subscriptions-posts .subscriptions-post').forEach((elem) => { 244 elem.addEventListener('click', function () { 245 document.querySelectorAll('.subscriptions-posts .subscriptions-post').forEach((post) => { 246 post.style.marginBottom = '0'; 247 }); 248 let key = elem.getAttribute('key'); 249 document.querySelectorAll('.subscriptions-posts_addition').forEach((addition) => { 250 if (addition.getAttribute('addition-key') === key) { 251 if (window.getComputedStyle(addition).display === 'none') { 252 elem.style.marginBottom = '0'; 253 } else { 254 let heightAddition = window.getComputedStyle(addition).height; 255 let ind = heightAddition.indexOf('p'); 256 heightAddition = heightAddition.slice(0, ind); 257 elem.style.marginBottom = Number(heightAddition) + 60 + 'px'; 258 } 259 } 260 }) 261 positionAddiction(); 262 }) 263 }) 264 } 265 266 267 //Subscription Lesson 268 if (window.innerWidth > 900) { 269 let listTxt = document.body.querySelectorAll('.sub_less_cnt ol li'); 270 listTxt.forEach((list) => { 271 let list_txt = list.innerHTML; 272 let del = list_txt.substring(list_txt.indexOf('<'), (list_txt.indexOf('>')+1)); 273 if (del.length > 0) { 274 list_txt = list_txt.replace(del, ''); 275 del = list_txt.substring(list_txt.indexOf('</')); 276 list_txt = list_txt.replace(del, ''); 277 278 let count = list_txt.indexOf('.'); 279 let list_title = list_txt.substring(0, count); 280 let list_cnt = list_txt.substring(count + 1, list_txt.length).trim(); 281 282 list.textContent = list_title; 283 284 let p_list_cnt = document.createElement("p"); 285 p_list_cnt.textContent = list_cnt; 286 list.after(p_list_cnt); 287 } 288 }); 289 }; 290 291 if (document.querySelector('.sub_less__mobile-title')) { 292 document.querySelector('.sub_less__mobile-title').innerText = document.querySelector('.sub_less_title h3').textContent; 293 } 294 295 296 window.addEventListener('resize', function () { 297 adaptiveSubscriptionLesson(); 298 }) 299 300 adaptiveSubscriptionLesson(); 301 302 function adaptiveSubscriptionLesson() { 303 if (document.querySelectorAll('.img-collage_wrp').length !== 0) { 304 let wrapImage = document.querySelectorAll('.img-collage_wrp'); 305 if (wrapImage.length !== 0) { 306 if (document.body.clientWidth <= 900) { 307 wrapImage[0].style.display = wrapImage[2].style.display = 'none'; 308 } else { 309 wrapImage[0].style.display = wrapImage[2].style.display = 'block'; 310 } 311 } 312 } 313 } 314 315 if (document.querySelectorAll('.sub_less_tag ul li')) { 316 document.querySelectorAll('.sub_less_tag ul li').forEach((li) => { 317 let a = li.innerHTML.replace('#', ''); 318 li.innerHTML = ''; 319 li.innerHTML += a; 320 }) 321 } 322 }) 323})();
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.