Add jackpot

This commit is contained in:
Hepatica
2024-02-19 21:49:15 +01:00
parent 30836abf01
commit 0d3ae3147c
6 changed files with 229 additions and 21 deletions

View File

@@ -17,6 +17,9 @@
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@700&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@700&display=swap" rel="stylesheet">
<!-- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> -->
<link rel="stylesheet" href="dist/css/bootstrap-grid.min.css" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/gh/dmhendricks/bootstrap-grid-css@4.1.3/dist/css/bootstrap-grid.min.css" />
<title>LuckyDiamond</title> <title>LuckyDiamond</title>
</head> </head>
@@ -35,5 +38,5 @@
<script src="https://cdn.jsdelivr.net/npm/vue-demi"></script> <script src="https://cdn.jsdelivr.net/npm/vue-demi"></script>
<script src="https://cdn.jsdelivr.net/npm/@vuelidate/core"></script> <script src="https://cdn.jsdelivr.net/npm/@vuelidate/core"></script>
<script src="https://cdn.jsdelivr.net/npm/@vuelidate/validators"></script> <script src="https://cdn.jsdelivr.net/npm/@vuelidate/validators"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</html> </html>

View File

@@ -0,0 +1,43 @@
.jackpot-start {
z-index: 1;
/* margin-left: 5%; */
border-radius: 20px;
background: #22252F;
box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
width: 42vh;
/* height: 480px; */
height: 32vh;
/* margin-top: 2.6%; */
}
.jackpot-start__content p {
color: #FFFFFF84;
font-weight: 700;
line-height: 31px;
text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
font-family: Montserrat Alternates;
font-size: 13px;
}
.padding-elements-jackpot {
padding-left: 5%;
padding-right: 5%;
}
.jackpot-start__btns {
margin-top: 5%;
display: flex;
flex-direction: column;
}
.jackpot-start__btns button {
width: 100%;
padding: 12px;
margin-bottom: 5px;
border: none;
color: #FFF;
font-weight: 700;
line-height: 19px;
font-style: normal;
font-family: Inter;
font-size: 16px;
}

View File

@@ -257,6 +257,29 @@ button {
} }
.bg-gradient-left {
background: #293561;
filter: blur(120px);
position: absolute;
top: 250px;
transform: rotate(180deg);
left: 200px;
width: 40%;
height: 55%;
z-index: 0;
}
.bg-two-gradient-right {
background: #293561;
filter: blur(120px);
position: absolute;
top: 220px;
transform: rotate(330deg);
left: 600px;
width: 60%;
height: 35%;
z-index: 0;
}
/* /Crash */ /* /Crash */
/* Media */ /* Media */

View File

