//console.log('Starting creating widget.'); create_widget(null, null, '@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,700;1,800;1,900&display=swap"); @media (prefers-reduced-motion: no-preference) { :root { scroll-behavior: smooth; } }.ctaWidget_item{font-family: "Montserrat", sans-serif;font-size: 1rem;font-weight: 400;line-height: 1.5;}.ctaWidget_item *,.ctaWidget_item *::before,.ctaWidget_item *::after {box-sizing: border-box;font-family: inherit;color:inherit;line-height:inherit; position:static;}.ctaWidget_item img{ padding:0; margin:0;}.antibot_check label { display: flex !important; justify-content: center; align-items: center; margin: 0 0 15px !important; font-weight: 400 !important; font-size: 16px !important; border-radius:5px !important;}.antibot_check input[type=checkbox] { width: 25px !important; display: inline-block !important; margin: 0 7px 0 0 !important; color: #fff !important; -webkit-appearance:checkbox;}.ctaWerror{border:1px solid #f00 !important;}.grecaptcha-badge{display:none !important;}'); var client_details = window.navigator.userAgent; if (!sessionStorage.getItem('startTime')) { sessionStorage.setItem('startTime', Date.now()); } if (!sessionStorage.getItem('referrer')) { sessionStorage.setItem('referrer', document.referrer); } function show_site_time(){ var enterTime = sessionStorage.getItem('startTime'); var currentTime = Date.now(); var spentTime = (currentTime - enterTime) / 1000; var minutes = Math.floor(spentTime / 60); var seconds = Math.floor(spentTime % 60); if(seconds<10) seconds = '0'+seconds; return minutes+':'+seconds; } function sendData( data ) { const XHR = new XMLHttpRequest(); let urlEncodedData = "", urlEncodedDataPairs = [], name; // Turn the data object into an array of URL-encoded key/value pairs. for( name in data ) { urlEncodedDataPairs.push( encodeURIComponent( name ) + '=' + encodeURIComponent( data[name] ) ); } // Combine the pairs into a single string and replace all %-encoded spaces to // the '+' character; matches the behaviour of browser form submissions. urlEncodedData = urlEncodedDataPairs.join( '&' ).replace( /%20/g, '+' ); // Define what happens on successful data submission let fraud; fraud = 0; if(data.action == 1 && !document.getElementById('ctaCallback').classList.contains('act')) fraud = 1; if(fraud == 0){ XHR.addEventListener( 'load', function(event) { if(data.action == 1){ document.getElementById('ctaFormResponse').classList.add('act'); document.getElementById('ctawCB_loader').style.display = 'none'; console.log( event.target.responseText); setTimeout(function(){ document.getElementById('ctaCallback').classList.remove('act'); },3000); sessionStorage.setItem('seenCB','1'); document.getElementById('Ctacb_phone').value = ""; ym(metrikaID,'reachGoal','ctawidget_callback_lead'); if(gtag()) gtag('event_name','ctawidget_callback_lead'); }; if(data.action == 8){ document.getElementById('ctaLeadGeneratorFormResponse').classList.add('act'); console.log( event.target.responseText ); setTimeout(function(){ document.getElementById('ctawLeadGeneratorWindow').classList.remove('act'); document.getElementById('ctawLeadGeneratorBD').classList.remove('ctaBdShow');},3000); sessionStorage.setItem('seenLeadGenerator','1'); document.querySelectorAll('#leadGeneratorFormFields input').forEach( el => { el.value = ""; }); ym(metrikaID,'reachGoal','ctawidget_leadgenerator_lead'); }; if(data.action == 10){ document.getElementById('quiz_contacts_value').value = ''; document.getElementById('quiz_final_cta').style.display = 'none'; document.getElementById('quiz_success_send').style.display = 'block'; console.log( event.target.responseText ); setTimeout(function(){ document.getElementById('ctawQuizWindow').classList.remove('act'); document.getElementById('ctawQuizWindowBD').classList.remove('ctaBdShow');},3000); sessionStorage.setItem('seenQuiz','1'); ym(metrikaID,'reachGoal','ctawidget_quiz_lead'); }; return '1'; } ); // Define what happens in case of error XHR.addEventListener( 'error', function(event) { console.log( 'Oops! Something went wrong.' ); return '0'; } ); // Set up our request XHR.open( 'POST', 'https://app.ctawidget.ru/sendcallback' ); // Add the required HTTP header for form data POST requests //XHR.setRequestHeader( 'Access-Control-Allow-Origin', '*' ); XHR.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' ); // Finally, send our data. XHR.send( urlEncodedData ); } } function create_widget(widget_id, widget_html, widget_css){ document.addEventListener("DOMContentLoaded", function(event) { var styleNode = document.createElement('style'); styleNode.type = "text/css"; // browser detection (based on prototype.js) if(!!(window.attachEvent && !window.opera)) { styleNode.styleSheet.cssText = widget_css; } else { var styleText = document.createTextNode(widget_css); styleNode.appendChild(styleText); } document.getElementsByTagName('head')[0].appendChild(styleNode); if(widget_id != null){ var ctawNode = document.createElement('div'); ctawNode.id = widget_id; ctawNode.classList.add("ctaWidget_item"); ctawNode.innerHTML = widget_html; document.getElementsByTagName('body')[0].appendChild(ctawNode); //console.log('Created widget:'+widget_id); } }); } function get_visible_widget(){ var visible = ''; const widgetsIDs = [ 'ctawChat', 'ctaCallback', 'ctawMB', 'ctawLeadGeneratorWindow', 'ctawQuizWindow' //'ctawCBbutt_cta' ]; widgetsIDs.forEach( (element) => { if(document.getElementById(element) && document.getElementById(element).classList.contains('act')){ visible = element; } }); return visible; } function get_fullwin_visible_widget(){ var visible = ''; if(window.innerWidth < 769){ const widgetsIDs = [ 'ctawChat', 'ctaCallback', 'ctawLeadGeneratorWindow', 'ctawQuizWindow' //'ctawCBbutt_cta' ]; widgetsIDs.forEach( (element) => { if(document.getElementById(element) && document.getElementById(element).classList.contains('act')){ visible = element; } }); } return visible; } function get_visible_cta(){ var visible = ''; const ctasIDs = [ 'ctawCBbutt_cta', 'ctawLeadGenerator_cta' ]; widgetsIDs.forEach( (element) => { if(document.getElementById(element) && document.getElementById(element).classList.contains('act')){ visible = element; } }); return visible; } function ValidEmail(myMail) { var re = /^[\w-\.]+@[\w-]+\.[a-z]{2,4}$/i; var valid = re.test(myMail); return valid; } function ValidPhone(myPhone) { var re = /^[\d\+][\d\(\)\ -]{6,21}\d$/; var valid = re.test(myPhone); return valid; } var pathUrls = new Array(); function set_urls(){ sessionStorage.setItem('pathUrls', JSON.stringify(pathUrls)); } function get_urls(){ if(sessionStorage.getItem('pathUrls')) { pathUrls = sessionStorage.getItem('pathUrls'); pathUrls = JSON.parse(pathUrls); } else { pathUrls.push(window.location.href); set_urls(); } } var metrikaID = ''; var bot = 0; document.addEventListener("DOMContentLoaded", function(event) { get_urls(); for(let i=0; i 50){ let antibot = ''; if(document.querySelector('.antibot_check').innerHTML == '') document.querySelector('.antibot_check').innerHTML = antibot; } } else bot = 0; } }); var PhoneMask = function(elements, settings) { var that = this; settings = settings || {}; this.elements = elements; this.patternChar = settings.patternChar || '_'; this.prefix = settings.prefix || ''; this.pattern = settings.pattern || '(___) ___-__-__'; this.pattern = this.prefix + this.pattern; this.backspaceCode = settings.backspaceCode || 8; this.deleteCode = settings.deleteCode || 46; this.allowedRegExp = settings.allowedRegExp || /^\d$/; this.igrogeKeyCodes = settings.igrogeKeyCodes || [9, 16, 17, 18, 36, 37, 38, 39, 40, 91, 92, 93]; var inputKeyEventPress = function(e) { e = e || window.event; var elem = e.target || e.srcElement; var result = true; console.log(e.keyCode); if (!that.isIgnoredKey(e.keyCode)) { if (e.keyCode != that.backspaceCode && e.keyCode != that.deleteCode) { var char = String.fromCharCode(e.keyCode); if (that.allowedRegExp == false || char.match(that.allowedRegExp) != null) { elem.value = that.replaceToChar(elem, char); } } result = false; } // select first pattern symbol that.selectFirstPatterntChar(elem); if (result == false) { if (e.preventDefault) { e.preventDefault(); } return result; } }; var inputKeyEventDown = function(e) { e = e || window.event; var elem = e.target || e.srcElement; var result = true; if (!that.isIgnoredKey(e.keyCode)) { if (e.keyCode == that.backspaceCode) { elem.value = that.replaceToPatternChar(elem); result = false; } if (e.keyCode == that.deleteCode) { elem.value = that.replaceToPatternChar(elem); result = false; } } // select first pattern symbol that.selectFirstPatterntChar(elem); if (result === false) { return false; } }; var inputFocusEvent = function(e) { e = e || window.event; var elem = e.target || e.srcElement; var start = elem.value.indexOf(that.patternChar); var end = start + 1; if (start < 0) { start = elem.value.length - 1; end = start + 1; } that.selectCharInInput(elem, start, end); } if (Object.prototype.toString.call(this.elements) === "[object NodeList]") { for (var i = 0; i < this.elements.length; i++) { if (this.elements[i].value.length > 0) { that.applyPatternToValue(this.elements[i]); } else { this.elements[i].value = that.pattern; } this.elements[i].onkeydown = inputKeyEventDown; this.elements[i].onkeypress = inputKeyEventPress; this.elements[i].onfocus = inputFocusEvent; } } else if (this.elements != null) { if (this.elements.value.length > 0) { that.applyPatternToValue(this.elements); } else { this.elements.value = that.pattern; } this.elements.onkeydown = inputKeyEventDown; this.elements.onkeypress = inputKeyEventPress; this.elements.onfocus = inputFocusEvent; } } PhoneMask.prototype.applyPatternToValue = function(elem) { var valueArr = elem.value.split(""); var patternValue = this.pattern; var len = valueArr.length; for (var i = 0; i < len; i++) { patternValue = patternValue.replace(this.patternChar, valueArr[i]); } elem.value = patternValue; } PhoneMask.prototype.selectFirstPatterntChar = function(elem) { var start = elem.value.indexOf(this.patternChar); if (start > -1) { var end = start + 1; this.selectCharInInput(elem, start, end); } } PhoneMask.prototype.isIgnoredKey = function(code) { if (this.igrogeKeyCodes.indexOf(code) < 0) { return false; } return true; }; PhoneMask.prototype.selectCharInInput = function(elem, start, end) { if (elem.setSelectionRange) { elem.focus(); elem.setSelectionRange(start, end); } else { if (elem.createTextRange) { range = elem.createTextRange(); range.collapse(true); range.moveEnd('character', end); range.moveStart('character', start); range.select(); } } }; PhoneMask.prototype.replaceAt = function(str, index, character) { var tempArr = str.split(""); tempArr[index] = character; return tempArr.join(""); }; PhoneMask.prototype.replaceToChar = function(elem, char) { var value = elem.value; var firstCharToReplace = value.indexOf(this.patternChar); if (firstCharToReplace > -1) { return this.replaceAt(value, firstCharToReplace, char); } return value; }; PhoneMask.prototype.replaceToPatternChar = function(elem) { var value = elem.value; var firstPatternCharPos = value.indexOf(this.patternChar); var replaceCharPos; var isFindPos = false; if (firstPatternCharPos == -1) { replaceCharPos = value.length - 1; isFindPos = true; } else { replaceCharPos = firstPatternCharPos - 1; while (!isFindPos) { if (this.pattern[replaceCharPos] != value[replaceCharPos]) { isFindPos = true; } else { replaceCharPos--; if (replaceCharPos < 0) { break; } } } } if (isFindPos && replaceCharPos >= this.prefix.length) { return this.replaceAt(value, replaceCharPos, this.patternChar); } return value; }; PhoneMask.prototype.destroy = function() { if (Object.prototype.toString.call(this.elements) === "[object NodeList]") { for (var i = 0; i < this.elements.length; i++) { this.elements[i].value = null; this.elements[i].onkeydown = null; this.elements[i].onkeypress = null; this.elements[i].onfocus = null; } } else if (this.elements != null) { this.elements.value = null; this.elements.onkeydown = null; this.elements.onkeypress = null; this.elements.onfocus = null; } };//console.log('Vis: '+get_visible_widget()); create_widget('ctawCallback', '
Есть вопросы? Закажите обратный звонок и мы с Вами свяжемся через несколько минут.
Нужна помощь?
Закажите обратный звонок и наш менеджер свяжется с Вами через несколько минут:
Жду звонка!
Спасибо! В ближайшее время мы свяжемся с Вами!!!
Работает на
', ".ctawForm{ background-color:#1C1C1C; border-radius:10px; width:100vw; max-width:300px; box-sizing:border-box; position:fixed !important; box-shadow: 0px 6px 20px 0px rgb(0 0 0 / 40%); bottom:100px; right:-400px; -webkit-transition: all 0.7s ease 0s; -moz-transition: all 0.7s ease 0s; -ms-transition: all 0.7s ease 0s; -o-transition: all 0.7s ease 0s; transition: all 0.7s ease 0s; padding:30px 0; z-index:9999999; overflow:hidden;}.ctawForm.act{ right:20px; -webkit-transition: all 0.7s ease 0s; -moz-transition: all 0.7s ease 0s; -ms-transition: all 0.7s ease 0s; -o-transition: all 0.7s ease 0s; transition: all 0.7s ease 0s;}div#ctawCallback .close-container{ position: absolute; margin: auto; width:30px; height:30px; top:5px; right:5px; cursor: pointer; z-index:999;}div#ctawCallback .close-container .leftright{ height: 1.999px; width:30px; position: absolute; margin-top:15px; background-color:#bfbfbf; border-radius: 2px; transform: rotate(45deg); transition: all .3s ease-in;}div#ctawCallback .close-container .rightleft{ height: 1.999px; width:30px; position: absolute; margin-top:15px; background-color:#bfbfbf; border-radius: 2px; transform: rotate(-45deg); transition: all .3s ease-in;}div#ctawCallback .close-container label{ color: white; font-family: Helvetica, Arial, sans-serif; font-size: .6em; text-transform: uppercase; letter-spacing: 2px; transition: all .3s ease-in; opacity:1;}div#ctawCallback .close-container .closes{ margin:48px 0 0 0px; position: absolute; font-size:8px; color:#fff;}div#ctawCallback .close-container:hover .leftright{ transform: rotate(-45deg); background-color:#f00;}div#ctawCallback .close-container:hover .rightleft{ transform: rotate(45deg); background-color:#f00;}div#ctawCallback .close-container:hover label{ opacity: 1;}.ctaw_lines { transform: rotate(45deg); position: absolute; top: 242px; left: -220px; width:200%; z-index:0;}.ctaw_line { margin-bottom: 15px; border-bottom: 1px solid #2EA3F233; position:relative;}.ctaw_line:after { content: ''; display: block; background-color:#2EA3F233; width: 9px; height: 9px; position: absolute; left:0; top: -4px; border-radius:100%;}.ctaw_lines .ctaw_line:nth-child(3):after { animation-name: ltr; animation-duration:2100ms; animation-iteration-count: infinite; animation-timing-function: linear; animation-delay:0.33s;}.ctaw_lines .ctaw_line:nth-child(2):after { animation-name: ltr; animation-duration:2100ms; animation-iteration-count: infinite; animation-timing-function: linear; animation-delay:0.66s;}.ctaw_lines .ctaw_line:nth-child(1):after { animation-name: ltr; animation-duration:2100ms; animation-iteration-count: infinite; animation-timing-function: linear; animation-delay:0.99s;}.ctaw_content{ position:relative; z-index:1;}.ctawImg { width: 50px; height: 50px; padding: 15px; border-radius: 100%; border: 1px solid #2EA3F2; fill: #2EA3F2; position: relative; margin:0 auto 30px; box-sizing: content-box;}.ctawImg span { display: block; position: absolute; width: 64px; height: 64px; top: 8px; left: 8px; transform: rotate(45deg); -webkit-animation-name: spin; -webkit-animation-duration: 4000ms; -webkit-animation-iteration-count: infinite; -webkit-animation-timing-function: linear; -moz-animation-name: spin; -moz-animation-duration: 4000ms; -moz-animation-iteration-count: infinite; -moz-animation-timing-function: linear; -ms-animation-name: spin; -ms-animation-duration: 4000ms; -ms-animation-iteration-count: infinite; -ms-animation-timing-function: linear; animation-name: spin; animation-duration: 4000ms; animation-iteration-count: infinite; animation-timing-function: linear;}.ctawImg span:before,.ctawImg span:after{ content:''; display:block; position:absolute; width:7px; height:7px; left:0; top:0; background-color:#2EA3F2; border-radius:100%;}.ctawImg span:after{ left:auto; top:auto; right:0; bottom:0;}.ctawFormContent{ padding:0 30px; margin:0;}.ctawZag { font-size:26px; line-height:1.21; font-weight: 700; color:#2EA3F2; margin-bottom:15px;}.ctawSzag { font-size:16px; color:#bfbfbf; margin-bottom:15px; line-height:1.21em;}.ctawText{ font-size:15px; color:#9f9f9f; margin-bottom:15px;}.ctawForm input:not([type=checkbox]){ padding:10px !important; font-size:16px !important; border: 1px solid #38393e; background-color: #FFFDFD; color:#000000 !important; width:100%; margin:0 0 15px 0 !important; box-shadow:none !important; border-radius:5px !important; box-sizing:border-box; outline: none !important;}input#Ctacb_phone::placeholder { color: #00000077 !important;}.ctawForm input[type=tel]{}.ctawForm input::placeholder{ color:#000000ae !important;}#action_Ctacb{ padding:10px !important; font-size:16px !important; text-align:center; background-color: #000; box-shadow:0 0 0 30px #2EA3F2 inset !important; color:#FFFFFF !important; cursor:pointer; border-radius:5px !important; margin:0 0 15px 0 !important; transform: none; width:100%; outline: none; -webkit-transition: all 0.21s ease 0s; -moz-transition: all 0.21s ease 0s; -ms-transition: all 0.21s ease 0s; -o-transition: all 0.21s ease 0s; transition: all 0.21s ease 0s;}#action_Ctacb:hover{ background-color:#1C1C1C; box-shadow:0 0 0 1px #FFFFFF inset !important; color:#FFFFFF !important; -webkit-transition: all 0.21s ease 0s; -moz-transition: all 0.21s ease 0s; -ms-transition: all 0.21s ease 0s; -o-transition: all 0.21s ease 0s; transition: all 0.21s ease 0s; outline: none;}.antibot_check label{ color:#2EA3F2;}@-ms-keyframes spin { from { -ms-transform: rotate(0deg); } to { -ms-transform: rotate(360deg); }}@-moz-keyframes spin { from { -moz-transform: rotate(0deg); } to { -moz-transform: rotate(360deg); }}@-webkit-keyframes spin { from { -webkit-transform: rotate(0deg); } to { -webkit-transform: rotate(360deg); }}@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); }}@keyframes ltr{ from { left:0; } to { left:100%; }}div#ctaFormResponse { opacity: 0; color: #2EA3F2; text-align: center; font-size: 17px; height: 0; overflow: hidden; max-width:100%; line-height: 1.21;}div#ctaFormResponse.act{ opacity: 1; -webkit-transition: opacity 0.7s ease 0s; -moz-transition: opacity 0.7s ease 0s; -ms-transition: opacity 0.7s ease 0s; -o-transition: opacity 0.7s ease 0s; transition: opacity 0.7s ease 0s; height: auto; margin: 0 0 10px; min-height:44px;}.ctawCBbutt_container{ position: fixed; cursor:pointer; z-index:9999; bottom:100px; right:20px;}.ctawCBbutt_cta{ background-color:#fff; color:#000; position:absolute !important; top:0; right:calc(100% + 21px); -webkit-filter: drop-shadow(0 0 3px #777); filter: drop-shadow(0 0 3px #777); padding:10px; z-index:999; width:200px !important; font-size:12px; line-height:1.21; border-radius:5px; display:block; right:-1000px; -webkit-transition: all 0.7s ease 0s; -moz-transition: all 0.7s ease 0s; -ms-transition: all 0.7s ease 0s; -o-transition: all 0.7s ease 0s; transition: all 0.7s ease 0s;}.ctawCBbutt_cta:after{ content:''; display:block; width: 0; height: 0; border-top: 15px solid transparent; border-left: 15px solid #fff; border-bottom: 15px solid transparent; position:absolute; top:15px; left:99%;}.ctawCBbutt_cta.act{ right:calc(100% + 21px); -webkit-transition: all 0.7s ease 0s; -moz-transition: all 0.7s ease 0s; -ms-transition: all 0.7s ease 0s; -o-transition: all 0.7s ease 0s; transition: all 0.7s ease 0s;}.ctawCBbutt { display: inline-block; background-color:#1C1C1C; border-radius: 100%; padding: 7px; width: 71px; height: 71px; box-sizing: border-box;}@media screen and (min-width: 782px){.ctawCBbutt:hover{ animation: radial-pulse 1s infinite alternate;}}.ctawCBbutt .ctawImg { margin: 0; width: 35px; height: 35px; padding: 10px;}.ctawCBbutt .ctawImg svg{ /*animation: rotate3d 15s infinite linear;*/}.ctawCBbutt .ctawImg span { display: block; position: absolute; width: 47px; height: 47px; top: 4px; left: 4px; transform: rotate(45deg); -webkit-animation-name: spin; -webkit-animation-duration:6000ms; -webkit-animation-iteration-count: infinite; -webkit-animation-timing-function: linear; -moz-animation-name: spin; -moz-animation-duration:6000ms; -moz-animation-iteration-count: infinite; -moz-animation-timing-function: linear; -ms-animation-name: spin; -ms-animation-duration:6000ms; -ms-animation-iteration-count: infinite; -ms-animation-timing-function: linear; animation-name: spin; animation-duration:6000ms; animation-iteration-count: infinite; animation-timing-function: linear;} .ctawCB_loader { /*position: absolute; top: calc(50% - 25px); left: calc(50% - 25px);*/ display:none; margin: 0 auto 15px; width: 44px; height: 44px; border-radius: 50%; perspective: 800px;}.ctawCB_inner { position: absolute; box-sizing: border-box; width: 100%; height: 100%; border-radius: 50%; }.ctawCB_inner.one { left: 0%; top: 0%; animation: rotate-one 1s linear infinite; border-bottom: 1px solid #2EA3F2;}.ctawCB_inner.two { right: 0%; top: 0%; animation: rotate-two 1s linear infinite; border-right: 1px solid #2EA3F2;}.ctawCB_inner.three { right: 0%; bottom: 0%; animation: rotate-three 1s linear infinite; border-top: 1px solid #2EA3F2;}@keyframes rotate-one { 0% { transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg); } 100% { transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg); }}@keyframes rotate-two { 0% { transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg); } 100% { transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg); }}@keyframes rotate-three { 0% { transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg); } 100% { transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg); }}@-ms-keyframes rotate3d { 0%{ -ms-transform: rotateY(0deg); } 3%{ -ms-transform: rotateY(360deg); } 100%{-ms-transform: rotateY(360deg);}}@-moz-keyframes rotate3d { 0%{ -moz-transform: rotateY(0deg); } 3%{ -moz-transform: rotateY(360deg); } 100%{-moz-transform: rotateY(360deg);}}@-webkit-keyframes rotate3d { 0%{ -webkit-transform: rotateY(0deg); } 3%{ -webkit-transform: rotateY(360deg); } 100%{-webkit-transform: rotateY(360deg);}}@keyframes rotate3d { 0%{ transform: rotateY(0deg); } 3%{ transform: rotateY(360deg); } 100%{transform: rotateY(360deg);}}.pulse-button__rings { border: 5px solid #FF0000; position: absolute; top: 0; left: 0; bottom: 0; right: 0; height: auto; width: auto; border-radius: 50%; animation-duration: 2.0s; animation-name: pulse_1; animation-iteration-count: infinite; z-index: -1;} .pulse-button__rings:nth-child(2) { animation-name: pulse_2;} .pulse-button__rings:nth-child(3) { animation-name: pulse_3;}@keyframes pulse_1 { from { opacity: 1; transform: scale(0.9, 0.9); } to { opacity: 0; transform: scale(1.3, 1.3); }} @keyframes pulse_2 { from { opacity: 1; transform: scale(0.8, 0.8); } to { opacity: 0; transform: scale(1.5, 1.5); }} @keyframes pulse_3 { from { opacity: 1; transform: scale(0.8, 0.8); } to { opacity: 0; transform: scale(1.7, 1.7); }}" ); document.addEventListener("DOMContentLoaded", function(event) { var userLang = navigator.language || navigator.userLanguage; //console.log(userLang); if(userLang!='ru' && document.getElementById("ctawidget_partner_label")) document.getElementById('ctawidget_partner_label').innerHTML = 'Widget by'; document.getElementById('ctawCBbutt').onclick = function(){ document.getElementById('ctawCBbutt_cta').classList.remove('act'); document.getElementById('ctaCallback').classList.add('act'); }; document.getElementById('ctawCBbutt').addEventListener("touchstart", function(){ document.getElementById('ctawCBbutt_cta').classList.remove('act'); document.getElementById('ctaCallback').classList.add('act'); }); document.getElementById('Ctacb_phone').addEventListener("click", function(){ document.getElementById('Ctacb_phone').removeAttribute('readonly'); }); document.getElementById('Ctacb_phone').addEventListener("touchstart", function(){ document.getElementById('Ctacb_phone').removeAttribute('readonly'); }); var pattern = { 'ru': '+7 (___) ___-__-__', 'md_long': '+373 (___) _-__-__', 'md_short': '0 (___) _-__-__', }; document.getElementById('cl_Ctacb').onclick =function(){ document.getElementById('ctaCallback').classList.remove('act'); sessionStorage.setItem('seenCB','1'); }; function show_ctawCBbutt_cta(){ setTimeout(function(){ if(!get_visible_widget()) document.getElementById('ctawCBbutt_cta').classList.add('act'); }, 10000); setTimeout(function(){ document.getElementById('ctawCBbutt_cta').classList.remove('act'); }, (10000 + 10000)); } if(window.screen.width > 768){ if(sessionStorage.getItem('seenCB')!=1) setTimeout(function(){ if(sessionStorage.getItem('seenCB')!=1 && !get_visible_widget()) document.getElementById('ctaCallback').classList.add('act'); }, 10000); else if(sessionStorage.getItem('seenCB')==1) { setTimeout(function(){ if(!get_visible_widget()) document.getElementById('ctaCallback').classList.add('act'); }, 120000); setTimeout(function(){ if(!get_visible_widget()) document.getElementById('ctawCBbutt_cta').classList.add('act'); }, 10000); setTimeout(function(){ document.getElementById('ctawCBbutt_cta').classList.remove('act'); }, (10000 + 10000)); } } else { show_ctawCBbutt_cta(); } if(sessionStorage.getItem('seenCB')!=1) setTimeout(function(){ if(sessionStorage.getItem('seenCB')!=1 && !get_visible_widget()){ document.getElementById('ctaCallback').classList.add('act'); } }, 10000); else if(sessionStorage.getItem('seenCB')==1) { setTimeout(function(){ if(!get_visible_widget()) document.getElementById('ctaCallback').classList.add('act'); }, 120000); } document.getElementById('cl_Ctacb').onclick =function(){ document.getElementById('ctaCallback').classList.remove('act'); sessionStorage.setItem('seenCB','1'); }; /*document.getElementById('ctawCBbutt').onclick =function(){ document.getElementById('ctawCBbutt_cta').classList.remove('act'); document.getElementById('ctaCallback').classList.add('act'); //sendData({project: '', action:4, url: window.location.href}); }; функция обратного звонка */ const btn = document.getElementById('action_Ctacb'); btn.addEventListener( 'click', function() { if(document.querySelector('#ctaFormcb .antibot_check input[type=checkbox]') == null || (document.querySelector('#ctaFormcb .antibot_check input[type=checkbox]') && document.querySelector('#ctaFormcb .antibot_check input[type=checkbox]').checked)){ if(document.querySelector('#ctaFormcb .antibot_check input[type=checkbox]') != null) document.querySelector('#ctaFormcb .antibot_check label').classList.remove('ctaWerror'); if(document.getElementById('Ctacb_phone').value){ if(ValidPhone(document.getElementById('Ctacb_phone').value)){ document.getElementById('Ctacb_phone').classList.remove('ctaWerror'); btn.style.display = 'none'; document.getElementById('ctawCB_loader').style.display = 'block'; sendData( { phone:document.getElementById('Ctacb_phone').value, project: 'TWaAzZAk', widget: 29, action:1, url:encodeURI(window.location.href), startUrl:encodeURI(JSON.parse(sessionStorage.getItem('pathUrls'))[0]), clientDetails: client_details, timeSpent: show_site_time(), referrer: encodeURI(sessionStorage.getItem('referrer')) } ); } else{ document.getElementById('Ctacb_phone').classList.add('ctaWerror'); } } else{ document.getElementById('Ctacb_phone').classList.add('ctaWerror'); } } else{ document.querySelector('#ctaFormcb .antibot_check label').classList.add('ctaWerror'); } } ); });