var csrf_token = $('meta[name="csrf-token"]').attr("content"); function getRandomInt(s, t) { return s = Math.ceil(s), Math.floor(Math.random() * ((t = Math.floor(t)) - s)) + s } function activeLinks() { $(".sidebar__game").removeClass("sidebar__game--active"); var s = location.href, t = s.substr(s.lastIndexOf("/") + 1); $(".btn_active").removeClass("active"); try { $(".btn_active.btn_" + t).addClass("active"), $(".game_" + t).addClass("sidebar__game--active") } catch (a) { console.error(a) } } function initSwiper() { new Swiper(".swiper-container", { loop: !1, observer: !0, observeParents: !0, navigation: { clickable: !0, nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev" }, pagination: { el: ".swiper-pagination", clickable: !0 } }) } function load(s, t, a = "", i = "") { xxxl(), $(".preloader").removeClass("preloader-remove"), $.get("/" + s + (s.includes("?") ? "&" : "?") + "json", function (t) { $("#_ajax_content_").html(t), window.history.pushState({ html: t, pageTitle: $(document).find("title").text() }, $(document).find("title").text(), "/" + s), $("#_ajax_content_").fadeIn("slow"), $(".preloader").addClass("preloader-remove"), $(".btn_open_close_prof").removeClass("active"); try { activeLinks() } catch (o) { } try { chatGet() } catch (l) { } try { getHistoryGames() } catch (c) { } $(".popup--wallet .popup__content .wallet").not(":first").hide(), $(".popup--wallet .popup__content .wallet__history").not(":first").hide(), 1 == a && setTimeout(() => loadTournier(i), 1e3), socket.emit("getGamesOnline"), $("html, body").animate({ scrollTop: 0 }, 0), initSwiper() }).fail(function (s, t, a) { $(".preloader").addClass("preloader-remove"), notifaction("error", "Ошибка") }), updateCurrentActivity(s) } function updateCurrentActivity(s) { fetch("/current-activity", { method: "POST", headers: { "Content-Type": "application/json", Accept: "application/json", "X-CSRF-TOKEN": csrf_token }, body: JSON.stringify({ page: s = s || window.location.pathname }) }).then(s => s.json()).then(s => { console.log("Current activity updated", s) }).catch(s => { console.log("Error updating current activity", s) }) } $("#balance").html(""), $(document).ready(function () { updateCurrentActivity(), $(".preloader").addClass("preloader-remove"), toastr.options = { closeButton: !1, debug: !1, newestOnTop: !0, progressBar: !0, positionClass: "toast-top-right", preventDuplicates: !1, onclick: null, showDuration: "500", hideDuration: "1000", timeOut: "5000", extendedTimeOut: "1000", showEasing: "swing", hideEasing: "linear", showMethod: "fadeIn", hideMethod: "fadeOut" }, $("#moreBtn").click(function (s) { s.preventDefault(), $(".chatBtn").removeClass("active"), $(this).toggleClass("active"), $("body").toggleClass("more--opened").removeClass("chat--opened") }), $("#moreGameBtn").click(function (s) { s.preventDefault(), $(this).toggleClass("active"), $("body").toggleClass("more--openedGame") }), $(".close-chat").click(function (s) { s.preventDefault(), $("body").removeClass("chat--opened"), $(".chatBtn").removeClass("active") }), $(".leftBtn").click(function (s) { s.preventDefault(), $("body").toggleClass("left--closed"), $(this).toggleClass("active") }) }); const socket = io(":2087"); function getRandomInt(s, t) { return s = Math.ceil(s), Math.floor(Math.random() * ((t = Math.floor(t)) - s + 1)) + s } function setsecret(s) { if (s.length <= 4) return "****"; var t, a = Math.floor(s.length / 2); return s.substring(0, a - 1) + "****" + s.substring(a + 2) } function live_games_item_html(s) { return `

${parseInt(s.user_win).toLocaleString("en-US")} $

${s.game_name}

${setsecret(s.user_name)}

`} function sleep(s) { let t = Date.now(), a = null; do a = Date.now(); while (a - t < s) } function stretchArray(s, t) { if (!s.length || t < s.length) throw Error("Не удалось растянуть массив."); let a = Math.floor(t / s.length), i = t % s.length, o = Array.from(s, function (s, t) { let o = a + (i > 0 ? 1 : 0); return i--, Array(o).fill(s) }); return [].concat(...o) } socket.emit("getUsersOnline"), socket.emit("getGamesOnline"), setInterval(() => { $(".online").html(parseInt(getRandomInt(100, 500))) }, 9e5), $(".online").html(parseInt(getRandomInt(100, 500))), socket.on("laravel_database_mess", function (s) { var t = (s = JSON.parse(s)).type; "uploadMessage" == t && chatAdd(s), "chat_clear" == t && $(".chat__messages .ss-wrapper .ss-content").html(""), "deleteMess" == t && $("#msg_" + s.id).remove() }), socket.on("CHAT_TIME", s => { chatHour = String(s.chatHour), chatMinute = String(s.chatMinute), chatSecond = String(s.chatSecond), $(".Chat .chat__promocode-timer--span:nth-child(1)").html(chatHour[0]), $(".Chat .chat__promocode-timer--span:nth-child(2)").html(chatHour[1]), $(".Chat .chat__promocode-timer--span:nth-child(4)").html(chatMinute[0]), $(".Chat .chat__promocode-timer--span:nth-child(5)").html(chatMinute[1]), $(".Chat .chat__promocode-timer--span:nth-child(7)").html(chatSecond[0]), $(".Chat .chat__promocode-timer--span:nth-child(8)").html(chatSecond[1]) }), socket.on("laravel_database_updateLiveGames", function (s) { if ("object" == typeof (s = JSON.parse(s))) { var t = ""; for (var a in s) t = live_games_item_html(s[a]) + t; $(".home_live_wins .list").prepend(t), $(".home_live_wins .list .item").length > 20 && $(".home_live_wins .list .item:nth-child(20)").nextAll().remove() } }), $(".home_live_wins .mail").each(function () { $(this).text(setsecret($(this).text())) }), socket.on("connect", () => $("#socket-online").text(socket.connected ? "\uD83D\uDFE2" : "\uD83D\uDD34")), socket.on("disconnect", () => $("#socket-online").text(socket.connected ? "\uD83D\uDFE2" : "\uD83D\uDD34")), socket.on("gamesOnline", function (s) { gamesOnline = JSON.parse(s); let t = { slots: gamesOnline[0].length, crash: gamesOnline[5].length, shoot: gamesOnline[7].length, x100: gamesOnline[1].length, x30: gamesOnline[2].length, dice: gamesOnline[3].length, mines: gamesOnline[4].length, coinflip: gamesOnline[6].length, keno: gamesOnline[8].length }; Object.entries(t).map(([s, t]) => { console.debug(">>", s, t), $(".games .gx-game-item .online--" + s).html(Number(t) + "") }) }), socket.on("laravel_database_history", function (s) { e = JSON.parse(s), $(".gameHistory").prepend('
' + e.name_game + '
' + e.name + '
' + e.bet + '
' + (e.win / e.bet).toFixed(2) + "x
" + (e.win / e.bet).toFixed(2) + 'x
' + e.win + '
'), $(".gameHistory").children().slice(10).remove() }); var numbersBlockBoom = [10, 11, 12, 13, 14, 15, 18, 19, 20, 21, 22, 23, 26, 27, 28, 29, 30, 31, 34, 35, 36, 37, 38, 39, 42, 43, 44, 45, 46, 47, 50, 51, 52, 53, 54, 55]; function startBoom(s) { 0 == s.statusBoom && numbersBlockBoom.forEach(function (t, a, i) { "wait" == s.blocksBoom[a] ? $(".boomcity__path div:eq(" + (t - 1) + ")").addClass("wait").html('') : $(".boomcity__path div:eq(" + (t - 1) + ")").addClass(s.blocksBoom[a]) }) } const perFace = [[-.1, .3, -1], [-.1, .6, -.4], [-.85, -.42, .73], [-.8, .3, -.75], [.3, .45, .9], [-.16, .6, .18]]; function rollDice(s, t) { $(".diceBoom").removeClass("rolling throw"), $(".diceBlock:nth-child(1) .diceBoom").css("transform", `rotate3d(${perFace[s - 1]}, 180deg)`), $(".diceBlock:nth-child(2) .diceBoom").css("transform", `rotate3d(${perFace[t - 1]}, 180deg)`), setTimeout(() => { $(".diceBoom").addClass("throw") }, 50) } var BetOffWheel = "on"; function startBonus(s) { $(".x30 .x30__bonus-scroll").css({ transition: "0s", transform: "translateX(0px)" }), $(".x30 .x30__bonus-scroll").html(""), $(".x30 .x30__bonus").show(), $(".x30 .x30__timer").hide(), x = 2352 - rand(5, 40), setTimeout(() => $(".x30 .x30__bonus-scroll").css({ transition: "" + s.bonusWheelTime + "s", transform: "translateX(-" + x + "px)" }), 100), s.bonusArr.forEach(s => { $(".x30 .x30__bonus-scroll").append('
' + s.multiplayer[0] + "
") }) } function startWheel(s) { 1 == s.wheelStatus && ($("#x30__text").html("Прокрутка"), $("#x30__status").addClass("x30__rocket--started")), rotateW = s.wheelRotate + s.wheelPlus, $("#x30__wheel").css("transition", "all " + s.wheelTime + "s ease 0s").css("transform", "rotate(" + rotateW + "deg)"), console.log("startWheel") } function betWheel(s) { if ("off" == window.BetOffWheel) return notification("error", "Bets are closed, wait for the next round"), undisable(".x30__bet-heading"); $.post("/wheel/bet", { _token: csrf_token, coff: s, bet: $("#wheel_input").val() }).then(s => { undisable(".x30__bet-heading"), s.success && (balanceUpdate(s.lastbalance, s.newbalance), notification("success", s.success)), s.error && notification("error", s.error) }) } function startX100(s) { 1 == s.x100Status && ($("#x100__text").html("Прокрутка"), $("#x100__status").addClass("x30__rocket--started")), rotateW = s.x100Rotate - s.x100Plus - 180, $("#x100__wheel").css("transition", "all " + s.x100Time + "s ease 0s").css("transform", "rotate(" + rotateW + "deg)"), s.statusBonusX100 > 0 && ($(".x100 .wheel__x100-bonus-scroll").css("transition", "0s").css("transform", "translateX(0px)"), $(".bonusBlock").show(), $(".bonusBlock").hide(), $(".x100 .wheel__x100-bonus-scroll").html(""), s.x100BonusAvatars.forEach(s => { $(".x100 .wheel__x100-bonus-scroll").append('
') }), pxScrollX100Bonus = 2688 - Number($(".wheel__x100-bonus-x").width()) / 2 + rand(10, 40), $(".x100 .wheel__x100-bonus-scroll").css("transition", "" + (s.x100Time - 20) + "s"), $(".x100 .wheel__x100-bonus-scroll").css("transform", "translateX(-" + pxScrollX100Bonus + "px)")) } function betX100(s) { $.post("/x100/bet", { _token: csrf_token, coff: s, bet: $("#sumBetX100").val() }).then(s => { undisable(".x30__bet-heading"), s.success && (balanceUpdate(s.lastbalance, s.newbalance), notification("success", s.success)), s.error && notification("error", s.error) }) } function getHistoryGames() { $.post("/history/gamesload", { _token: csrf_token }).then(s => { s.history.forEach(s => { $(".gameHistory").prepend('
' + s.name_game + '
' + s.name + '
' + s.bet + '
' + (s.win / s.bet).toFixed(2) + "x
" + (s.win / s.bet).toFixed(2) + 'x
' + s.win + '
') }) }) } socket.on("WHEEL_GET", s => { startWheel(s); var t = s.coefficients; $(".x30__bet-heading_x30").each(function () { $(this).html("x" + t[0]), 2 == s.statusBonus && $(this).addClass("gold"), t.shift() }), 1 == s.statusBonus && startBonus(s) }), socket.on("WHEEL_NEW_COEFF", s => { var t = s.coefficients; console.log(t), $(".x30__bet-heading_x30").each(function () { $(this).html("x" + t[0]).removeClass("gold"), t.shift() }) }), socket.on("WHEEL_START", s => { startWheel(s) }), socket.on("WHEEL_BONUS", s => { startBonus(s) }), socket.on("WHEEL_TIME", s => { window.BetOffWheel = s.bet, $("#x30__timer").html(s.time), per = 100 * Number(s.time) / 30, $(".prog_wheel").css("width", per + "%"), $(".text_wheel").html(s.text) }), socket.on("WHEEL_NOTIFY", s => { USER_ID == s.user_id ? (notification("success", "You won " + s.win.toFixed(2) + " coin"), updateBalance()) : location.pathname }), socket.on("WHEEL_FINISH", s => { $("#x30__status").removeClass("x30__rocket--started"), updateHistory(s.history) }), socket.on("WHEEL_CLEAR", s => { $("#x30__text").html("Начало через"), $(".bets_block_col").removeClass("opacity"), $("span[data-sumBets]").html(0), $("span[data-players]").html(0), $(".x30 .x30__bonus").hide(), $(".x30 .x30__timer").show(), $(".x30__bet-users").html(""); var t = [2, 3, 5, 7, 14, 30]; $(".x30__bet-heading_x30").each(function () { $(this).html("x" + t[0]).removeClass("gold"), t.shift() }) }), socket.on("laravel_database_updateBalance", s => { USER_ID == (s = $.parseJSON(s)).user_id && balanceUpdate(s.lastbalance, s.newbalance) }), socket.on("laravel_database_wheelBet", s => { s = (s = $.parseJSON(s)).data, class_dop = "", s.user_id == USER_ID && (class_dop = "img_no_blur"), $(".x30__bet-users.x" + s.coff).prepend("
' + s.login + '
' + Number(s.bet).toFixed(2) + '
'), $("span[data-sumBets=" + s.coff + "]").html(s.sumBets.toFixed(0)), $("span[data-players=" + s.coff + "]").html(s.players) }), socket.on("laravel_database_updateWheelBet", s => { s = (s = $.parseJSON(s)).data, $("span[data-sumBets=" + s.coff + "]").html(s.sumBets.toFixed(0)), $("span[data-players=" + s.coff + "]").html(s.players), $(".x30__bet-users.x" + s.coff + " .x30__bet-user[data-user-id=" + s.user_id + "] .x30__bet-sum span").html(Number(s.bet).toFixed(2) + "") }), socket.on("X100_GET", s => { startX100(s) }), socket.on("X100_START", s => { startX100(s) }), socket.on("X100_START_BONUS", s => { $(".x100 .wheel__x100-bonus-scroll").css("transition", "0s").css("transform", "translateX(0px)"), $(".x100 .bonusBlock").show(), $(".TimerBlock").hide(), $(".x100 .wheel__x100-bonus-scroll").html(""), s.x100BonusAvatars.forEach(s => { $(".x100 .wheel__x100-bonus-scroll").append('
') }), pxScrollX100Bonus = 2688 - Number($(".wheel__x100-bonus-x").width()) / 2 + rand(10, 40), setTimeout(() => $(".x100 .wheel__x100-bonus-scroll").css("transition", "10s").css("transform", "translateX(-" + pxScrollX100Bonus + "px)"), 100) }), socket.on("X100_CLEAR", s => { $(".wheel__x100-winner").hide(), $("#x100__text").html("Начало через"), $("span[data-sumBetsX100]").html(0), $("span[data-playersX100]").html(0), $(".x100__bet-users").html("") }), socket.on("X100_FINISH", s => { $(".wheel__bet-item-users").html(""), $(".bonusBlock").hide(), $(".TimerBlock").show(), $("#x100__status").removeClass("x30__rocket--started"), updateHistoryX100(s.history), $(".x100__bet-users").html("") }), socket.on("X100_TIME", s => { $("#x100__timer").html(s.time) }), socket.on("laravel_database_updateX100Bet", s => { s = (s = $.parseJSON(s)).data, $("span[data-sumBetsX100=" + s.coff + "]").html(s.sumBets.toFixed(0)), $("span[data-playersX100=" + s.coff + "]").html(s.players), $(".x100 .x100__bet-users.x" + s.coff + " .x30__bet-user[data-user-id=" + s.user_id + "] .x30__bet-sum span").html(Number(s.bet).toFixed(2) + "") }), getHistoryGames(); var SHOW = 0; function typeShow(s) { $("#all_systems").toggleClass("show"), 0 == SHOW ? (SHOW = 1, $(s).html("Свернуть")) : (SHOW = 0, $(s).html("Развернуть")) } function updateHistory(s) { $(".x30__history-scroll").html(""), s.forEach(s => { randomR = (randomR = s.random).replace(/""/g, "''"), $(".x30__history-scroll").append("
") }) } function updateHistoryX100(s) { $(".x100__history-scroll").html(""), s.forEach(s => { randomR = (randomR = s.random).replace(/""/g, "''"), $(".x100__history-scroll").append("
") }) } function chatScroll() { var s = $(".chat__messages .ss-wrapper .ss-content"); s.scrollTop(s.prop("scrollHeight")) } function disable(s) { $(s).css("pointer-events", "none"), $(s).attr("disabled", "disabled") } function undisable(s) { $(s).removeAttr("disabled", "disabled"), $(s).css("pointer-events", "") } function notification(s, t) { toastr[s](t) } function rotateBonusWheel(s, t, a) { $("." + s).css("transition", a + "s").css("transform", "rotate(" + t + "deg) ") } var options = { useEasing: !0, useGrouping: !0, separator: ",", decimal: 2, prefix: "", suffix: "" }; function updateBalance() { $.post("/balance/get", { _token: csrf_token }).then(s => { s.success && balanceUpdate($("#balance").attr("balance"), s.balance) }) } function changeRepostBalance() { $.post("/repost/change", { _token: csrf_token }).then(s => { s.success ? ($("#bonusBalance").html(0), notification("success", "You have successfully exchanged your bonus balance for real money."), balanceUpdate($("#balance").attr("balance"), s.balance)) : notification("error", s.mess) }) } function changeRefBalance() { $.post("/refs/change", { _token: csrf_token }).then(s => { s.success ? ($("#refBalance").html(0), notification("success", "You have successfully exchanged your referral balance for real."), balanceUpdate($("#balance").attr("balance"), s.balance)) : notification("error", s.mess) }) } function getcashback() { $.post("/bonus/getcashback", { _token: csrf_token }).then(s => { s.success ? ($("#cashbackBalance").html(0), notification("success", "You have successfully credited cashback to your account"), balanceUpdate($("#balance").attr("balance"), s.balance)) : notification("error", s.mess) }) } function animateNumber(s, t, a) { $({ numberValue: s }).animate({ numberValue: t }, { duration: a, easing: "linear", step: function (s) { $("#balance").text(parseFloat(s).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ")) } }) } function balanceUpdate(s, t, a = 250) { $("#balance").attr("balance", t), animateNumber(s, t, a) } function open_link(s) { window.open(s) } function getBonusVk(s) { $.post("/bonus/vk", { _token: csrf_token }).then(t => { undisable(s), t.link && setTimeout(() => open_link(t.link), 1e3), t.success ? (notification("success", t.mess), balanceUpdate(t.lastbalance, t.newbalance)) : notification("error", t.mess) }) } function getBonusRef(s) { $.post("/bonus/ref", { _token: csrf_token }).then(t => { t.success ? ($("#refs").html(t.refs), rotateBonusWheel("bonus__rotate", 0, 0), setTimeout(() => rotateBonusWheel("bonus__rotate", t.rotate - rand(10, 45), 10), 100), setTimeout(() => notification("success", t.mess), 1e4), setTimeout(() => balanceUpdate(t.lastbalance, t.newbalance), 1e4), setTimeout(() => undisable(s), 1e4)) : (undisable(s), notification("error", t.mess)) }) } function copyText(s) { var t = $(""); $("body").append(t), t.val($("#" + s).text()).select(), document.execCommand("copy"), t.remove(), toastr.info("Copy!"), $(".btnCopy").text("Copy!") } function checkTgConnect(s) { $.post("/bonus/checktg", { _token: csrf_token }).then(t => { undisable(s), t.success ? (notification("success", t.mess), $(".close").click()) : notification("error", t.mess) }) } function getBonusTg(s) { $.post("/bonus/tg", { _token: csrf_token }).then(t => { undisable(s), t.modal && showPopup("popup--tg"), t.success ? (notification("success", t.mess), balanceUpdate(t.lastbalance, t.newbalance)) : notification("error", t.mess) }) } function getBonus(s) { $.post("/bonus/get", { _token: csrf_token }).then(t => { t.success ? (rotateBonusWheel("bonus__rotate", 0, 0), setTimeout(() => rotateBonusWheel("bonus__rotate", t.rotate - rand(10, 45), 10), 100), setTimeout(() => notification("success", t.mess), 1e4), setTimeout(() => balanceUpdate(t.lastbalance, t.newbalance), 1e4), setTimeout(() => undisable(s), 1e4)) : (undisable(s), notification("error", t.mess)) }) } function sendMess(s) { $.post("/chat/send", { _token: csrf_token, message: $("#messageChat").val() }).then(t => { undisable(s), t.success ? ($("#messageChat").val(""), notification("success", "Message sent")) : notification("error", t.mess) }) } function sendSticker(s, t) { $.post("/chat/sendsticker", { _token: csrf_token, sticker: s }).then(s => { undisable(t), s.success ? $(".panel_stickers").removeClass("open") : notification("error", s.mess) }) } function checkStatus(s, t) { $.post("/deposit/checkstatus", { _token: csrf_token, id: s }).then(s => { undisable(t), s.success ? (updateBalance(), notification("success", "You have successfully topped up your balance"), $(".close").click()) : notification("error", s.mess) }) } function createPromoUser(s) { $.post("/promo/create", { _token: csrf_token, name: $("#name_crpromo").val(), sum: $("#sum_crpromo").val(), act: $("#act_crpromo").val() }).then(t => { undisable(s), t.success ? (balanceUpdate(t.lastbalance, t.newbalance), notification("success", "You have successfully created a promo code."), close_modal()) : notification("error", t.mess) }) } function actPromo(s) { if ("" == $("#captcha > iframe").attr("data-hcaptcha-response")) return notification("error", "Pass the captcha"), undisable(s), !1; $.post("/promo/act", { _token: csrf_token, name: $("#promo_name").val() }).then(t => { undisable(s), t.success ? (balanceUpdate(t.lastbalance, t.newbalance), notification("success", "Promo code successfully activated"), $("#promo_name").val(""), captcha_r()) : (notification("error", t.mess), captcha_r()) }) } function canselWithdraw(s, t) { $.post("/withdraw/cansel", { _token: csrf_token, id: s }).then(a => { undisable(t), a.success ? (balanceUpdate(a.lastbalance, a.newbalance), notification("success", "Withdrawal successfully cancelled"), $("#statusW_" + s + " span").html("Отменен"), $("#statusW_" + s).removeClass("warning").addClass("error")) : notification("error", a.mess) }) } function goWithdraw(s) { $.post("/withdraw/go", { _token: csrf_token, sum: Number($("#sum_withdraw").val()), system: $("#systemW").val(), wallet: $("#wallet_withdraw").val() }).then(t => { undisable(s), t.success ? (balanceUpdate(t.lastbalance, t.newbalance), notification("success", "Funds have been successfully withdrawn. Waiting time from 5 minutes to 24 hours"), $(".wallet__history--withdraw").prepend('
' + t.withdraw.ps + '
' + t.withdraw.sum + '
Ожидание... (Отменить)
')) : t.hasOwnProperty("alert") ? ($("#wderr").text(t.mess), $("#wderrh").text(t.header), $("#pwde").click()) : notification("error", t.mess) }) } function goDeposit(s) { $.post("/deposit/go", { _token: csrf_token, sum: Number($("#sumDep").val()), system: $("#systemDep").val(), promo: $("#promoDep").val() }).then(t => { undisable(s), t.success ? 0 == t.modal ? (notification("success", "Redirect for payment"), location.href = t.link) : (amount_to = (transfer = t.transfer).amount_to, wallet_to = transfer.wallet_to, comment_to = transfer.comment_to, order_id = transfer.order_id, img = t.img, $("#wallet_pay").html(wallet_to), $("#comment_pay").html(comment_to), $("#sum_pay").html(amount_to), $("#check_pay").attr("onclick", "disable(this);checkStatus(" + order_id + ", this)"), showPopup("popup--refill")) : notification("error", t.mess) }) } function open_panel_smiles() { $(".panel_smiles").toggleClass("open"), $(".panel_stickers").removeClass("open") } function open_panel_stickers() { $(".panel_stickers").toggleClass("open"), $(".panel_smiles").removeClass("open") } function addSmileInChat(s) { $("#messageChat").val($("#messageChat").val() + " " + s) } function AddSmile(s) { var t = $.trim($(".chat__input input").val()); $(".chat__input input").focus().val(t + " :smile_" + s + ": ") } function changeBalance(s, t) { $.post("/change/balance", { _token: csrf_token, type: s }).then(a => { a.success ? ($(".dice__select-chance a").removeClass("active"), $(t).addClass("active"), localStorage.setItem("balance", s), balanceUpdate(0, a.balance), $("#demoPanel").hide(), 1 == s && $("#demoPanel").show()) : notification("error", a.mess) }) } function addDemoBalance() { $.post("/add/demobalance", { _token: csrf_token, addbalance: $("#add_balance").val() }).then(s => { s.success ? (balanceUpdate($("#balance").attr("balance"), s.balance), $(".close").click(), notification("success", "Demo balance successfully replenished")) : notification("error", s.mess) }) } $(document).ready(function () { $("img").attr("draggable", "false"), $(".logo").css("pointer-events", "auto"), $(".click_pp").click(function () { $(".btn_open_close_prof").toggleClass("active") }), $(".btn_open_close_prof").focusout(function () { $(".btn_open_close_prof").removeClass("active") }), $("#messageChat").focus(function () { $(".panel_smiles").removeClass("open"), $(".panel_stickers").removeClass("open") }), $(".chat_btn").click(function () { $(".col-chat-lg").toggleClass("open"), $(".chat_btn").toggleClass("active"), chatScroll() }), $(".more_btn").click(function () { $(".panel_more").toggleClass("open"), $(".more_btn").toggleClass("active") }), $(".bets_btn").click(function () { $(".panel_bets").toggleClass("open"), $(".bets_btn").toggleClass("active") }) }); var typeDice = "minPlay"; function changeDice(s, t) { typeDice = s, updateDiceCoeff(), $(".dice__select-chance a").removeClass("active"), $(t).addClass("active") } function diceRange() { return (val_pos = value = $(".dice__range").val(), pos = "right", "maxPlay" == typeDice && (val_pos = value, pos = "right"), val_pos > 95) ? $(".range_dice").val(5) : val_pos < 1 ? $(".range_dice").val(100) : void ($("#PercentDice").val(Number(val_pos).toFixed(2)), $("#CoeffDice").val(Number(100 / val_pos).toFixed(2)), $(".dice__range").css("background", "linear-gradient(to " + pos + ", #7C79FF 0%, #7C79FF " + val_pos + "%, #DFDEEF " + val_pos + "%, #DFDEEF 100%)"), updateDiceBet()) } function updateDicePercent() { (percent = $("#PercentDice").val()) > 95 && ($("#PercentDice").val("95.00"), percent = 95), coeff = 100 / percent, value = percent, $("#CoeffDice").val(Number(coeff).toFixed(2)), updateDiceBet() } function updateDiceCoeff() { return (coeff = Number($("#CoeffDice").val()), percent = Number($("#PercentDice").val()), coeff > 100 && (coeff = 100, $("#CoeffDice").val("100.00")), coeff < 1.05 && (coeff = 1.05, $("#CoeffDice").val("1.05")), pos = "right", val_pos = percent, "maxPlay" == typeDice && (val_pos = percent, pos = "right"), value = percent, $(".dice__range").css("background", "linear-gradient(to " + pos + ", #397ce6 5.39%, #397ce6 " + percent + "%, #DFDEEF " + percent + "%, #DFDEEF 100%)"), $(".dice__range").val(val_pos), 1.05 == coeff) ? ($("#PercentDice").val(Number(95).toFixed(2)), updateDiceBet()) : ($("#PercentDice").val(Number(percent).toFixed(2)), updateDiceBet()) } function updateDiceWin() { bet = ((win = $("#WinDice").val()) / (coeff = 100 / (percent = $("#PercentDice").val()))).toFixed(2), $("#BetDice").val(bet) } function updateDiceBet() { win = ((bet = $("#BetDice").val()) * (coeff = 100 / (percent = $("#PercentDice").val()))).toFixed(2), $("#WinDice").val(win) } function rand(s, t) { return Math.floor(Math.random() * (t - s)) + s } function playDice(s, t = typeDice) { $("#checkDice").hide(), $.post("/dice/play", { _token: csrf_token, type: t, bet: $("#BetDice").val(), percent: $("#PercentDice").val() }).then(a => { if (undisable(s), a.success) { $("#checkDice").show(), balanceUpdate(a.lastbalance, a.newbalance), chance = "minPlay" == t ? "< " + $("#PercentDice").val() : "> " + Number(100 - $("#PercentDice").val()).toFixed(2), $("#dice_bet").html($("#BetDice").val()), $("#dice_win").html(a.win.toFixed(2)), $("#dice_coeff").html("x" + (100 / Number($("#PercentDice").val())).toFixed(2)), $("#chanse_dice").html(chance), $("#salt2_dice").html(a.salt2), $("#full_dice").html(a.full_string), $("#hash_dice").html(a.hash), $("#salt1_dice").html(a.salt1), $("#number_dice").html(a.number), $("#dice__result").removeClass("dice__drum--win dice__drum--lose"), $("#dice__result").addClass("dice__drum--" + a.type), $(".dice__check-result").removeClass("dice__check-result--lose dice__check-result--win"), $(".dice__check-result").addClass("dice__check-result--" + a.type), $(".dice__slider-inner .dice__slider-item").length; var i = $(".dice__slider-inner .dice__slider-item")[0].offsetHeight, o = (number = Number(a.number).toFixed(2)).split("."); o[0] < 10 && (o[0] = "0" + o[0]), o[1] < 10 && (o[1] = o[1] + "0"), $("#dice_n_1_check").html(o[0][0]), $("#dice_n_2_check").html(o[0][1]), $("#dice_n_3_check").html(o[1][0]), $("#dice_n_4_check").html(o[1][1]), $("#dice_n_1").css({ transform: "translateY(-" + i * o[0][0] + "px)" }), $("#dice_n_2").css({ transform: "translateY(-" + i * o[0][1] + "px)" }), $("#dice_n_3").css({ transform: "translateY(-" + i * o[1][0] + "px)" }), $("#dice_n_4").css({ transform: "translateY(-" + i * o[1][1] + "px)" }) } else notification("error", a.mess) }) } function close_modal() { $(".modal_body").fadeOut("fast"), $(".modal_panel").fadeOut("fast") } function show_modal(s) { $(".modal_body").fadeIn("fast"), $(".modal_panel").hide(), $(".modal_" + s).fadeIn("fast") } function changeMethod(s, t, a, i, o, l) { $("#id_method").val(t), $("#min_sum_" + i).html(a), $(".method_block_pay").removeClass("active"), $(s).addClass("active"), $("#comm_percent").val(o), $("#comm_rub").val(l), "withdraws" == i && Number(l) > -1 && (sum_get = (sum = $("#sum_withdraw").val()) - sum * (o / 100), sum_get -= l, $("#get_withdraw").val(sum_get)) } function updateW() { sum = $("#sum_withdraw").val(), comm_rub = $("#comm_rub").val(), sum_get = sum - sum * ((comm_percent = $("#comm_percent").val()) / 100), sum_get -= comm_rub, $("#get_withdraw").html(sum_get) } function checkDice() { show_modal("check_dice") } function checkMine() { show_modal("check_mine") } function createMinePole(s) { $(".mines__bomb.Bomb").html(""), $(".mines__bomb.Bomb").append('3'), $(".mines__bomb.Bomb").append('5'), $(".mines__bomb.Bomb").append('' + Number((s / 2).toFixed(0) - 1) + ""), $(".mines__bomb.Bomb").append('' + Number(s - 1) + ""), $(".mines__path").html("").removeClass("level_16 level_25 level_36 level_49").addClass("level_" + s), $(".mines__bomb.Level a").removeClass("mines__bomb--active"), $(".mines__bomb.Level a.level_" + s).addClass("mines__bomb--active"), n = Math.sqrt(s); for (var t = 0; t < s; t++)$(".mines__path").append('
'); updateMinesXNew() } function updateLevel() { createMinePole(level = $("#LevelMines").val()) } function updateMinesXNew() { $(".mines__scroll").html(""), $(".mines__bomb.Bomb a").removeClass("mines__bomb--active"), BombMines = Number($("#BombMines").val()), $(".mines__bomb.Bomb a.bomb_" + BombMines).addClass("mines__bomb--active"), level = $("#LevelMines").val(); for (let s = 0; s < level - BombMines; s++)win = (coeffMine = getCoffNew(BombMines, s + 1, level)) * Number($("#BetMines").val()), $(".mines__scroll").append('

' + Number(s + 1) + " Turn " + coeffMine.toFixed(2) + "x

" + win.toFixed(2) + "
") } function startGameMineNew(s) { $("#checkMine").hide(), $.post("/newmines/start", { _token: csrf_token, level: $("#LevelMines").val(), bet: Number($("#BetMines").val()), bomb: Number($("#BombMines").val()) }).then(t => { t.success ? ($(".win_mine_block").hide(), undisable(".mines__path-item"), $(".mines__path-item").removeClass("mines__path-item--lose mines__path-item--win"), disable("#BetMines"), disable("#BombMines"), disable(".btn_mine_bomb"), disable(".btn_mine_level"), notification("success", "The game has begun!"), $(".start_block_mine").hide(), $(".play_block_mine").show(), $(".mines__x-item").removeClass("active"), $(".mines__x-item:eq(0)").addClass("mines__x-item--win"), $(".mines__scroll").stop().animate({ scrollLeft: "0px" }, 800), balanceUpdate(t.lastbalance, t.newbalance), 1 == t.bonus && (notification("success", "Bonus game!"), $(".mines__bonus .x30__bonus-scroll").css({ transition: "0s", transform: "translateX(0px)" }), $(".mines__bonus .x30__bonus-scroll").html(""), $(".mines__bonus").show(), disable(".start_block_mine a"), disable(".play_block_mine a"), t.ikses.forEach(s => { $(".mines__bonus .x30__bonus-scroll").append('
x' + s + "
") }), x = 2408 - Number($(".mines__bonus").width()) / 2 + rand(10, 40), betNew = (betNew = (betMine = Number($("#BetMines").val())) * t.bonusMine).toFixed(2), disable(".mines__path-item"), setTimeout(() => $(".mines__bonus .x30__bonus-scroll").css({ transition: "10s", transform: "translateX(-" + x + "px)" }), 200), setTimeout(() => $("#BetMines").val(betNew), 1e4), setTimeout(() => undisable(".mines__path-item"), 1e4), setTimeout(() => notification("success", "Congratulations! Your bet has been multiplied by " + t.bonusMine), 1e4), setTimeout(() => updateMinesXNew(), 1e4), setTimeout(() => undisable(".start_block_mine a"), 1e4), setTimeout(() => undisable(".play_block_mine a"), 1e4))) : (undisable(s), notification("error", t.mess)) }) } function finishGameMineNew(s) { $.post("/newmines/finish", { _token: csrf_token }).then(t => { $(".mine").removeClass("no_select"), undisable(".mine"), undisable(s), t.success ? (balanceUpdate(t.lastbalance, t.newbalance), undisable("#BetMines"), undisable("#BombMines"), undisable(".mines__bomb a"), undisable(".start_block_mine a"), undisable(".play_block_mine a"), $(".start_block_mine").show(), $(".play_block_mine").hide(), $("#winMine").html("0.00"), game = t.game, $("#checkMine").show(), notification("success", "You won " + Number(game.win).toFixed(2)), $(".sumWinText").html(Number(game.win).toFixed(2)), $(".win_mine_block").show(), (mines = JSON.parse(game.mines)).forEach(function (s, t, a) { $(".mines__x-item:eq(" + (num = s - 1) + ")").addClass("mines__x-item--lose") }), $(".mines__bonus").hide(), betNew = (betNew = (betMine = Number($("#BetMines").val())) / game.bonusMine).toFixed(2), $("#BetMines").val(betNew), updateMinesXNew(), $("#full_mine").html(game.full_string), $("#hash_mine").html(game.hash), $("#salt1_mine").html(game.salt1), $("#number_mine").html(game.pole_hash), $("#salt2_mine").html(game.salt2), undisable(".btn_mine_level"), $("#mine_bet").html(game.bet.toFixed(2)), $("#mine_win").html(Number(game.win).toFixed(2)), $("#mine_coeff").html((game.win / game.bet).toFixed(2)), $("#checkMine").show()) : (undisable(".mines__path-item"), notification("error", t.mess)) }) } function autoClickMineNew(s) { $.post("/newmines/autoclick", { _token: csrf_token }).then(t => { undisable(s), t.success ? (num = t.num - 1, $(".mine").removeClass("no_select"), clickMineNew(".mines__path-item:eq(" + num + ")", t.num)) : notification("error", t.mess) }) } function clickMineNew(s, t) { $.post("/newmines/click", { _token: csrf_token, mine: t }).then(a => { $(".mine").removeClass("no_select"), undisable(".mine"), a.success ? "lose" == a.type ? (undisable("#BetMines"), undisable("#BombMines"), undisable(".mines__bomb a"), undisable(".start_block_mine a"), undisable(".play_block_mine a"), $(".start_block_mine").show(), $(".play_block_mine").hide(), $("#winMine").html("0.00"), (mines = JSON.parse((game = a.game).mines)).forEach(function (s, t, a) { $(".mines__path-item:eq(" + (num = s - 1) + ")").addClass("mines__path-item--lose") }), $(s).addClass("mine_lose"), $(".mine_check:eq(" + (t - 1) + ")").addClass("mine_lose"), $(".mines__bonus").hide(), betNew = (betNew = (betMine = Number($("#BetMines").val())) / game.bonusMine).toFixed(2), $("#BetMines").val(betNew), updateMinesXNew(), $("#full_mine").html(game.full_string), $("#hash_mine").html(game.hash), $("#salt1_mine").html(game.salt1), $("#number_mine").html(game.pole_hash), $("#salt2_mine").html(game.salt2), $("#mine_bet").html(game.bet.toFixed(2)), $("#mine_win").html("0.00"), $("#mine_coeff").html((game.win / game.bet).toFixed(2)), $("#checkMine").show()) : (1 == a.gameOff && finishGameMineNew(".play_block_mine"), step = (game = a.game).step, $(".mines__x-item").removeClass("mines__x-item--win"), $(".mines__x-item:eq(" + step + ")").addClass("mines__x-item--win"), $(".mines__scroll").stop().animate({ scrollLeft: `${(step - 0) * 160}px` }, 800), $(s).addClass("mines__path-item--win"), num = t - 1, $("#winMine").html(Number(game.win).toFixed(2))) : (undisable(s), notification("error", a.mess)) }) } function getGameMineNew() { $.post("/newmines/get", { _token: csrf_token }).then(s => { s.success ? (disable("#BetMines"), disable("#BombMines"), disable(".btn_mine_level"), game = s.game, $("#LevelMines").val(game.level), $("#winMine").html(Number(game.win).toFixed(2)), $("#BetMines").val(Number(game.bet).toFixed(2)), $("#BombMines").val(Number(game.num_mines)), createMinePole(game.level), disable(".mines__bomb a"), $(".start_block_mine").hide(), $(".play_block_mine").show(), step = game.step, $(".mines__x-item").removeClass("mines__x-item--win"), $(".mines__x-item:eq(" + step + ")").addClass("mines__x-item--win"), $(".mines__scroll").stop().animate({ scrollLeft: `${(step - 0) * 160}px` }, 800), (click = JSON.parse(game.click)).forEach(function (s, t, a) { $(".mines__path-item:eq(" + (num = s - 1) + ")").addClass("mines__path-item--win") }), game.bonusMine > 1 && (x = 2408 - Number($(".mines__bonus").width()) / 2 + rand(10, 40), $(".mines__bonus .x30__bonus-scroll").css({ transition: "0s", transform: "translateX(-" + x + "px)" }), $(".mines__bonus .x30__bonus-scroll").html(""), $(".mines__bonus").show(), (bonusIkses = JSON.parse(game.bonusIkses)).forEach(s => { $(".mines__bonus .x30__bonus-scroll").append('
x' + s + "
") }))) : $(".start_block_mine").show() }) } function getCoffNew(s, t, a) { for (var i = 1, o = 0; o < a - s && t > o; o++)i *= (a - o) / (a - s - o); return i } function hexToRgb(s) { var t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(s); return t ? { r: parseInt(t[1], 16), g: parseInt(t[2], 16), b: parseInt(t[3], 16) } : null } function animationStart(s, t, a) { console.log(a), $(".players.jackpot").html(""), $(".players.jackpot").css({ transition: "0s", transform: "translateX(0px)" }), $(".progress_block_jackpot").hide(), $(".blockRouletteJackpot").show(); for (let i = 0; i < s.length; i++)class_dop = "", (av = s[i]) == USER_AVA && (class_dop = "img_no_blur"), $(".players.jackpot").append(''); for (let o = 0; o < s.length; o++)class_dop = "", (av = s[o]) == USER_AVA && (class_dop = "img_no_blur"), $(".players.jackpot").append(''); $(".players.jackpot").css({ transition: "all " + 1e3 * a + "ms cubic-bezier(0, 0, 0, 1) 0ms", transform: "translateX(-" + (3800 + t) + "px)" }) } function selectCashHunt(s, t) { $.post("/jackpot/selecthunt", { _token: csrf_token, id: s }).then(s => { undisable(".hant"), s.success && ($(".hant").removeClass("active"), $(t).addClass("active")), s.error && notification("error", s.error) }).fail(s => { undisable(".hant"), notification("error", JSON.parse(s.responseText).message) }) } function selectKeno(s, t) { if (-1 != selectsKeno.indexOf(s)) { let a = selectsKeno.indexOf(s); a > -1 && (selectsKeno.splice(a, 1), $(t).removeClass("keno__canvas-item--is-selected")) } else { if (5 == selectsKeno.length) return notification("error", "Maximum 5 cells"); selectsKeno.push(s), $(t).addClass("keno__canvas-item--is-selected") } updateKenoCoeff() } function updateKenoCoeff() { $(".keno__coeff-scroll").html(""), selectsKeno.length > 0 && (kenoIkses = kenoCoefs[selectsKeno.length - 1]).forEach(async function (s, t, a) { $(".keno__coeff-scroll").append('
' + s + "x " + (t + 1) + " hits
") }) } function sleep(s) { return new Promise(t => setTimeout(t, s)) } function clearKeno(s) { selectsKeno.forEach(async function (s, t, a) { setTimeout(function () { $(".keno__canvas-item:eq(" + (s - 1) + ")").removeClass("keno__canvas-item--is-selected") }, 100 * ++t) }), setTimeout(function () { undisable(s), $(".keno__coeff-scroll").html("") }, 100 * selectsKeno.length + 100), selectsKeno = [] } function autoKeno(s) { $(".keno__canvas-item").removeClass("keno__canvas-item--is-selected"), selectsKeno = []; for (var t = 1; t <= 5; t++) { for (randItem = rand(1, 41), type = "False"; "False" == type;)if (-1 != selectsKeno.indexOf(randItem)) randItem = rand(1, 41); else break; selectsKeno.push(randItem) } selectsKeno.forEach(async function (s, t, a) { setTimeout(function () { $(".keno__canvas-item:eq(" + (s - 1) + ")").addClass("keno__canvas-item--is-selected") }, 100 * ++t) }), setTimeout(function () { undisable(s), updateKenoCoeff() }, 600) } function betKeno(s) { selects = JSON.stringify(selectsKeno), $.post("/keno/bet", { _token: csrf_token, selectsKeno: selects, bet: $("#sumBetKeno").val() }).then(t => { undisable(s), t.success && (disable(".keno__cancel-select"), disable(".keno__auto-select"), $(".keno__canvas-item").addClass("blocked"), balanceUpdate(t.lastbalance, t.newbalance), notification("success", t.success)), t.error && notification("error", t.error) }).fail(t => { undisable(s), notification("error", JSON.parse(t.responseText).message) }) } function checkTheme() { "dark" === localStorage.getItem("theme") ? ($("body").addClass("theme--dark"), $("#darkTheme").hide(), $("#lightTheme").show()) : ($("body").removeClass("theme--dark"), $("#darkTheme").show(), $("#lightTheme").hide(), localStorage.removeItem("theme")) } $(window).on("load", function () { $(".preloader").addClass("preloader-remove") }), socket.on("CASHHUNT_FINISH", s => { $(".hant").addClass("show"), $(".cashHantWrapper .hant").each(function (t, a) { x = s.coefsHunt[t], $(this).html('x' + x + "") }) }), socket.on("CASHHUNT_END", s => { $("#Jackpot").show(), $(".water").removeClass("animate"), $("#cashHunt").hide() }), socket.on("CASHHUNT_TIME", s => { $(".timerCashHunt").html(s.time) }), socket.on("JACKPOT_BANK", s => { $(".bankGame").html(s.bank) }), socket.on("KENO_TIME", s => { $(".timeKeno").html(s.time) }), socket.on("KENO_CLEAR", s => { selectsKeno = [], $(".gameKeno").html(""), $(".keno__canvas-item .keno__canvas-number").show(), $(".keno__canvas-item .kenoBonus").hide(), $(".bankKeno").html(0), $(".usersKeno").html(0), $(".keno__mines").removeClass("keno__mines--win"), $(".keno__mines .keno__mines-win").hide(), undisable(".keno__cancel-select"), $(".keno__coeff-scroll").html(""), undisable(".keno__auto-select"), $(".keno__canvas-item").removeClass("blocked"), $(".keno__canvas-item").removeClass("keno__canvas-item--is-selected keno__canvas-item--is-revealed keno__canvas-item--has-hit") }), socket.on("KENO_SELECT", s => { $(".keno__canvas-item:eq(" + (s.item - 1) + ")").hasClass("keno__canvas-item--is-selected") ? $(".keno__canvas-item:eq(" + (s.item - 1) + ")").addClass("keno__canvas-item--has-hit") : $(".keno__canvas-item:eq(" + (s.item - 1) + ")").addClass("keno__canvas-item--is-revealed") }), socket.on("KENO_GET", s => { s.selectNumberKeno.forEach(async function (s, t, a) { $(".keno__canvas-item:eq(" + (s - 1) + ")").hasClass("keno__canvas-item--is-selected") ? $(".keno__canvas-item:eq(" + (s - 1) + ")").addClass("keno__canvas-item--has-hit") : $(".keno__canvas-item:eq(" + (s - 1) + ")").addClass("keno__canvas-item--is-revealed") }) }), socket.on("KENO_BONUS", s => { numberBonusKeno = s.bonusKeno.number, coeffBonusKeno = s.bonusKeno.coeff, $(".keno__canvas-item:eq(" + (numberBonusKeno - 1) + ") .keno__canvas-number").hide(), $(".keno__canvas-item:eq(" + (numberBonusKeno - 1) + ") .kenoBonus").show(), $(".keno__canvas-item:eq(" + (numberBonusKeno - 1) + ") .kenoBonus div p").html("x" + coeffBonusKeno) }), socket.on("laravel_database_updateKenoBank", s => { s = $.parseJSON(s), $(".bankKeno").html(Number(s.bank).toFixed(2)), $(".usersKeno").html(s.users), $(".gameKeno").prepend('
' + s.login + '
' + s.bet + '
' + s.numbers + '
' + Number(s.win).toFixed(2) + "
" + Number(s.win).toFixed(2) + "
") }), socket.on("laravel_database_kenoWin", s => { USER_ID == (s = $.parseJSON(s)).user_id && ($(".keno__mines").addClass("keno__mines--win"), $(".keno__mines .keno__mines-win").show(), $(".keno__mines .keno__mines-win b").html(Number(s.win).toFixed(0) + " Р")) }), kenoCoefs = [[5.92], [3.6, 9.6], [2.2, 5.3, 100], [1.5, 3.24, 20, 200], [1.1, 2.8, 7.5, 28, 780]], $("#darkTheme").click(function (s) { s.preventDefault(), localStorage.setItem("theme", "dark"), $("body").addClass("theme--dark"), $(this).hide(), $("#lightTheme").show() }), $("#lightTheme").click(function (s) { s.preventDefault(), localStorage.removeItem("theme"), $("body").removeClass("theme--dark"), $(this).hide(), $("#darkTheme").show() }); let countY = [0, 2], countX = [0, 1], updatedCountY = [0], updatedCountX = [0]; var bet_user = 0; function crashBet(s) { let t = { bet: Number($("#crashSum").val()), auto: Number($("#crashAuto").val()), _token: csrf_token }; $.post("/crash/bet", t).then(t => { t.success && (bet_user = 1, notification("success", t.success), balanceUpdate(t.lastbalance, t.newbalance), $("#btnCrash span").html("Ожидание игры..."), disable("#crashSum"), disable("#crashAuto")), t.error && (undisable(s), notification("error", t.error)) }) } function crashGive(s) { $.post("/crash/give", { _token: csrf_token }).then(t => { t.success && (bet_user = 0, notification("info", "We're taking...")), t.error && (undisable(s), notification("error", t.error)) }) } function startGameCoin(s) { $.post("/coin/bet", { _token: csrf_token, bet: $("#coinSum").val() }).then(t => { undisable(s), t.success ? (disable("#coinSum"), $("#playCoin").show(), $("#startCoin").hide(), $("#coinCoeff").html("x" + Number(0).toFixed(2)), $("#coinStep").html(0), $("#winCoin").html(Number(0 * $("#coinSum").val()).toFixed(2)), balanceUpdate(t.lastbalance, t.newbalance), notification("success", t.success), 1 == t.bonus && (notification("success", "Bonus game!"), $(".mines__bonus .x30__bonus-scroll").css({ transition: "0s", transform: "translateX(0px)" }), $(".mines__bonus .x30__bonus-scroll").html(""), $(".mines__bonus").show(), disable(".coinflip__place"), disable("#finishCoinBtn"), t.bonusCoin.forEach(s => { $(".mines__bonus .x30__bonus-scroll").append('
x' + s + "
") }), x = 2408 - Number($(".mines__bonus").width()) / 2 + rand(10, 40), betNew = (betNew = (betMine = Number($("#coinSum").val())) * t.coeffBonusCoin).toFixed(2), setTimeout(() => $(".mines__bonus .x30__bonus-scroll").css({ transition: "10s", transform: "translateX(-" + x + "px)" }), 200), setTimeout(() => $("#coinSum").val(betNew), 1e4), setTimeout(() => undisable(".coinflip__place"), 1e4), setTimeout(() => notification("success", "Congratulations! Your bet has been multiplied by" + t.coeffBonusCoin), 1e4), setTimeout(() => undisable("#finishCoinBtn"), 1e4))) : notification("error", t.mess) }).fail(t => { undisable(s), notification("error", JSON.parse(t.responseText).message) }) } function finishGameCoin(s) { $.post("/coin/finish", { _token: csrf_token }).then(t => { undisable(s), t.success ? (undisable("#coinSum"), $("#coinCoeff").html("x0.00"), $("#coinStep").html(0), $("#winCoin").html(Number(0).toFixed(2)), $("#playCoin").hide(), $("#startCoin").show(), balanceUpdate(t.lastbalance, t.newbalance), notification("success", t.success), $(".mines__bonus").hide(), betNew = (betNew = (betMine = Number($("#coinSum").val())) / t.coeffBonusCoin).toFixed(2), $("#coinSum").val(betNew)) : notification("error", t.mess) }).fail(t => { undisable(s), notification("error", JSON.parse(t.responseText).message) }) } function playCoinGame(s, t) { disable("#finishCoinBtn"), disable(".coinflip__place"), $(s).addClass("coinflip__place--active"), $.post("/coin/play", { _token: csrf_token, type: t }).then(t => { if (t.success) { if (3 == t.off) { notification("success", "Bonus game!"), $(".mines__bonus .x30__bonus-scroll").css({ transition: "0s", transform: "translateX(0px)" }), $(".mines__bonus .x30__bonus-scroll").html(""), $(".mines__bonus").show(), disable(".coinflip__place"), disable("#finishCoinBtn"), t.bonusCoin.forEach(s => { $(".mines__bonus .x30__bonus-scroll").append('
x' + s + "
") }), x = 2408 - Number($(".mines__bonus").width()) / 2 + rand(10, 40), betNew = (betNew = (betMine = Number($("#coinSum").val())) * t.coeffBonusCoin).toFixed(2), setTimeout(() => $(".mines__bonus .x30__bonus-scroll").css({ transition: "10s", transform: "translateX(-" + x + "px)" }), 200), setTimeout(() => $("#coinSum").val(betNew), 1e4), setTimeout(() => $("#winCoin").html(Number(t.win).toFixed(2)), 1e4), setTimeout(() => undisable(".coinflip__place"), 1e4), setTimeout(() => notification("success", "Congratulations! Your bet has been multiplied by" + t.coeffBonusCoin), 1e4), setTimeout(() => undisable("#finishCoinBtn"), 1e4), setTimeout(() => { undisable("#finishCoinBtn"), $(s).removeClass("coinflip__place--active") }, 1e4); return } $(".coinflip__wrapper").removeClass("animated flip_1 flip_2"), setTimeout(() => { $(".coinflip__wrapper").addClass("animated flip_" + t.type) }, 100), setTimeout(() => { undisable(s), undisable(".coinflip__place"), undisable("#finishCoinBtn"), $(s).removeClass("coinflip__place--active"), 1 == t.off ? ($("#coinCoeff").html("x0.00"), $("#coinStep").html(0), $("#winCoin").html(Number(0).toFixed(2)), $("#playCoin").hide(), $("#startCoin").show(), undisable("#coinSum"), $(".mines__bonus").hide(), betNew = (betNew = (betMine = Number($("#coinSum").val())) / t.coeffBonusCoin).toFixed(2), $("#coinSum").val(betNew)) : ($("#coinCoeff").html("x" + Number(t.coeff).toFixed(2)), $("#coinStep").html(t.step), $("#winCoin").html(Number(t.win).toFixed(2))) }, 1e3) } else undisable(s), undisable(".coinflip__place"), undisable("#finishCoinBtn"), $(s).removeClass("coinflip__place--active"), notification("error", t.mess) }).fail(t => { undisable(s), undisable(".coinflip__place"), undisable("#finishCoinBtn"), $(s).removeClass("coinflip__place--active"), notification("error", JSON.parse(t.responseText).message) }) } socket.on("laravel_database_crashBet", s => { s = $.parseJSON(s), $(".crash__history-users").prepend('
' + s.login + '
' + Number(s.bet).toFixed(2) + '
') }); var countSlots = 0, stopScroll = 0; $("body .slots_main").scroll(function () { if (1 == stopScroll) return 1; var s = $("body").height(), t = $("main").height(), a = $("body").scrollTop(); s + a >= t - 1e3 && (stopScroll = 1, loadSlots()) }); var selectSlotId = 0, slotsAll = []; function searchSlot() { $(".slot_games_content").removeClass("none"); let s = $("#search-slots").val().toLowerCase(); if ($(".slot_games_content").html(""), $(".item_select_provider").removeClass("active"), $(".block_text_slot_input").html("Выбор провайдера"), selectSlotId = 0, stopScroll = 0, countSlots = 0, console.log(s), 0 == s.length) return loadSlots("load"), !0; stopScroll = 1; let t = slotsAll.filter(function (t) { return t.title.toLowerCase().includes(s) }); t.forEach(s => { $(".slot_games_content").append("
" + s.title + "
Демо
") }), 0 == t.length && $(".slot_games_content").html('
По запросу ' + $("#search-slots").val() + " ничего не найдено.
").addClass("none") } function loadSlots(s = "load", t = 0) { $.post("/slots/getGames", { _token: csrf_token, type: s, countSlots, provider_id: t, type: s }).then(t => { t.slots.forEach(s => { $(".slot_games_content").append("
" + s.title + "
DEMO
") }), "load" == s && (0 == countSlots && (slotsAll = t.slots_all), stopScroll = 0 == t.slots.length ? 1 : 0, countSlots += 1e3) }).fail(s => { notification("error", JSON.parse(s.responseText).message) }) } function playSlot(s, t, a) { $.post("/slots/getUrl", { _token: csrf_token, id: s, type: t }).then(s => { $(".slot_game_panel").show(), $(".slots_main").hide(), $(".head_name_slot_game").html(s.title), $("#iframe_slot").attr("src", s.url), $(".header__user-b").hide(), $("#none_balance").show(), $(".demo_slot_button").hide(), "demo" == t && $(".demo_slot_button").show(), 1 == a && bigSlots() }).fail(s => { goHomeSlots(), notification("error", JSON.parse(s.responseText).message) }) } function slotProvider(s) { $(".slot_games_content").html(""), $(".slot_games_content").removeClass("none"), $("#searchSlot").val(""), stopScroll = 0, countSlots = 0, $(".provider").removeClass("active"); var t = $(s).attr("data-provider"); selectSlotId != t ? (stopScroll = 1, selectSlotId = t, loadSlots("provider", t), $(".block_text_slot_input").html(name), $(s).addClass("active")) : ($(".block_text_slot_input").html("Choosing a provider"), loadSlots("load"), selectSlotId = 0, $(s).removeClass("active")) } function toggleProviders() { $(".btnSlots").toggleClass("active").css({ pointerEvents: "none" }), $(".btnSlots").hasClass("active") ? $(".providersSlots").slideDown(250) : $(".providersSlots").slideUp(250), setTimeout(() => $(".btnSlots").css({ pointerEvents: "auto" }), 200) } function goToSlots(s, t) { if (0 == USER_ID) return notification("error", "Please log in"); 550 >= $("body").width() && 0 == bigSlotsType && bigSlots(), $(".slot_game_panel").show(), $(".slots_main").hide(), $(".header__user-b").hide(), $("#none_balance").show(), $(".head_name_slot_game").html(""), $(".demo_slot_button").hide(), playSlot(s, t); var a = window.location.href; history.pushState({}, "", a + "?game_id=" + s + "&type=" + t) } function goHomeSlots() { $("body").removeClass("big_slot"), bigSlotsType = 0; var s = window.location.href, t = s.substring(0, s.indexOf("?")); history.pushState({}, "", t), $(".slot_game_panel").hide(), $(".slots_main").show(), $("iframe").removeAttr("src"), $(".header__user-b").show(), $("#none_balance").hide() } function refreshSlots() { $("#iframe_slot").attr("src", function (s, t) { return t }) } var bigSlotsType = 0, noBigOriginalUrl = ""; function bigSlots() { if (1 == bigSlotsType) { bigSlotsType = 0; var s = noBigOriginalUrl; return history.pushState({}, "", s), $("body").removeClass("big_slot"), !0 } if (550 >= $("body").width()) { var t = window.location.href; noBigOriginalUrl = t; var s = t + "&big=1"; return history.pushState({}, "", s), $("body").addClass("big_slot"), bigSlotsType = 1, !0 } var a = document.getElementById("iframe_slot"); a.requestFullscreen ? a.requestFullscreen() : a.mozRequestFullScreen ? a.mozRequestFullScreen() : a.webkitRequestFullScreen ? a.webkitRequestFullScreen() : a.webkitFullscreenElement ? a.webkitFullscreenElement() : a.msFullscreenElement ? a.msFullscreenElement() : a.msRequestFullscreen ? a.msRequestFullscreen() : (a.documentElement, a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)) }