@@ -11,7 +11,13 @@
<ul> <ul>
<transition-group name="fade"> <transition-group name="fade">
<li v-for="msg in array" :key="msg"> <li v-for="msg in array" :key="msg">
<div class="card__user" :class="{ 'mention-message': isCurrentUser(msg), 'system-message' : msg.username === '🛠️ System' }"> <div
class="card__user"
:class="{
'mention-message': isCurrentUser(msg),
'system-message': msg.username === '🛠️ System',
}"
>
<div class="user__icon"> <div class="user__icon">
<img :src="msg.icon" /> <img :src="msg.icon" />
</div> </div>
@@ -55,7 +61,7 @@ export default {
}); });
}, },
isCurrentUser(msg) { isCurrentUser(msg) {
return msg.msg.includes(GetCookie('SpUserName')) return msg.msg.includes(GetCookie("SpUserName"));
}, },
ClaimDatamsg(msg) { ClaimDatamsg(msg) {
const now = Date.now(); const now = Date.now();
@@ -82,8 +88,8 @@ export default {
icon: imageUrl, icon: imageUrl,
}; };
if (MsgUser.username === '🛠️ System') { if (MsgUser.username === "🛠️ System") {
MsgUser.icon = 'https://avatar.spworlds.ru/face/55/CONSOLE' MsgUser.icon = "https://avatar.spworlds.ru/face/55/CONSOLE";
} }
this.array.push(MsgUser); this.array.push(MsgUser);
@@ -98,7 +104,8 @@ export default {
GetChatHistory().then((response) => { GetChatHistory().then((response) => {
if (response && response.length) { if (response && response.length) {
response.forEach((element) => { response.forEach((element) => {
let imageUrl = "https://avatar.spworlds.ru/face/55/" + element.userName; let imageUrl =
"https://avatar.spworlds.ru/face/55/" + element.userName;
const MsgUser = { const MsgUser = {
id: this.id + 1, id: this.id + 1,
@@ -107,8 +114,8 @@ export default {
icon: imageUrl, icon: imageUrl,
}; };
if (MsgUser.username === '🛠️ System') { if (MsgUser.username === "🛠️ System") {
MsgUser.icon = 'https://avatar.spworlds.ru/face/55/CONSOLE' MsgUser.icon = "https://avatar.spworlds.ru/face/55/CONSOLE";
} }
this.array.push(MsgUser); this.array.push(MsgUser);

View File

@@ -0,0 +1,20 @@
export default [
{
diamonds: 1,
},
{
diamonds: 5,
},
{
diamonds: 10,
},
{
diamonds: 50,
},
{
diamonds: 100,
},
{
diamonds: 'max',
}
]

View File

@@ -1,22 +1,83 @@
<template> <template>
<div class="content-grid--jackpot" > <div class="content-grid--jackpot">
<aside-bar-component></aside-bar-component> <aside-bar-component></aside-bar-component>
<chat-component></chat-component> <chat-component></chat-component>
<header-component></header-component> <header-component></header-component>
<!-- <div class="grid-crash"> --> <div class="bg-gradient-left"></div>
<!-- <div class="grid-crash"> <!-- <div class="bootstrap-wrapper">
<h1>Test</h1> <div class="container">
<div class="row hidden-sm-down">
<div class="col-md-1">.</div>
<div class="col-md-1">.col-</div>
<div class="col-md-1">.col-</div>
<div class="col-md-1">.col-</div>
<div class="col-md-1">.col-</div>
<div class="col-md-1">.col-</div>
<div class="col-md-1">.col-</div>
<div class="col-md-1">.col-</div>
<div class="col-md-1">.col-</div>
<div class="col-md-1">.col-</div>
<div class="col-md-1">.col-</div>
<div class="col-md-1">.col-</div>
<div class="col-md-1">.col-</div>
</div>
</div>
</div> --> </div> -->
<!-- <section class="crash-game"> -->
<div class="jackpot-start">
<div class="jackpot-start__content title-saper padding-elements-jackpot">
<h2>Джекпот</h2>
<p>Больше ставь, больше побеждай!</p>
<div class="saper-start__choises diamonds diamonds-input__margin">
<h3>Сумма депозита</h3>
<div class="diamonds__choises">
<img class="diamond-icon" src="@/assets/icons-games/saper-game/icon-diamond-ore-saper.png">
<input v-model="amountDeposit" type="number" id="diamonds-input">
<div class="diamonds__btns btn-style__diamonds">
<ul class="diamonds-btns__display">
<li v-for="(item, index) in JackpotNumbers" :key="index">
<button @click="clickedBtnChoice(index, item.diamonds)" :class="{ 'btn-click': clickedBtn === index, [index]: clickedBtn === index }" :id="item.diamonds === 'max' ? 'max-button' : null" v-if="item.diamonds !== undefined">{{ item.diamonds }}</button>
</li>
</ul>
</div>
</div>
</div> </div>
<div class="jackpot-start__btns">
<div class="error-block" v-if="ErrorClick">
<h2>Ошибка при заполнении</h2>
</div>
<button class="btn-start" :class="{ 'animate-start-btn' : ErrorClick }" @click="clickPlayButton">Начать игру</button>
<!-- <button class="btn-claim" v-if="winningAmount === 0">Забрать {{ winningAmount }} АР</button>
<button class="btn-claim" @click="claimWinningAmount()" v-else>Забрать {{ winningAmount.toFixed(2) }} АР</button> -->
</div>
</div>
</div>
<h1>gfdgfd</h1>
<!-- </section> -->
<!-- <div class="crash-content"> -->
<!-- </div> -->
<!-- <section class="jackpot">
</section> -->
</div>
</template> </template>
<script> <script>
import HeaderComponent from "@/components/HeaderComponent.vue"; import HeaderComponent from "@/components/HeaderComponent.vue";
import AsideBarComponent from "@/components/AsidebarComponent.vue"; import AsideBarComponent from "@/components/AsidebarComponent.vue";
import ChatComponent from "@/components/ChatComponent.vue"; import ChatComponent from "@/components/ChatComponent.vue";
import {GetCookie} from "@/assets/js/storage/CookieStorage"; import { GetCookie } from "@/assets/js/storage/CookieStorage";
import {GetCurrentMoney} from "@/assets/js/rest/RestMethods"; import { GetCurrentMoney } from "@/assets/js/rest/RestMethods";
import "@/assets/css/PagesStyles/games-pages/jackpot.css";
import "@/assets/css/global.css";
import JackpotNumbers from "@/mocks/JackpotNumbers";
// import '@/assets/css/PagesStyles/games-pages/jackpot.css' // import '@/assets/css/PagesStyles/games-pages/jackpot.css'
@@ -24,12 +85,12 @@ export default {
components: { HeaderComponent, AsideBarComponent, ChatComponent }, components: { HeaderComponent, AsideBarComponent, ChatComponent },
data() { data() {
return { return {
// SaperNumbers, JackpotNumbers,
// clickedBtn: null, // clickedBtn: null,
// ErrorClick: false, // ErrorClick: false,
// ErrorJoin: false, // ErrorJoin: false,
// balance: 0, // balance: 0,
// amountDeposit: 0, amountDeposit: 0,
// crashObject: '', // crashObject: '',
// textError: '', // textError: '',
// startGame: false, // startGame: false,
@@ -37,6 +98,57 @@ export default {
}; };
}, },
watch: {
amountDeposit(DepositCount) {
if (![1, 5, 10, 50, 100, parseInt(this.balance)].includes(DepositCount)) {
this.clickedBtn = null;
} else {
let index;
switch (DepositCount) {
case 1:
if (parseInt(this.balance) === DepositCount) {
index = 5;
} else {
index = 0;
}
break;
case 5:
if (parseInt(this.balance) === DepositCount) {
index = 5;
} else {
index = 1;
}
break;
case 10:
if (parseInt(this.balance) === DepositCount) {
index = 5;
} else {
index = 2;
}
break;
case 50:
if (parseInt(this.balance) === DepositCount) {
index = 5;
} else {
index = 3;
}
break;
case 100:
if (parseInt(this.balance) === DepositCount) {
index = 5;
} else {
index = 4;
}
break;
case parseInt(this.balance):
index = 5;
break;
}
this.clickedBtnChoice(index, DepositCount);
}
},
},
async created() { async created() {
if (GetCookie("AUTHTOKEN") && GetCookie("SearchToken")) { if (GetCookie("AUTHTOKEN") && GetCookie("SearchToken")) {
await GetCurrentMoney( await GetCurrentMoney(