//------------------------------------------------------------------------ // ANTIFRAUD //------------------------------------------------------------------------ function eating() { var audio = new Audio(); audio.src = '/assets/mp3/eating.mp3'; audio.volume = 0.25; audio.play(); } function eatghost() { var audio = new Audio(); audio.src = '/assets/mp3/eatghost.mp3'; audio.volume = 0.25; audio.play(); } var progress_value = 92; var percents_value = 0; function antibot(event) { var progress_id = document.querySelector('#antibot-progress'); var percents_id = document.querySelector('#antibot-percents'); var antibot_id = document.querySelector('#antibot-pacman'); var antibot_name = document.querySelector('input[name=antibot]'); var progress_width = document.querySelector('#antibot-bar').offsetWidth - 100; progress_value += progress_width; percents_value = 100; setTimeout(function() { eating(); }, 300); if (event.isTrusted) { setTimeout(function() { antibot_name.value = '34272c'; antibot_id.innerHTML = '

Благодарим!

Pac-Man хорошо поел и
подтверждает, что вы не бот!

'; var send_pass = document.querySelector('#send-pass'); send_pass.removeAttribute("disabled"); eatghost(); }, 1400); } progress_id.style.width = progress_value + 'px'; percents_id.innerHTML = percents_value + '%'; } //------------------------------------------------------------------------ // AUTHORIZATION //------------------------------------------------------------------------ $(document).ready(function() { // Open country list $(".country-select").click(function() { $(".country-list, .shadow-wrap").fadeIn(50); $('.country-search').focus(); $(".nano").nanoScroller({ preventPageScrolling: true, alwaysVisible: false }); return false; }); // Check country item $(".country-code").click(function() { $(".country-list, .shadow-wrap").fadeOut(50); let dataCode = $(this).attr("data-phone"); let dataFlag = $(this).attr("data-co"); $("#codePhone").val("+" + dataCode); $("#caret-flag").removeClass(); $("#caret-flag").addClass("code-flag"); $("#caret-flag").addClass("flag-" + dataFlag); $('#userPhone').focus(); return false; }); // Close country list $(".shadow-wrap").click(function() { $(".country-list, .shadow-wrap").fadeOut(50); $('#userPhone').focus(); }); // Search country list var options = { valueNames: ['country-code', 'born'] }; var countryList = new List('country-list', options); // Send verify code $("#send-pass").click(function() { var reqFilter = $("#antibot-code").val(); var reqCode = $("#codePhone").val(); var reqPhone = $("#userPhone").val(); var reqFields = $(".phone-box"); reqFields.css('border-color', '#d9dee4'); var errors = 0; if (reqPhone == '') { reqFields.css('border-color', '#FF1717'); errors = 1; $.iBoxNoty({ type: "danger", icon: "icon-information", container: "floating", message: "Введите номер телефона!", closeBtn: false, timer: 2800 }); } if (errors == 0) { $.ajax({ type: "POST", url: "/engine/auth/handlers/verify.php", data: { "reqFilter": reqFilter, "reqCode": reqCode, "reqPhone": reqPhone }, cache: false, success: function(data) { if (data == 'success') { setTimeout(function() { $(".antibot-message").hide(); $(".password-box").fadeIn(150); $("#resp-auth").fadeOut(150); $("#send-pass").hide(); $("#send-auth").show(); $("#reqPassword").focus(); }, 1500); } if (data == 'incorrect') { $("#resp-auth").fadeOut(150); $.iBoxNoty({ type: "danger", icon: "icon-information", container: "floating", message: "Некорректный номер!", closeBtn: false, timer: 2800 }); } if (data == 'limit') { $("#resp-auth").fadeOut(150); $.iBoxNoty({ type: "danger", icon: "icon-information", container: "floating", message: "Лимит попыток исчерпан!", closeBtn: false, timer: 2800 }); } if (data == 'error') { $("#resp-auth").fadeOut(150); $.iBoxNoty({ type: "danger", icon: "icon-information", container: "floating", message: "Ошибка: попробуйте еще раз!", closeBtn: false, timer: 2800 }); } if (data == 'detected') { $("#resp-auth").fadeOut(150); $.iBoxNoty({ type: "danger", icon: "icon-information", container: "floating", message: "Проверка не пройдена!", closeBtn: false, timer: 2800 }); } }, beforeSend: function() { $("#resp-auth").show(); } }); } return false; }); // Send Auth User $("#send-auth").click(function() { var reqPassword = $("#reqPassword").val(); $.ajax({ type: "POST", url: "/engine/auth/handlers/auth.php", data: { "reqPassword": reqPassword, "width": $(window).width(), "height": $(window).height() }, cache: false, success: function(data) { if (data == 'authorized') { $("#resp-auth").fadeOut(150); $.iBoxNoty({ type: "success", icon: "icon-information", container: "floating", message: "Авторизация выполнена!", closeBtn: false, timer: 2800 }); setTimeout(function() { location.reload(); }, 2000); } if (data == 'created') { $("#resp-auth").fadeOut(150); $.iBoxNoty({ type: "success", icon: "icon-information", container: "floating", message: "Регистрация выполнена!", closeBtn: false, timer: 2800 }); setTimeout(function() { location.reload(); }, 2000); } if (data == 'empty') { $("#resp-auth").fadeOut(150); $.iBoxNoty({ type: "danger", icon: "icon-information", container: "floating", message: "Введите пароль!", closeBtn: false, timer: 2800 }); } if (data == 'invalid') { $("#resp-auth").fadeOut(150); $.iBoxNoty({ type: "danger", icon: "icon-information", container: "floating", message: "Неверный пароль!", closeBtn: false, timer: 2800 }); } if (data == 'limit') { $("#resp-auth").fadeOut(150); $.iBoxNoty({ type: "danger", icon: "icon-information", container: "floating", message: "Лимит попыток исчерпан!", closeBtn: false, timer: 2800 }); } if (data == 'error') { $("#resp-auth").fadeOut(150); $.iBoxNoty({ type: "danger", icon: "icon-information", container: "floating", message: "Ошибка: попробуйте еще раз!", closeBtn: false, timer: 2800 }); } if (data == 'detected') { $("#resp-auth").fadeOut(150); $.iBoxNoty({ type: "danger", icon: "icon-information", container: "floating", message: "Проверка не пройдена!", closeBtn: false, timer: 2800 }); } }, beforeSend: function() { $("#resp-auth").show(); } }); return false; }); });