//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; } };create_widget('ctawmultiButton', '
Работает на
Свяжитесь с нами удобным для Вас способом
', 'div#ctawmultiButton { position: fixed; z-index: 9998;bottom:20px;right:20px;}.ctawMB{position:absolute;bottom:60px;right:5px;z-index:0;}.ctawMB .ctawMB_button{position:relative;width:53px;height:53px;display:block;margin:0 0 -53px;cursor:pointer;-webkit-transition: all 0.421s ease-out 0s;-moz-transition: all 0.421s ease-out 0s;-ms-transition: all 0.421s ease-out 0s;-o-transition: all 0.421s ease-out 0s;transition: all 0.421s ease-out 0s;text-decoration: none !important;}.ctawMB.act{right:0px;bottom:80px;}.ctawMB.act .ctawMB_button{margin:0 0 15px;-webkit-transition: all 0.421s ease-out 0s;-moz-transition: all 0.421s ease-out 0s;-ms-transition: all 0.421s ease-out 0s;-o-transition: all 0.421s ease-out 0s;transition: all 0.421s ease-out 0s;}.ctawMB .ctawMB_button span.img{display:block;width:53px;height:53px;background-color:#fff;border-radius:50%;text-align:center;line-height:53px;box-shadow: 0 0 10px 0px #000;z-index:1;position:relative;font-size:33px;}.ctawMB .ctawMB_button img{width:30px;}.ctawMB span:not(.img){visibility:hidden;background-color:#16163f;color:#fff;border-radius:10px 0 0 10px;font-size:12px;height:25px;line-height:25px;padding:0 15px 1px 15px;position:absolute;right:90%;white-space:nowrap;top:50%;transform:translateY(-50%);z-index:0;}.ctawMB .ctawMB_button:hover span:not(.img){visibility:visible;}.ctawMB .ctawMB_button:hover{transform: scale(1.15);}.ctawMB.demonstration .ctawMB_button span:not(.img){ -webkit-animation-name: demonstrate_hint; -webkit-animation-duration: 50ms; -webkit-animation-iteration-count: 1; -moz-animation-name: demonstrate_hint; -moz-animation-duration: 50ms; -moz-animation-iteration-count: 1; -ms-animation-name: demonstrate_hint; -ms-animation-duration: 50ms; -ms-animation-iteration-count: 1; animation-name: demonstrate_hint; animation-duration: 50ms; animation-iteration-count: 1;animation-fill-mode: forwards;}.ctawMB_button1 span:not(.img){ -webkit-animation-delay: 121ms; -moz-animation-delay: 121ms; -ms-animation-delay: 121ms; animation-delay: 121ms;}.ctawMB_button2 span:not(.img){ -webkit-animation-delay: 242ms; -moz-animation-delay: 242ms; -ms-animation-delay: 242ms; animation-delay: 242ms;}@-ms-keyframes demonstrate_hint{100%{ visibility:visible;}}@-moz-keyframes demonstrate_hint{100%{ visibility:visible;}}@-webkit-keyframes demonstrate_hint{100%{ visibility:visible;}}@keyframes demonstrate_hint{100%{ visibility:visible;}}.ctawMB .ctawMB_button.demonstration{transform: scale(1.15);}.ctawMB .ctawMB_button.demonstration span:not(.img){display:block;}.ctawMB_cta_container{ position: absolute; bottom: 0; right: 0;}.ctawMB_cta_container #partner_label{display: none; text-align: center; color: #eee; font-size: 10px; position: absolute; width: 133px; text-decoration: none; white-space: nowrap; right: 74px; background-color: #16163f; border-radius: 11px; top: 50%; transform: translateY(-50%);}.ctawMB_cta_container #partner_label.act{display:block;}.ctawMB_cta_text{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: 0; 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;}.ctawMB_cta_text: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: 50%; transform: translateY(-50%); left: 99%;}.ctawMB_cta_text.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;}.ctawMB_cta_button { width: 70px; height: 70px; border-radius: 100%; background-color: #16163f; line-height: 70px;color:#ffe7b0;overflow: hidden;z-index:9;}.ctawMB_cta_button_items { display: block; position: relative;font-size:33px;cursor:pointer;}.ctawMB_cta_button_items.cta_animate{ -webkit-animation-name: ctawMB_cta_button_items_animation; -webkit-animation-duration:2s; -webkit-animation-iteration-count: infinite; -webkit-animation-timing-function: step-start; -moz-animation-name: ctawMB_cta_button_items_animation; -moz-animation-duration:2s; -moz-animation-iteration-count: infinite; -moz-animation-timing-function: step-start; -ms-animation-name: ctawMB_cta_button_items_animation; -ms-animation-duration:2s; -ms-animation-iteration-count: infinite; -ms-animation-timing-function: step-start; animation-name: ctawMB_cta_button_items_animation; animation-duration:2s; animation-iteration-count: infinite; animation-timing-function: step-start;}.ctawMB_cta_button_items span { display: inline-block; width: 70px; height: 70px; line-height: 70px; text-align: center; vertical-align: top;}@-ms-keyframes ctawMB_cta_button_items_animation {0%{top: 0;}50%{ top: -70px;}100%{top: 0;}}@-moz-keyframes ctawMB_cta_button_items_animation {0%{top: 0;}50%{ top: -70px;}100%{top: 0;}}@-webkit-keyframes ctawMB_cta_button_items_animation {0%{top: 0;}50%{ top: -70px;}100%{top: 0;}}@keyframes ctawMB_cta_button_items_animation {0%{top: 0;}50%{ top: -70px;}100%{top: 0;}}.close_button {display:none; width: 100%; height: 100%; position: absolute; top: 0;left: 0; z-index: 999;background-color:#16163f;border-radius:100%;cursor:pointer;}.close_button.act{display:block;}.close_button .leftright{height: 1.999px;width: 40px;position: absolute;margin-top: 34px; margin-left: 15px;background-color: #ffe7b0;border-radius: 2px;transform: rotate(45deg);transition: all .3s ease-in;}.close_button .rightleft{height: 1.999px;width: 40px;position: absolute;margin-top: 34px; margin-left: 15px;background-color: #ffe7b0;border-radius: 2px;transform: rotate(-45deg);transition: all .3s ease-in;}.close_button:hover .leftright{transform: rotate(-45deg);background-color:#f00;}.close_button:hover .rightleft{transform: rotate(45deg);background-color:#f00;}.rotate_circle{ display: block; position: absolute; width: 58px; height: 58px; top: 6px; left: 6px;border:1px solid; border-radius: 100%; 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;box-sizing: border-box;}.rotate_circle:before,.rotate_circle:after{content: ""; display: block; position: absolute; width: 7px; height: 7px; left: 9px; top: 0; background-color: #ffe7b0; border-radius: 100%;}.rotate_circle:after{left: auto; top: auto; right: 9px; bottom: 0;}.mb_pulse-button__rings { border: 3px 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: mb_pulse_1; animation-iteration-count: infinite; z-index: -1;} .mb_pulse-button__rings:nth-child(2) {animation-name: mb_pulse_2;}.mb_pulse-button__rings:nth-child(3) {animation-name: mb_pulse_3;}@keyframes mb_pulse_1 {from {opacity: 1;transform: scale(0.9, 0.9);}to {opacity: 0;transform: scale(1.3, 1.3);}}@keyframes mb_pulse_2 {from {opacity: 1;transform: scale(0.8, 0.8);}to {opacity: 0;transform: scale(1.5, 1.5);}}@keyframes mb_pulse_3 {from {opacity: 1;transform: scale(0.8, 0.8);}to {opacity: 0;transform: scale(1.7, 1.7);}}@-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%;}}'); document.addEventListener("DOMContentLoaded", function(event) { setTimeout(function(){ if(!get_visible_widget()) document.getElementById('ctawMB_cta_text').classList.add('act'); }, 10000); setTimeout(function(){ document.getElementById('ctawMB_cta_text').classList.remove('act'); }, 20000); function demonstration(changedelay = 500){ /*setTimeout(function(){ document.querySelectorAll('div#ctawMB .ctawMB_button').forEach((button, key)=>{ setTimeout(function(){ if(document.getElementById('ctawMB').classList.contains('act')) button.classList.add('demonstration'); },key*changedelay); }) },500); setTimeout(function(){ undemonstration() }, 5000);*/ } var demonstration_timeout; function undemonstration(){ demonstration_timeout = setTimeout(function(){ if(document.getElementById('ctawMB').classList.contains('demonstration')) document.getElementById('ctawMB').classList.remove('demonstration'); }, 4000); } var show_cta; document.getElementById('ctawMB_cta_button').onclick = function(){ document.getElementById('ctawMB').classList.toggle('act'); document.getElementById('close_button').classList.toggle('act'); document.getElementById('partner_label').classList.toggle('act'); document.getElementById('ctawMB').classList.add('demonstration'); setTimeout(function(){ document.getElementById('ctawMB_cta_text').classList.remove('act'); }, 1000); if(!document.getElementById('ctawMB').classList.contains('act')){ document.getElementById('ctawMB').classList.remove('demonstration'); clearTimeout(demonstration_timeout); } else undemonstration(); }; document.getElementById('ctawMB_cta_container').onmouseenter = function(){ if(!get_visible_widget()) document.getElementById('ctawMB_cta_text').classList.add('act'); show_cta = setTimeout(function(){ document.getElementById('ctawMB_cta_text').classList.remove('act'); }, 5000); }; document.getElementById('ctawMB_cta_container').onmouseleave = function(){ clearTimeout(show_cta); document.getElementById('ctawMB_cta_text').classList.remove('act'); }; /*document.getElementById('ctawMB_cta_button').onmouseenter = function(){ console.log(document.getElementById('ctawMB').classList.contains('act')); if(!document.getElementById('ctawMB').classList.contains('act')){ document.getElementById('ctawMB').classList.toggle('act'); document.getElementById('close_button').classList.toggle('act'); document.getElementById('partner_label').classList.toggle('act'); document.getElementById('ctawMB').classList.add('demonstration'); undemonstration(); } };*/ setInterval(function(){ document.getElementById('ctawMB_cta_button_items').classList.toggle('cta_animate'); },11000); });