1$(document).ready(function(){let n=$("header.header");if(n.length){function e(){var e=$(window).scrollTop();0<e?n.addClass("fixed"):e<10&&!$("body").hasClass("disable_scroll_body")&&n.removeClass("fixed")}$(window).on("scroll",e),e()}window.innerWidth<=1024&&($(".header .personality .personality_link").on("click",function(e){e.preventDefault(),openPersonalMenuMobile()}),$(".header .personality .header-personal-menu .head_personal_menu_mobile .col_icon_close").on("click",function(e){e.preventDefault(),closePersonalMenuMobile()}))}); 2(()=>{const e=()=>{const e=document.getElementById("header");if(!e)return;const t=(e.dataset.lmsBase||"").replace(/\/+$/,""),a=e=>t+e,l=encodeURIComponent(window.location.href);function o(){fetch(a("/api/users/logout"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}}).finally(()=>window.location.reload())}e.querySelectorAll("[data-lms-login]").forEach(e=>{e.href=`${a("/login")}?redirect=${l}`}),e.addEventListener("click",e=>{e.target.closest("[data-lms-login]")?e.stopPropagation():e.target.closest("[data-lms-logout]")&&(e.preventDefault(),e.stopPropagation(),o())},!0),e.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||!e.target.closest("[data-lms-logout]")||(e.preventDefault(),e.stopPropagation(),o())},!0),fetch(a("/api/header-user"),{credentials:"include"}).then(e=>e.ok?e.json():null).then(a=>{a&&a.loggedIn&&function(a){const l=(a.firstName||"").trim();e.querySelectorAll("[data-lms-name]").forEach(e=>{e.textContent=l,e.hidden=!l});const o=(a.email||"").trim();e.querySelectorAll("[data-lms-email]").forEach(e=>{e.textContent=o,e.hidden=!o});const n=(s=a.avatarUrl,s?/^https?:\/\//.test(s)?s:t+s:null);var s;n&&e.querySelectorAll("[data-lms-avatar]").forEach(e=>{e.src=n});e.querySelectorAll("[data-lms-guest]").forEach(e=>e.classList.add("lms-auth-hidden")),e.querySelectorAll("[data-lms-auth]").forEach(e=>e.classList.remove("lms-auth-hidden")),e.classList.add("lms-logged-in")}(a)}).catch(()=>{}).finally(()=>{e.querySelectorAll(".lms-auth-pending").forEach(e=>{e.classList.remove("lms-auth-pending")})})};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()})(); 3jQuery(function ($) { 4 // Add wrappers 5 $(".mega-menu > ul > li.menu-item-28760 > .sub-menu").wrap("<div class='sub-menu-wrap sub-menu-wrap_1'></div>"); 6 $(".mega-menu > ul > li.menu-item-1503 > .sub-menu").wrap("<div class='sub-menu-wrap sub-menu-wrap_2'></div>"); 7 $(".mega-menu > ul > li.menu-item-1320 > .sub-menu").wrap("<div class='sub-menu-wrap sub-menu-wrap_3'></div>"); 8 $(".header .sub-menu-wrap_3 > .sub-menu > li:nth-of-type(1), .header .sub-menu-wrap_3 > .sub-menu > li:nth-of-type(2)").wrapAll("<div class='sub-menu_left'></div>"); 9 $(".mega-menu > ul > li.menu-item-433 > .sub-menu").wrap("<div class='sub-menu-wrap sub-menu-wrap_4'></div>"); 10 // Add classes 11 12 // Select the first two <li> elements 13 const firstTwoItems = $('.mega-menu > ul > li.menu-item-1503 .sub-menu-wrap_2 > .sub-menu > li').slice(0, 2); 14 15 // Wrapping into a new element 16 firstTwoItems.wrapAll('<div class="col_left_sub_menu_wrap_2"></div>'); 17 18 $(".mega-menu").addClass("ready"); 19 20 $('.mega-menu ul li.menu-item-1320 .sub-menu-wrap_3 >.sub-menu').append('<div class="sub-menu_right"></div>') 21 22 $('.sub-menu_right').html($('.wrap_websites_list_menu').html()); 23 $('.wrap_websites_list_menu').remove() 24 25 $('.sub-menu .active').parents('.menu-item-has-children').addClass('current-menu-parent'); 26 $('.sub-menu .collections-active').parents('.menu-item-1320').addClass('current-menu-parent'); 27 28}); 29 30jQuery(function(i){let m=window.location.pathname.replace(/\/$/,"");if(i(".menu-item-acf").each(function(){var e=i(this);let n=!1;e.find(".sub-menu-link").each(function(){var e=i(this).attr("href");e&&(e=e.replace(window.location.origin,"").replace(/\/$/,""))&&"/"!==e&&"#"!==e&&e===m&&(i(this).addClass("active"),n=!0)}),n&&e.addClass("active");var a=e.children("a.main-menu-link, div.main-menu-link");a.length&&(a=a.attr("href"))&&a.replace(window.location.origin,"").replace(/\/$/,"")===m&&e.addClass("active")}),window.innerWidth<=1024)i(".wrapper_mega_menus .mega-menu-acf-nav .mega-menu-acf .menu-item-acf .main-menu-link.has_sub_mega_menu").on("click",function(e){e.preventDefault();var e=i(this).parents(".menu-item-acf"),n=e.find(".title_main_menu").text(),a=i(".mega_menu_mobile");e.addClass("hover"),i(".mega_menu_mobile .header_mega_menu_mobile .title_main-menu-link").text(n),a.addClass("open_sub"),i(".wrapper_mega_menus .mega-menu-acf-nav .mega-menu-acf .menu-item-acf .main-menu-link").addClass("hide");let m=i(".wrapper_mega_menus");isScrollable(m)?a.addClass("scrollable_menu"):a.removeClass("scrollable_menu"),m.on("scroll",function(){0<m.scrollTop()?i(".mega_menu_mobile").addClass("scrolled_menu"):i(".mega_menu_mobile").removeClass("scrolled_menu")})}),i(".mega_menu_mobile .header_mega_menu_mobile .wrap_back_btn_menu").on("click",function(){i(".mega_menu_mobile").removeClass("open_sub"),i(".wrapper_mega_menus .mega-menu-acf-nav .mega-menu-acf .menu-item-acf").removeClass("hover"),i(".wrapper_mega_menus .mega-menu-acf-nav .mega-menu-acf .menu-item-acf .main-menu-link").removeClass("hide")}),i(".burger").on("click",function(){(i(".mega_menu_mobile").hasClass("open")?closeMegaMenuMobile:openMegaMenuMobile)()});else i(".wrapper_mega_menus .mega-menu-acf-nav .mega-menu-acf .menu-item-acf").hover(function(){var e,n=i(this),a=n.find(".wrapper_container_sub_mega_menu").first();n.addClass("hover"),0!==a.length&&(a.css("left",""),n=a[0].getBoundingClientRect(),e=.03*window.innerWidth,0<(n=n.right+e-window.innerWidth))&&a.css("left",`-${n}px`)},function(){var e=i(this),n=e.find(".wrapper_container_sub_mega_menu").first();e.removeClass("hover"),n.css("left","")})}); 31$(function(){ 32 33 34 35 // // copyToClipboard 36 37 // $(".copy-link-contact").on("click", function() { 38 39 // $('.popups-notifications-copied .headline').text('ÐдÑÐµÑ ÑкопиÑован'); 40 41 // $('.popups-notifications-copied .description').text('Ðн Ñже в Ñвоем бÑÑеÑе обмена'); 42 43 // }); 44 45 // $('#btn-contact').on('click', function(event){ 46 // var input_value = $(this).parents('.popup-form').find('.input-name').val(); 47 48 // if (!input_value.match(/[^а-ÑÐ-Яa-zA-Z -]/s)){ 49 // $(this).parents('.popup-form').find('.input-error-info').removeClass('active'); 50 // $(this).parents('.popup-form').find('.input-name').removeClass('error'); 51 // } 52 // else{ 53 // if ((input_value !== '')) { 54 // $(this).parents('.popup-form').find('.input-error-info').addClass('active'); 55 // $(this).parents('.popup-form').find('.input-error-info').text('ÐÑо поле не Ð¼Ð¾Ð¶ÐµÑ ÑодеÑжаÑÑ ÑиÑÑÑ Ð¸Ð»Ð¸ ÑимволÑ'); 56 // $(this).parents('.popup-form').find('.input-name').addClass('error'); 57 // return false;
58 // } 59 // } 60 61 // }) 62 63$('#btn-contact').on('click', function(event){ 64 var input_value = $(this).parents('.popup-form').find('.input-name').val(); 65 66 // РегÑлÑÑное вÑÑажение Ð´Ð»Ñ Ð¿ÑовеÑки на ÑказаннÑе ÑÐ¸Ð¼Ð²Ð¾Ð»Ñ 67 var pattern = /[\/\*,\+=\.\@\#â´_\&\(\)\"\:\';\!\?\%]/; 68 69 // ÐÑовеÑка на ÑооÑвеÑÑÑвие ÑегÑлÑÑÐ½Ð¾Ð¼Ñ Ð²ÑÑÐ°Ð¶ÐµÐ½Ð¸Ñ 70 if (!pattern.test(input_value)) { 71 // ÐÑе ÑÐ¸Ð¼Ð²Ð¾Ð»Ñ Ð²Ð°Ð»Ð¸Ð´Ð½Ñ 72 $(this).parents('.popup-form').find('.input-error-info').removeClass('active'); 73 $(this).parents('.popup-form').find('.input-name').removeClass('error'); 74 } else { 75 // ÐÑли Ð½Ð°Ð¹Ð´ÐµÐ½Ñ Ð½ÐµÐ´Ð¾Ð¿ÑÑÑимÑе ÑимволÑ, показаÑÑ ÑообÑение об оÑибке 76 $(this).parents('.popup-form').find('.input-error-info').addClass('active'); 77 $(this).parents('.popup-form').find('.input-error-info').text('ÐÑо поле не Ð¼Ð¾Ð¶ÐµÑ ÑодеÑжаÑÑ ÑледÑÑÑие ÑимволÑ: ,/*+=.@#â´_&()":\';!?%'); 78 $(this).parents('.popup-form').find('.input-name').addClass('error'); 79 event.preventDefault(); // ÐÑедоÑвÑаÑаем оÑпÑÐ°Ð²ÐºÑ ÑоÑÐ¼Ñ 80 } 81}); 82 83 84 85 // $( "#fname" ).datepicker({ 86 87 // changeMonth: true, 88 89 // changeYear: true, 90 91 // monthNamesShort: [ "ЯнваÑÑ", "ФевÑалÑ", "ÐаÑÑ", "ÐпÑелÑ", "Ðай", "ÐÑнÑ", "ÐÑлÑ", "ÐвгÑÑÑ", "СенÑÑбÑÑ", "ÐкÑÑбÑÑ", "ÐоÑбÑÑ", "ÐекабÑÑ" ], 92 93 // dayNamesMin: [ "Ðн", "ÐÑ", "СÑ", "ЧÑ", "ÐÑ", "Сб", "ÐÑ" ], 94 95 // dateFormat: "dd.mm.yy", 96 97 // showOtherMonths: true, 98 99 // selectOtherMonths: true, 100 101 // }); 102 103 104 105 // 106 107}); 108jQuery(function(n){n(".input-for-banners").on("input",function(){n(".clear-icon").css("display","block"),""==n(this).val()&&(n(this).removeClass("wpcf7-not-valid"),n(this).parents(".input-wrap").find(".wpcf7-not-valid-tip").css("display","none"),n("#clear").css("display","none"))}),n(".clear-icon").on("click",function(){n(this).parents(".input-wrap").find("input").val(""),n(this).css("display","none"),n(this).parents(".input-wrap").find(".wpcf7-not-valid-tip").css("display","none"),n(this).parents(".input-wrap").find("input").removeClass("wpcf7-not-valid")}),(769<=window.innerWidth&&window.innerWidth<=1366||1601<=window.innerWidth&&window.innerWidth<=2300?n(".banner-subscription-article .mail-subscription.--desk_mobile"):n(".banner-subscription-article .mail-subscription.--laptop")).remove(),n(".banner-subscription-article .yellow-btn").find("span").text("ÐодпиÑаÑÑÑÑ")}); 109jQuery(function(e){function t(){window.removeEventListener("scroll",t),document.removeEventListener("click",t),"function"==typeof getCurrentLocation&&getCurrentLocation().then(t=>{if(!t||!t.country_code)return;const o=String(t.country_code).toLowerCase(),s=e(".popups-sing-up-last-step #country_select");s.length&&(s.attr("data-country-code",o),"function"==typeof loadCountriesFromJson&&loadCountriesFromJson(e=>{const t=e.find(e=>e.code===o);t&&s.val(t.name)}))}).catch(()=>{})}window.addEventListener("scroll",t),document.addEventListener("click",t),e(".copy").on("click",function(){var t,o;t=".post-link-copy",o=e("<input>"),e("body").append(o),o.val(e(t).text()).select(),document.execCommand("copy"),o.remove()}),e(".popup-container").on("click",function(t){let o=e(".popup-hide");const s=e(this).hasClass("popup-not-close"),n=e(this).hasClass("popup-container-sing-up-last-step"),i=isUserLogged();!e(t.target).is(e(".popup-container"))||t.target.classList.contains("iti__dropdown-content")||t.target.classList.contains("iti__country")||t.target.classList.contains("iti__country-name")||t.target.classList.contains("popups-countries-close")||(s?disableScroll():(!i&&n&&redirectAfterLoginRegisterPopups(),o.removeClass("show"),o.parents(".popup-container").removeClass("show"),o.prev(".bg-dark").removeClass("show"),enableScroll(),e(".popups-elements-selection").removeClass("changed"),e(".selections-validate").removeClass("active"),setTimeout(function(){e(".popup-container-add-to-knowledges .list").animate({scrollTop:0},0)},1e3)))}),e(".popup-container-countries .popup-close").on("click",function(){e(".popup-container-sing-up-last-step").hasClass("show")&&e(".popup-container-sing-up-last-step").addClass("show")}),e(".popups-filters-resources .popups-elements-sorting .menu-item2 .text").hasClass("selected")?e(".popups-filters.popups-filters-resources").addClass("selected"):e(".popups-filters.popups-filters-resources").removeClass("selected"),e(".checkbox-popup input").on("click",function(){e(this).toggleClass("checked")});var o=e(".all-countries_profile .countries-list_inner"),s=o.find(".alphabetically .country-name");function n(){e("#registraition-last_step .input_last_step").each(function(){e(this).val()?"tel"!=e(this).attr("id")&&e(this).val().match(/[^а-ÑÐ-ЯÑÐÑÐÑÐÑÐÒÒa-zA-Z -]/)?(e(this).parents(".dropdown-multiple-choice").addClass("error"),e(this).addClass("error"),e(this).parents(".input-container").find(".input-error-info").html("ÐÑо поле не Ð¼Ð¾Ð¶ÐµÑ ÑодеÑжаÑÑ ÑиÑÑÑ Ð¸Ð»Ð¸ ÑимволÑ")):e(this).is("#tel")&&!e(this).val().match(/^\d{4,}$/)?(e(this).addClass("error"),e(this).parents(".input-container").find(".input-error-info").html("ÐÑо поле должно ÑодеÑжаÑÑ ÑолÑко ÑиÑÑÑ Ð¸ бÑÑÑ Ð´Ð»Ð¸Ð½Ð¾Ð¹ не менее 4 Ñимволов")):(e(this).removeClass("error"),e(this).parents(".input-container").find(".input-error-info").html("")):(e(this).parents(".dropdown-multiple-choice").addClass("error"),e(this).addClass("error"),e(this).parents(".input-container").find(".input-error-info").html("ÐÑо поле нÑжно заполниÑÑ"))})}e(document).keydown(function(t){var n=t.key.toLowerCase();s.each(function(){if(e(this).text().trim().toLowerCase().charAt(0)===n)return o.scrollTop(e(this).position().top-o.position().top+o.scrollTop()),!1})}),window.innerWidth>1024&&(e("body").on("click",".all-countries .field",function(){e(this).parents(".all-countries").hasClass("active")?e(this).parents(".all-countries").removeClass("active"):(e(".all-countries").removeClass("active"),e(this).parents(".all-countries").addClass("active"))}),e(".all-countries_profile .field2").on("click",function(){var t=e(this).parents(".all-countries_profile");if(t.toggleClass("active"),t.hasClass("active")){var o=(e(window).outerHeight()-e(".countries-list").outerHeight())/2;e("html, body").animate({scrollTop:e(".countries-list").offset().top-o+"px"},200)}}),e("body").find(".popups-edit-data-profile .iti__selected-flag").on("click",function(){var t=e(this).parents(".iti");if(t.toggleClass("active"),t.hasClass("active")){var o=(e(window).outerHeight()-e(".iti__dropdown-content").outerHeight())/2;e("html, body").animate({scrollTop:e(".iti__dropdown-content").offset().top-o+"px"},200)}var s=e(".popups-edit-data-profile .input-with-placeholder_phone").innerWidth();console.log(s),e(".iti__dropdown-content").css("width",s),console.log(e(".iti__dropdown-content").innerWidth())})),window.innerWidth<=1024&&(e(".all-countries_profile").on("click",function(){showPopup(".popup-container-countries")}),e(".popup-container-sing-up-last-step .all-countries").on("click",function(){showPopup(".popup-container-countries"),e(".popup-container-sing-up-last-step").addClass("show")})),e(document).on("click","body .countries-list_item",function(t){e(".countries-list_item").removeClass("selected"),e(this).addClass("selected");var o=e(this).find(".country-name").text();e(".popup-container-countries").removeClass("show"),e("#country_select, #user_country").val(o),e(this).parents(".dropdown-multiple-choice").removeClass("active"),enableScroll()}),e(document).mouseup(function(t){var o=e(".dropdown-multiple-choice");o.is(t.target)||0!==o.has(t.target).length||o.removeClass("active");var s=e(".popups-edit-data-profile .iti");s.is(t.target)||0!==s.has(t.target).length||s.removeClass("active")}),e("#btn-contact").on("click",function(t){var o=e(this).parents(".popup-form").find(".input-name").val();if(e(this).parents(".popup-form").find("#phone").length>0)e(this).parents(".popup-form").find(".input-error-info").removeClass("active"),e(this).parents(".popup-form").find(".input-name").removeClass("error");else{if(/[\/\*,\+=\.\@\#â´_\&\(\)\"\:\';\!\?\%]/.test(o))return e(this).parents(".popup-form").find(".input-error-info").addClass("active"),e(this).parents(".popup-form").find(".input-error-info").text("ÐÑо поле не Ð¼Ð¾Ð¶ÐµÑ ÑодеÑжаÑÑ ÑледÑÑÑие ÑимволÑ: ,/*+=.@#â´_&()\":';!?%"),e(this).parents(".popup-form").find(".input-name").addClass("error"),void t.preventDefault();e(this).parents(".popup-form").find(".input-error-info").removeClass("active"),e(this).parents(".popup-form").find(".input-name").removeClass("error")}}),e("#createSelection").on("click",function(){n()}),e("#btn_last_step").on("click",function(){let t=e(this).val(),o=e(this),s=e(".popups-sing-up-last-step #name").val(),i=e(".popups-sing-up-last-step #last_name").val(),p=e(".popups-sing-up-last-step #country_select").val(),a=e(".popups-sing-up-last-step #tel").val(),r=e("body").find(".popups-sing-up-last-step .iti__selected-dial-code").text(),c=e('.popups-sing-up-last-step input[name="user_id"]').val(),u=!1;return n(),s&&i&&p&&a&&!s.match(/[^а-ÑÐ-ЯÑÐÑÐÑÐÑÐÒÒa-zA-Z -]/)&&!i.match(/[^а-ÑÐ-ЯÑÐÑÐÑÐÑÐÒÒa-zA-Z -]/)&&a.match(/^\d{4,}$/)&&(u=!0),u&&(o.parents(".button-with-loader").addClass("submitting"),o.val(""),e.ajax({url:"/wp-admin/admin-ajax.php",type:"POST",data:{action:"reg_last_step",user_first_name:s,user_last_name:i,user_country:p,user_tel:a,user_phone_code:r,user_id:c},dataType:"json",cache:!1,success:function(s){if(o.parents(".button-with-loader").removeClass("submitting"),o.val(t),s.success){s.data.status?redirectAfterLoginRegisterPopups():(showPopup(".popup-container-message-notification"),e(".popup-container-message-notification .headline-h3").text("УпÑ⦠ЧÑо-Ñо поÑло Ð
109½ÐµÂ Ñак"),e(".popup-container-message-notification .description").text("Ðам не ÑдалоÑÑ ÑÐµÐ±Ñ Ð°Ð²ÑоÑизиÑоваÑÑ. ÐÑ Ñже занимаемÑÑ ÑÑой пÑоблемой, а пока попÑобÑй пожалÑйÑÑа еÑÑ Ñаз!"),e(".popup-container-message-notification .text3").text("ÐопÑобоваÑÑ ÐµÑе Ñаз"),e(".popups-success-message-contact").addClass("message-error"))}else showPopup(".popup-container-message-notification"),e(".popup-container-message-notification .headline-h3").text("УпÑ⦠ЧÑо-Ñо поÑло не Ñак"),e(".popup-container-message-notification .description").text("Ðам не ÑдалоÑÑ ÑÐµÐ±Ñ Ð°Ð²ÑоÑизиÑоваÑÑ. ÐÑ Ñже занимаемÑÑ ÑÑой пÑоблемой, а пока попÑобÑй пожалÑйÑÑа еÑÑ Ñаз!"),e(".popup-container-message-notification .text3").text("ÐопÑобоваÑÑ ÐµÑе Ñаз"),e(".popups-success-message-contact").addClass("message-error"),load_reply.text("ÐШÐÐÐÐ: "+s.data)},error:function(e,s,n){o.parents(".button-with-loader").removeClass("submitting"),o.val(t),alert("ÐШÐÐÐÐ AJAX запÑоÑа: "+s)}})),!1});const i=e(".popup-container-code-register-user");if(i.length){const a=i.find(".popups-code-register-user"),r=a.find(".timer-popup"),c=a.find(".timer-min-popup"),u=a.find(".btn-popup");let l=null;function p(e){const t=Math.floor(e/60),o=e%60;c.text(String(t).padStart(2,"0")+":"+String(o).padStart(2,"0"))}window.startPopupTimer=function(e){e&&"number"==typeof e||(e=600),clearInterval(l),l=null,r.removeAttr("hidden").attr("aria-hidden","false"),u.attr("hidden","").attr("aria-hidden","true").attr("tabindex","-1");let t=e;p(t),l=setInterval(function(){t--,t>=0?p(t):(clearInterval(l),l=null,a.removeClass("is_timer_popup").addClass("is_btn_popup"),r.attr("hidden","").attr("aria-hidden","true"),u.removeAttr("hidden").attr("aria-hidden","false").removeAttr("tabindex"))},1e3)}}e("#create-account, .popups-code-register-user .resend_code_register").on("click",function(){let t=e(this);const o=e(".popups-sign-up input#email"),s=e(".popups-sign-up input#pass");let n=o.val(),i=s.val();const p=e(".popup-container-sing-up").hasClass("landing_course_style_popup"),a=getCurrentPageId();if(e(".popups-sign-up .email-error-info").html(""),o.removeClass("error"),e(".popups-sign-up .pass-error-info").html(""),s.removeClass("error"),n&&i){t.addClass("submitting"),t.find(".text5").css("opacity","0");let o={action:"createusermail",user_mail:n,user_pass:i};p&&(o.is_landing_course_popup=!0,o.page_id=a),e.ajax({url:"/wp-admin/admin-ajax.php",type:"POST",data:o,dataType:"json",cache:!1,success:function(o){if(t.removeClass("submitting"),t.find(".text5").css("opacity","1"),o.success){let t=o.data;if(t.status){e(".popups-code-register-user .mail").html(o.data.email);const t=e(".popup-container-code-register-user").find(".popups-code-register-user");o.data.already_sent?o.data.can_send?t.removeClass("is_timer_popup").addClass("is_btn_popup"):(startPopupTimer(o.data.seconds_left),t.removeClass("is_btn_popup").addClass("is_timer_popup")):(t.removeClass("is_btn_popup").addClass("is_timer_popup"),startPopupTimer(180)),showPopup(".popup-container-code-register-user"),setTimeout(function(){e(".popup-container-code-register-user.show").find(".code-input .input1").focus()})}else"email"==t.type?(e(".popups-sign-up .email-error-info").html(t.msg),e(".popups-sign-up input#email").addClass("error")):"pass"==t.type&&(e(".popups-sign-up .pass-error-info").html(t.msg),e(".popups-sign-up input#pass").addClass("error"))}else load_reply.text("ÐШÐÐÐÐ: "+o.data)},error:function(t,o,s){e(this).removeClass("submitting"),e(this).find(".text5").css("opacity","1"),alert("ÐШÐÐÐÐ AJAX запÑоÑа: "+o)}})}else n||(e(".popups-sign-up .email-error-info").html("ÐÑо поле нÑжно заполниÑÑ"),e(".popups-sign-up #email").addClass("error")),i||(e(".popups-sign-up .pass-error-info").html("ÐÑо поле нÑжно заполниÑÑ"),e(".popups-sign-up #pass").addClass("error"))}),e("#confirm_code_register").on("click",function(){let t=e(this),o="",s=e(".popups-sign-up #email").val(),n=e(".popups-sign-up #pass").val();if(e(".code-input input").each(function(){o+=e(this).val()}),""!==o){t.addClass("submitting"),t.find(".text4").css("opacity","0");let i={action:"confirmcode",code:o,user_mail:s,user_pass:n};e.ajax({url:"/wp-admin/admin-ajax.php",type:"POST",data:i,dataType:"json",cache:!1,success:function(o){if
109(t.removeClass("submitting"),t.find(".text4").css("opacity","1"),o.success){let t=o.data;SignUpSuccess(),t.status?(showPopup(".popup-container-sing-up-last-step"),e('#registraition-last_step input[name="user_id"]').val(t.user_id)):(e(".popup-container-code-register-user .code-input-error").addClass("show-error"),e(".popup-container-code-register-user .code-input-error span").html(t.msg))}else t.removeClass("submitting"),t.find(".text4").css("opacity","1"),load_reply.text("ÐШÐÐÐÐ: "+o.data)},error:function(e,t,o){alert("ÐШÐÐÐÐ AJAX запÑоÑа: "+t)}})}else e(".popup-container-code-register-user .code-input-error").addClass("show-error"),e(".popup-container-code-register-user .code-input-error span").html("Ðе введен код подÑвеÑждениÑ")}),e(".repeat-code").click(function(){console.log("test"),e(".repeat-code").hide(),e(".timer").show(),e(".code-timer").text("59"),timerDecrement()}),e("#user_birthday").length&&(e("#user_birthday").datepick(e.extend({pickerClass:"my-picker",maxDate:new Date},e.datepick.regionalOptions.ru)),e("body").on("click",".datepick td a",function(){e(".page-template-page-edit-profile").addClass("was_changed_profile"),e("#user_birthday").parents(".dropdown-multiple-choice").find(".placeholder").addClass("active")})),e(".change-email:not(.page-edit-profile-form)").on("click",function(){showPopup(".popup-container-sing-up")}),e(".change-email.page-edit-profile-form").on("click",function(){e(".popup-container-code-countdown").removeClass("show")}),e("#btn-suggest").on("click",function(t){var o=e(this).parents(".popup-container").find(".input-name").val();if(o.match(/[^а-ÑÐ-Яa-zA-Z -]/s)){if(""!==o&&o.match(/[^а-ÑÐ-Яa-zA-ZÑÐÑÐÑÐÒÒ\s\-]/))return e(this).parents(".popup-container").find(".input-error-info").addClass("active"),e(this).parents(".popup-container").find(".input-error-info").text("ÐÑо поле не Ð¼Ð¾Ð¶ÐµÑ ÑодеÑжаÑÑ ÑиÑÑÑ Ð¸Ð»Ð¸ ÑимволÑ"),e(this).parents(".popup-container").find(".input-name").addClass("error"),!1}else e(this).parents(".popup-container").find(".input-error-info").removeClass("active"),e(this).parents(".popup-container").find(".input-name").removeClass("error")})}),$(function(){const e=".popup-nudge-landing";if(0===$(e).length)return;const t=document.querySelector(".universal-section-payment-landings-page, .section_payment");if(!t)return;let o=null,s=!1,n=null,i=null;function p(){o||s||(o=setTimeout(function(){$(".popup-container.show").length>0?c():(s=!0,showPopup(e),c(),setTimeout(function(){initializePhoneInputs(),window.dispatchEvent(new Event("resize"))},100))},3e4))}function a(){n&&(n.disconnect(),n=null)}function r(){i&&($(window).off("scroll",i),i=null)}function c(){o&&(clearTimeout(o),o=null),a(),r(),$(window).off("beforeunload",u),$(window).off("pagehide",u)}function u(){c()}if($(window).on("beforeunload",u),$(window).on("pagehide",u),"undefined"==typeof IntersectionObserver)return i=()=>{const e=t.getBoundingClientRect();e.top<.9*window.innerHeight&&e.bottom>0&&(r(),p())},$(window).on("scroll",i),void i();n=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&(a(),p())})},{threshold:0,rootMargin:"0px 0px -10% 0px"}),n.observe(t)}),$(document).ready(function(){const e=".popup-container-message-notification-style-2",t=$(e);document.addEventListener("wpcf7mailsent",function(o){"24270"!=o.detail.contactFormId&&"30906"!=o.detail.contactFormId&&"7097"!=o.detail.contactFormId||(t.attr("data-type-popup","success_popup"),showPopup(e))},!1),document.addEventListener("wpcf7mailfailed",function(o){"24270"!=o.detail.contactFormId&&"30906"!=o.detail.contactFormId&&"7097"!=o.detail.contactFormId||(t.attr("data-type-popup","error_popup"),showPopup(e))},!1)}); 110$(function(){ 111 const footerSelector = "footer.footer"; 112 const footerEl = $(footerSelector); 113 if (footerEl.length) { 114 //BUTTON SCROLL TOP 115 $(`${footerSelector} .btn_scroll_top`).on("click", function () { 116 // $("html, body").animate({scrollTop: 0}, 1000); 117 window.scrollTo({ top: 0, behavior: "smooth" }); 118 }); 119 //BUTTON SCROLL TOP END 120 121 //TOGGLE OPEN MENU LISTS ON MOBILE 122 if(innerWidth <= 1024) { 123 $(`${footerSelector} .footer-hyperlinks-column .wrapper_title_menu`).on("click", function () { 124 const colMenuFooter = $(this).parents(".col_menu_footer"); 125 colMenuFooter.toggleClass("open"); 126 colMenuFooter.find(".links_menu_footer").slideToggle(600); 127 }); 128 } 129 //TOGGLE OPEN MENU LISTS ON MOBILE END 130 } 131 132 133 if(innerWidth<=1024){ 134 $(".footer-menu .menu-item-has-children>a").click(function(){ 135 $(this).parents('.menu-item-has-children').toggleClass("active"); 136 return false;
137 }); 138 } 139}); 140 141$(document).ready(function () { 142 const fingersSelector = '.wrapper_likes_dislike_fingers .finger'; 143 144 $(document).on('click', fingersSelector, function () { 145 const $this = $(this); // Store a reference to the clicked element 146 147 // Remove 'active' class from all .finger elements except the clicked one 148 $(fingersSelector).not($this).removeClass('active'); 149 150 // Toggle 'active' class on the clicked element 151 $this.toggleClass('active'); 152 }); 153 154}); 155 156jQuery(function(i){function e(){i(".page-template-page-edit-profile").addClass("was_changed_profile")}function t(){i(".page-template-page-edit-profile").addClass("was_changed_pass")}i(".edit-profile .info-callout .button").on("click",function(){var t=i(".phone-number .phone input").val(),o=i("body").find(".phone .iti__selected-dial-code").text();t?(i(".popup-container-sms-code-countdown .subtitle .text2").html("ÐÑ Ð¾ÑпÑавили код подÑвеÑÐ¶Ð´ÐµÐ½Ð¸Ñ Ð½Ð° ÑелеÑон:"),i.ajax({url:"/wp-admin/admin-ajax.php",type:"POST",data:{action:"sendsmscode",user_phone:t,user_phone_code:o},dataType:"json",cache:!1,success:function(e){e.data;e.success&&(showPopup(".popup-container-sms-code-countdown"),i(".popup-container-sms-code-countdown.show").find(".code-input .input1").focus(),i(".popup-container-sms-code-countdown .mail").text(o+" "+t))}})):i(".popup-container-sms-code-countdown .subtitle .text2").html("ÐÑ Ð½Ðµ Ñмогли ÑаÑпознаÑÑ Ð½Ð¾Ð¼ÐµÑ ÑелеÑона")}),i(".popup-container-sms-code-countdown #confirm_code.sms_confirm_code").on("click",function(){var e="";i("#sms-otp-input .code-input input").each(function(){e+=i(this).val()}),""!=e?i.ajax({url:"/wp-admin/admin-ajax.php",type:"POST",data:{action:"sendsmscode_verification",approve_code:e},dataType:"json",cache:!1,success:function(e){var t=e.data;e.success&&(t.change_phone?(i(".info-callout.ver-no").css("display","flex"),i(".icons-alert.ver-no").css("display","block"),i(".icons-alert.ver-yes").css("display","none"),i(".code-input-error").addClass("show-error"),i(".code-input-error span").html("Ðод введен не веÑно")):(i(".info-callout.ver-no").css("display","none"),i(".icons-alert.ver-no").css("display","none"),i(".icons-alert.ver-yes").css("display","block"),i(".popup-container-sms-code-countdown").removeClass("show"),showPopup(".popup-with-two-buttons"),i(".popup-with-two-buttons .headline-h3").text("ÐÐ¾Ð¼ÐµÑ ÑÑпеÑно веÑиÑиÑиÑован!"),i(".popup-with-two-buttons .description").text("ÐÑе пÑоÑло без пÑоблем!")))}}):(i(".code-input-error").addClass("show-error"),i(".code-input-error span").html("ÐÑ Ð½Ðµ Ñмогли пÑовеÑиÑÑ ÐºÐ¾Ð´"))}),i(".edit-profile #my_email").on("input",function(){i(".edit-profile .info-callout2").addClass("show")}),i(".log-out").on("click",function(){showPopup(".popup-container-popup-log-out")}),i(".create-selection").click(function(){showPopup(".popup-container-create-selections");var e=i(this).data("type");i(".popups-create-selection input.hidden").attr("data-type",e),i(".popups-create-selection").attr("data-selection",""),i(".popups-create-selection .selection_name").val(""),i(".popups-create-selection .selection_descr").val(""),i(".popups-create-selection label").removeClass("active")}),i(".page-template-page-edit-profile").on("click","a",function(e){var t=i(this).attr("href");0==i(this).parents(".datepick").length&&(i(".page-template-page-edit-profile").hasClass("was_changed_profile")&&(e.preventDefault(),showPopup(".popup-container-popup-choice"),i(".popups-choice .headline-h3").text("Твои даннÑе пока не ÑÐ¾Ñ ÑаненÑ!"),i(".popups-choice .subtitile").text("ÐÑли ÑÑ ÑйдеÑÑ, пÑидеÑÑÑ Ð²Ñе делаÑÑ Ð·Ð°Ð½Ð¾Ð²Ð¾"),i(".popup-container-popup-choice .button2").attr("onclick",'window.location="'+t+'"')),i(".page-template-page-edit-profile").hasClass("was_changed_pass"))&&(e.preventDefault(),showPopup(".popup-container-popup-choice"),i(".popups-choice .headline-h3").text("Твой паÑÐ¾Ð»Ñ Ð¿Ð¾ÐºÐ° не ÑÐ¾Ñ Ñанен!"),i(".popups-choice .subtitile").text("ÐÑли ÑÑ ÑйдеÑÑ, пÑидеÑÑÑ Ð¼ÐµÐ½ÑÑÑ ÐµÐ³Ð¾ заново"),i(".popup-container-popup-choice .button2").attr("onclick",'window.location="'+t+'"'))}),i("#back").click(function(){var e=!0;i(".page-template-page-edit-profile").hasClass("was_changed_profile")&&(showPopup(".popup-container-popup-choice"),i(".popups-choice .headline-h3").text("Твои даннÑе пока не ÑÐ¾Ñ ÑаненÑ!"),i(".popups-choice .subtitile").text("ÐÑли ÑÑ ÑйдеÑÑ, пÑидеÑÑÑ Ð²Ñе делаÑÑ Ð·Ð°Ð½Ð¾Ð²Ð¾"),i(".popup-container-popup-choice .button2").attr("onclick","history.back()"),e=!1),i(".page-template-page-edit-profile").hasClass("was_changed_pass")&&(showPopup(".popup-container-popup-choice"),i(".popups-choice .headline-h3").text("Твой паÑÐ¾Ð»Ñ Ð¿Ð¾ÐºÐ° не ÑÐ¾Ñ Ñанен!"),i(".popups-choice .subtitile").text("ÐÑли ÑÑ ÑйдеÑÑ, пÑидеÑÑÑ Ð¼ÐµÐ½ÑÑÑ ÐµÐ³Ð¾ заново"),i(".popup-container-popup-choice .button2").attr("onclick","history.back()"),e=!1),1==e&&(window.location="/pers
156onal-area/")}),i(".countries-list_item").on("click",function(){e()}),i(".body").on("click",".datepick td a, .datepick td",function(){e()}),i(".popups-edit-data-profile .tab-content.tab-content-1 input").on("keypress",function(){e()}),i(".popups-edit-data-profile .tab-content.tab-content-1 input").on("change",function(){e()}),i(".popups-edit-data-profile .tab-content.tab-content-2 input").on("keypress",function(){t()}),i(".popups-edit-data-profile .tab-content.tab-content-2 input").on("change",function(){t()}),i("#user_birthday").change(function(){e()}),i(".btn-upload").click(function(){i(".upload").trigger("click")}),i("body").on("click",".popups-elements-selection",function(){i(this).toggleClass("selected")}),i(".meatball-menu").click(function(){var e=i(this).parents(".head2").find(".headline7").text().trim(),t=i(this).parents(".head2").find(".text5").text().trim(),o=i(this).parents(".head2").find(".edit-selection").attr("data-selection"),n=i(this).find(".menu-item.delete-selection").attr("data-selection");return""==e&&(e=i(".headline5 .headline2").text().trim()),""==t&&(t=i(".headline5 .subtitle").text().trim()),1024<window.innerWidth&&(i(this).hasClass("active")?(i(this).removeClass("active"),i(this).find(".selections-menu").removeClass("show")):(i(".meatball-menu").removeClass("active"),i(this).addClass("active"),i(".selections-menu").removeClass("show"),i(".selections-menu").attr("data-selectionname",e),i(".selections-menu").attr("data-selectiondesc",t),i(".selections-menu").attr("data-selection",o),i(this).find(".selections-menu").addClass("show"))),window.innerWidth<=1024&&(showPopup(".popup-container-selections-menu"),i(".popup-container-selections-menu").attr("data-selectionname",e),i(".popup-container-selections-menu").attr("data-selectiondesc",t),i(".popup-container-selections-menu .delete-selection").attr("data-selection",n),i(".popup-container-selections-menu").attr("data-selection",o)),!1}),i(document).mouseup(function(e){var t=i(".meatball-menu");t.is(e.target)||0!==t.has(e.target).length||(t.removeClass("active"),i(".selections-menu").removeClass("show"))}),i(".fill_profile").click(function(){showPopup(".popup-container-fill-profile")}),i(".tab-header").click(function(){i(".tab-header").removeClass("active"),i(this).addClass("active");var e=i(this).attr("id").split("-")[1];i(".tab-content").removeClass("active"),i("#tab-content-"+e).addClass("active")});let o;if(1919<=window.innerWidth&&(o=document.querySelector(".side-bar.desktop- .profile-bar .progress-ring__circle")),window.innerWidth<1919&&(o=document.querySelector(".side-bar.desktop- .profile-bar .progress-ring.laptop- .progress-ring__circle")),window.innerWidth<=1720&&(o=document.querySelector(".side-bar.laptop- .profile-bar .progress-ring.laptop- .progress-ring__circle")),window.innerWidth<=1024&&(o=document.querySelector(".side-bar.laptop- .profile-bar .progress-ring.laptop- .progress-ring__circle")),o=window.innerWidth<=768?document.querySelector(".side-bar.laptop- .profile-bar .progress-ring.mobile- .progress-ring__circle"):o){var n=o.r.baseVal.value;let e=2*Math.PI*n;o.style.strokeDasharray=e+" "+e,o.style.strokeDashoffset=e;let t=0;i(".side-bar.desktop- .profile-bar .menu-item.filled").each(function(){t+=parseInt(i(this).data("filled"))}),3==i(".side-bar.desktop- .profile-bar .menu-item.filled").length&&(t=50),n=t,n=e-n/100*e,o.style.strokeDashoffset=n,i(".profile-bar ").each(function(){i(this).find(".menu-item.filled").wrapAll('<div class="items-filled"></div>')}),i(".profile-bar .menu-item.filled").click(function(){return!1});n=i(".progress-value");100<=t?n.text("100%"):n.text(t+"%")}}); 157function initProgressBarsLine(){ 158 const progressBarsRound = $('.progress_bar_line_wrap'); 159 progressBarsRound.each(function () { 160 const numText = $(this).find('.percent_wrap .num .n'); 161 const percentageProgress = +$(this).attr('data-percentage-progress'); 162 const startValuePercentageProgress = +$(this).attr('data-start-value-percentage-progress'); 163 const isAnimateProgress = +$(this).attr('data-is-animate-progress'); 164 const lineProgress = $(this).find('.container_line_progress .line_progress'); 165 166 setTimeout(function () { 167 if(isAnimateProgress) { 168 animateCounter(numText, percentageProgress, 800, startValuePercentageProgress); 169 lineProgress.addClass('active animate').css({ 170 'width': percentageProgress + '%', 171 }); 172 }else{ 173 numText.text(percentageProgress); 174 lineProgress.addClass('active').removeClass('animate').css({ 175 'width': percentageProgress + '%', 176 }); 177 } 178 }, 1000) 179 }); 180} 181$(window).on('load', function () { 182 initProgressBarsLine(); 183}); 184 185// $(window).on('resize', function() { 186// initProgressBarsLine(); 187// }); 188 189function calculate_percentage_progress_bar_only_circle(input_percentage, lengthProgressBar) { 190 // Ratio for calculation (86% / 100%) 191 let ratio = lengthProgressBar / 100; 192 193 // Calculation of the new percentage 194 return input_percentage * ratio; 195} 196 197function initProgressBarsRound() {
198 const progressBarsRound = $('.progress_bar_round_wrap'); 199 const lengthProgressBar = 86; 200 progressBarsRound.each(function () { 201 const numText = $(this).find('.percent_wrap .num .n'); 202 const percentageProgress = +$(this).attr('data-percentage-progress'); 203 const startValuePercentageProgress = +$(this).attr('data-start-value-percentage-progress'); 204 const isAnimateProgress = +$(this).attr('data-is-animate-progress'); 205 const circles = $(this).find('svg circle'); 206 207 let percentageProgressBarCircle = calculate_percentage_progress_bar_only_circle(percentageProgress, lengthProgressBar); 208 209 // Get width and height of the element 210 let width = $(this).width(); 211 let height = $(this).height(); 212 213 // Check that the width and height are the same 214 if (width !== height) { 215 // If the width and height are not the same, make the height equal to the width 216 $(this).css('height', width + 'px'); 217 } 218 219 let strokeWidth = parseFloat(circles.slice(1).css('stroke-width')); 220 if (strokeWidth < 10) strokeWidth = 10; 221 // console.log(strokeWidth); 222 223 // Formula for the radius taking into account stroke-width 224 let cx_cy_r = Math.max(0, Math.floor((width - strokeWidth) / 2)) - 1 225 226 // Formula for strokeDasharray and strokeDashoffset 227 let strokeDasharray = Math.round(2 * Math.PI * cx_cy_r); 228 let strokeDashoffset = strokeDasharray; 229 230 let strokeDashoffsetActiveCalc = strokeDasharray - (strokeDashoffset * percentageProgressBarCircle) / 100; 231 let strokeDashoffsetStaticCalc = strokeDasharray - (strokeDashoffset * lengthProgressBar) / 100; 232 233 circles.attr({ 234 'cx': cx_cy_r, 235 'cy': cx_cy_r, 236 'r': cx_cy_r 237 }).css({ 238 'stroke-width': strokeWidth 239 }); 240 241 circles.slice(1).css({ 242 'stroke-dashoffset': strokeDashoffsetStaticCalc, 243 'stroke-dasharray': strokeDasharray, 244 'stroke': '#E9EAF0' 245 }) 246 247 if (circles.slice(2).hasClass('active') && circles.slice(2).css('stroke-dashoffset')) { 248 strokeDashoffset = parseFloat(circles.slice(2).css('stroke-dashoffset')) 249 circles.slice(2).css({ 250 'stroke': '#0FA958', 251 }); 252 } 253 254 circles.slice(2).css({ 255 'stroke-dashoffset': strokeDashoffset, 256 'stroke-dasharray': strokeDasharray, 257 }) 258 setTimeout(function () { 259 if (isAnimateProgress) { 260 animateCounter(numText, percentageProgress, 800, startValuePercentageProgress); 261 circles.slice(2).css({ 262 'stroke-dashoffset': strokeDashoffsetActiveCalc, 263 'stroke': '#0FA958', 264 }).addClass('active animate'); 265 } else { 266 numText.text(percentageProgress); 267 circles.slice(2).css({ 268 'stroke-dashoffset': strokeDashoffsetActiveCalc, 269 'stroke': '#0FA958', 270 }).addClass('active').removeClass('animate') 271 } 272 273 }, 1000) 274 }); 275} 276 277$(window).on('load', function () { 278 initProgressBarsRound(); 279}); 280 281$(window).on('resize', function () { 282 initProgressBarsRound(); 283}); 284 285$(".side-menu li.menu-item-has-children > a").click(function(){ 286 $(this).parents('.side-menu li.menu-item-has-children').toggleClass("active"); 287 StickySideMenu() 288}); 289window.addEventListener('scroll', function() { 290 StickySideMenu(); 291}); 292 293let menu_pos = $('.side-menu_wrap'); 294 295StickySideMenu(true); 296 297function StickySideMenu(isFirstInit = false){ 298 const containerToolbarGlobal = $('.container_banners_events') 299 const containerToolbarGlobalHeight = containerToolbarGlobal.length && !$('body').hasClass('body-hide-toolbar-banners-mob') ? containerToolbarGlobal.outerHeight() : 0 ; 300 301 const header_height = $('.header').outerHeight(); 302 const block_bottom = menu_pos.outerHeight() + header_height + containerToolbarGlobalHeight; 303 const categoryWrap = $('.category-wrap'); 304 const postContentWrap = $('.post_content_wrap'); 305 const sideMenu = $('.side-menu'); 306 307 // Set min-height for .side-menu based on .side-menu-inner 308 if (isFirstInit && sideMenu.length && menu_pos.length) { 309 sideMenu.css('min-height', menu_pos.outerHeight()); 310 } 311 312 if (categoryWrap.length){ 313 let container_bottom_point = categoryWrap.offset().top + categoryWrap.outerHeight(); 314 let point = container_bottom_point - block_bottom; 315 316 if(scrollY > point){ 317 $('.side-menu-inner').addClass('pos'); 318 } else{ 319 if(scrollY < point){ 320 $('.side-menu-inner').removeClass('pos'); 321 } 322 } 323 } 324 325 let post_nav = $('.post_nav_inner'); 326 let post_nav_bottom = post_nav.outerHeight(); 327 328 if (postContentWrap.length){ 329 let post_container_bottom_point = postContentWrap.offset().top + postContentWrap.outerHeight(); 330 let padding_top = parseInt(categoryWrap.css('padding-top')) 331 let post_nav_point = post_container_bottom_point - post_nav_bottom - header_height - padding_top; 332 333 if(scrollY > post_nav_point){ 334 post_nav.addClass('pos'); 335 } else{ 336 if(scrollY < post_nav_point){ 337 post_nav.removeClass('pos'); 338 } 339 } 340 } 341} 342 343// document.addEventListener("DOMContentLoaded", function () { 344$(document).ready(function () { 345 $(".course_expiration_timer_block").each(function () { 346 let timerContainer = $(this); 347 let days = parseInt(timerContainer.attr('data-days')) || 0; 348 let hours = parseInt(timerContainer.attr('data-hours')) || 0; 349 let minutes = parseInt(timerContainer.attr('data-minutes')) || 0; 350 let seconds = parseInt(timerContainer.attr('data-seconds')) || 0; 351 352 let countdownTime = (days * 24 * 60 * 60) + (hours * 60 * 60) + (minutes * 60) + seconds; 353 let animationPaused = false; // Flag to pause animation 354 355 function updateTimerDate() { 356 if (countdownTime > 0) { 357 let d = Math.floor(countdownTime / (60 * 60 * 24)); 358 let h = String(Math.floor((countdownTime / (60 * 60)) % 24)).padStart(2, "0"); 359 let m = String(Math.floor((countdownTime / 60) % 60)).padStart(2, "0"); 360 let s = String(countdownTime % 60).padStart(2, "0"); 361 362 if (!animationPaused) { // Only animate if not paused 363 animateNumberTimer(timerContainer.find(".timer-days"), d); 364 animateNumberTimer(timerContainer.find(".timer-hours"), h); 365 animateNumberTimer(timerContainer.find(".timer-minutes"), m); 366 animateNumberTimer(timerContainer.find(".timer-seconds"), s); 367 } else { 368 // Update text without animation if paused 369 timerContainer.find(".timer-days").text(d); 370 timerContainer.find(".timer-hours").text(h); 371 timerContainer.find(".timer-minutes").text(m); 372 timerContainer.find(".timer-seconds").text(s); 373 } 374 375 countdownTime--; 376 } else { 377 clearInterval(timerInterval); 378 animateNumberTimer(timerContainer.find(".timer-days"), "00"); 379 animateNumberTimer(timerContainer.find(".timer-hours"), "00"); 380 animateNumberTimer(timerContainer.find(".timer-minutes"), "00"); 381 animateNumberTimer(timerContainer.find(".timer-seconds"), "00"); 382 } 383 } 384 385 function animateNumberTimer(element, newValue) { 386 let currentValue = element.text(); 387 if (currentValue !== String(newValue)) { 388 // Stop any ongoing animations and remove old .new-num elements 389 element.stop(true, true); 390 element.siblings(".new-num").remove(); 391 392 let newElement = $("<span>") 393 .addClass("num new-num") 394 .text(newValue) 395 .css({ 396 position: "absolute", 397 width: "100%", 398 top: "-100%", 399 left: "0", 400 opacity: 0 401 }); 402 403 element.parent().append(newElement); 404 405 // Animate new element in and old element out 406 newElement.animate({ top: "0%", opacity: 1 }, 300); 407 element.animate({ top: "100%", opacity: 0 }, 300, function () { 408 $(this).text(newValue).css({ top: "0", opacity: 1 }); 409 setTimeout(function () { 410 newElement.remove(); 411 }); 412 }); 413 } 414 } 415 416 // Handle tab visibility change 417 document.addEventListener("visibilitychange", () => { 418 if(document.hidden) { 419 animationPaused = true; // Pause animation only 420 } else { 421 animationPaused = false; // Resume animation 422 } 423 }); 424 425 updateTimerDate(); // Initial timer update 426 let timerInterval = setInterval(updateTimerDate, 900); // Update timer every second 427 }); 428 429 // $(".course_expiration_timer_block").each(function () { 430 // let timerContainer = $(this); 431 // let days = parseInt(timerContainer.attr('data-days')) || 0; 432 // let hours = parseInt(timerContainer.attr('data-hours')) || 0; 433 // let minutes = parseInt(timerContainer.attr('data-minutes')) || 0; 434 // let seconds = parseInt(timerContainer.attr('data-seconds')) || 0; 435 // // console.log(days, hours, minutes, seconds) 436 // let countdownTime = (days * 24 * 60 * 60) + (hours * 60 * 60) + (minutes * 60) + seconds; 437 // 438 // function updateTimerDateAnimation() { 439 // if (countdownTime > 0) { 440 // let d = Math.floor(countdownTime / (60 * 60 * 24)); 441 // let h = String(Math.floor((countdownTime / (60 * 60)) % 24)).padStart(2, "0"); 442 // let m = String(Math.floor((countdownTime / 60) % 60)).padStart(2, "0"); 443 // let s = String(countdownTime % 60).padStart(2, "0"); 444 // 445 // animateNumberTimer(timerContainer.find(".timer-days"), d); 446 // animateNumberTimer(timerContainer.find(".timer-hours"), h); 447 // animateNumberTimer(timerContainer.find(".timer-minutes"), m); 448 // animateNumberTimer(timerContainer.find(".timer-seconds"), s); 449 // 450 // countdownTime--; 451 // } else { 452 // clearInterval(timerInterval); 453 // animateNumberTimer(timerContainer.find(".timer-days"), "00"); 454 // animateNumberTimer(timerContainer.find(".timer-hours"), "00"); 455 // animateNumberTimer(timerContainer.find(".timer-minutes"), "00"); 456 // animateNumberTimer(timerContainer.find(".timer-seconds"), "00"); 457 // } 458 // } 459 // 460 // function animateNumberTimer(element, newValue) { 461 // let currentValue = element.text(); 462 // if (currentValue !== String(newValue)) { 463 // let newElement = $("<span>") 464 // .addClass("num new-num") 465 // .text(newValue) 466 // .css({ 467 // position: "absolute", 468 // width: "100%", 469 // top: "-100%", 470 // left: "0", 471 // opacity: 0 472 // }); 473 // 474 // element.parent().append(newElement); 475 // newElement.animate({top: "0%", opacity: 1}, 300); 476 // element.animate({top: "100%", opacity: 0}, 300, function () { 477 // $(this).text(newValue).css({top: "0", opacity: 1}); 478 // setTimeout(function () { 479 // newElement.remove(); 480 // }); 481 // }); 482 // } 483 // } 484 // 485 // updateTimerDateAnimation(); 486 // let timerInterval = setInterval(updateTimerDateAnimation, 1000); 487 // }); 488 489}); 490 491// $(window).on('load', function () { 492// initProgressBarsRound(); 493// }); 494// 495// $(window).on('resize', function () { 496// initProgressBarsRound(); 497// }); 498 499jQuery(function($){ 500 501 $("#input-for-banners ").on("input", function() { 502 $('#clear').css('display', 'block'); 503 if($(this).val() == ''){ 504 $(this).removeClass('wpcf7-not-valid'); 505 $(this).parents('.input-wrap').find('.wpcf7-not-valid-tip').css('display', 'none'); 506 $('#clear').css('display', 'none'); 507 } 508 }); 509 $("#clear").on("click", function(){ 510 $('#input-for-banners').val(''); 511 $(this).css('display', 'none'); 512 $('#input-for-banners').removeClass('wpcf7-not-valid'); 513 $(this).parents('.input-wrap').find('.wpcf7-not-valid-tip').css('display', 'none'); 514 }); 515 516 517 // var logos_length = 432; 518 // var logo_length = logos_length/7 + 7; 519 // $(window).resize(function() { 520 // var logos_resize = $('.share-banner .social-media').outerWidth(); 521 // if(logos_resize<logos_length){ 522 // $('.share-banner .social-media .img:last-of-type()').addClass('hidden'); 523 // } 524 // }); 525 // var logos_resize = $('.share-banner .social-media').outerWidth(); 526 // $('.share-banner .social-media .img').each(function(){ 527 // var logo = $(this).outerWidth(); 528 // if(logo<logo_length){ 529 // logo.css('display', 'none'); 530 // } 531 // }) 532 // var logos_length = $('.share-banner .social-media').outerWidth(); 533 // console.log(logos_length); 534 // var logo_length = $('.share-banner .social-media .img').outerWidth()+14; 535 // console.log(logo_length); 536 // var logo_count = logo_length*7; 537 // console.log(logo_count); 538 // var logo = logos_length/7; 539 // console.log(logo); 540 // if(logo<logo_length) 541 // { 542 543 // } 544 //var logo_length = $('.share-banner .social-media .img:nth-last-child()').outerWidth(); 545 // if(logos_length<logo_count){ 546 // alert('test'); 547 // $('.share-banner .social-media .img:last-of-type()').css('display', 'none'); 548 // } 549});
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.