Merge branch 'main' into DevelopMadara

This commit is contained in:
Hepatica
2024-02-17 15:56:05 +01:00
17 changed files with 1283 additions and 237 deletions

View File

@@ -7,7 +7,7 @@
<div class="menu__btns--gamemodes">
<div class="menu__content--gamemodes">
<a href="#"><img class="menu__content--slots-icon" src="../assets/icons-menu/slots-icon.svg"></a>
<a href="#"><img class="menu__content--cruch-icon" src="../assets/icons-menu/crush-icon.svg"></a>
<a href="#" @click="$router.push({ name: 'crash' })"><img class="menu__content--cruch-icon" src="../assets/icons-menu/crush-icon.svg"></a>
<a href="#"><img src="../assets/icons-menu/case-icon.png"></a>
<a href="#" @click="$router.push({ name: 'saper' })"><img class="menu__content--bomb-icon" src="../assets/icons-menu/bomb-icon.svg"></a>
</div>

View File

@@ -19,11 +19,11 @@
<input :class="{ 'animate-start-btn' : errorDeposit }" class="deposit-amount__input" v-model="amount" type="number" />
<div class="deposit-btns">
<ul class="display-btns btns-style-diamonds">
<li v-for="number in PaymentsModalNumbers" :key="number">
<li v-for="(number, index) in PaymentsModalNumbers" :key="index">
<button
@click="clickedBtnChoice(number, number.diamonds)"
@click="clickedBtnChoice(index, number.diamonds)"
:class="{
'btn-click': clickedBtn === number,
'btn-click': clickedBtn === index,
[number]: clickedBtn === number,
}"
>
@@ -132,7 +132,6 @@ export default {
amount: 0,
amountWithdraw: 0,
balance: 0,
amountSave: 1,
card: '',
promocode: '',
promocodeBase: ['ANTI-GRIF'],
@@ -145,8 +144,6 @@ export default {
captchaToken: null,
clickedBtn: "",
url: "",
offBtn: true,
offAgree: true,
completeValidtaion: {
amountsaving: true,
cardsaving: false,
@@ -174,44 +171,36 @@ export default {
}
},
watch: {
// amount(newAmount) {
// this.offBtn = true;
// if (this.amount > 0 && this.amount !== "") {
// setTimeout(() => {
// try {
// GettingMoneyOperation(newAmount).then((response) => {
// console.log("Payments Modal Working!: ", response);
// this.url = response;
// this.offBtn = false;
// });
// } catch (e) {
// console.error("Error in PaymentModal!", e);
// }
// }, 2000);
// }
// },
// amountWithdraw(newAmount) {
// this.completeValidtaion.amountsaving = false
// if (newAmount > 0) {
// this.amountSave = newAmount
// this.completeValidtaion.amountsaving = true
// console.log(this.completeValidtaion)
// }
// },
// card(newAmount) {
// this.completeValidtaion.cardsaving = false
// const cardPattern = /^\d{5}$/;
// if(cardPattern.test(newAmount)) {
// this.offAgree = false
// this.completeValidtaion.cardsaving = true
// }
// },
// agreeUser(newAgree) {
// this.completeValidtaion.agreesaving = false
// if (newAgree !== false) {
// this.completeValidtaion.agreesaving = true
// }
// },
amount(DepositCount) {
console.log(DepositCount)
if (![1, 5, 10, 50, 100, 1000].includes(DepositCount)) {
this.clickedBtn = null
}
else {
let index
switch (DepositCount) {
case 1:
index = 0
break
case 5:
index = 1
break
case 10:
index = 2
break
case 50:
index = 3
break
case 100:
index = 4
break
case 1000:
index = 5
break
}
this.clickedBtnChoice(index, DepositCount)
}
},
completeValidtaion: {
handler() {
this.completeValidationCheck()
@@ -219,11 +208,6 @@ export default {
deep: true
}
},
computed: {
checkOffBtn() {
return this.checkBtn();
},
},
methods: {
closeModal() {
return this.$emit("closemodal");
@@ -279,17 +263,6 @@ export default {
}
},
async RedirectedMethodTransferMoneyToSp() {
// setTimeout(async () => {
// try {
// WithdrawMoneyOperation(this.amountSave, this.card.toString(), this.captchaToken).then((response) => {
// console.log(`work withdraw - ${response}`)
// })
// }
// catch (e) {
// console.error(`Error in wihdrawmoney operation - ${e}`)
// }
// await this.$emit('notifacetionmoney')
// }, 4000)
this.v$.$touch()
if (this.v$.amountWithdraw.$error) {
@@ -334,17 +307,10 @@ export default {
})
}
},
// checkBtn() {
// if (this.offBtn === false) {
// if (this.agreeUser !== false) {
// return false;
// }
// }
// return true;
// },
clickedBtnChoice(index, content) {
this.clickedBtn = index;
this.amount = content;
console.log(index)
},
},
};

View File

@@ -0,0 +1,132 @@
<template>
<div class="time" v-if="crashdata.Status === 'WaitingForPlayers'"><h2>{{ crashdata.WaitingTime ? crashdata.WaitingTime.toFixed(1) : '' }} сек.</h2></div>
<LineChart
:chart-data="data"
:options="options"
v-else
/>
<h2 class="ratio" :class="{ 'lost-ratio' : crashdata.Status === 'GameEnd' }">{{ crashdata.CurrentX ? crashdata.CurrentX.toFixed(2) : '' }}x</h2>
</template>
<script>
import { LineChart } from "vue-chart-3";
import {
Chart,
LineController,
CategoryScale,
LinearScale,
PointElement,
LineElement,
} from "chart.js";
Chart.register(
LineController,
CategoryScale,
LinearScale,
PointElement,
LineElement
);
export default {
components: { LineChart },
props: {
crashdata: Object
},
mounted() {
this.data = this.chartData;
this.updateData();
},
data() {
return {
dataValues: [],
numberGraph: 1,
labels: [" "],
data: null,
options: {
plugins: {
title: {
text: "Line",
},
},
scales: {
x: {
grid: {
display: false
}
},
y: {
grid: {
display: false
}
}
},
animation: false,
},
};
},
computed: {
chartData() {
return {
labels: this.labels,
datasets: [
{
label: "Foo",
data: this.dataValues,
borderColor: '#4E5EF2',
pointStyle: "circle",
pointRadius: 0,
pointHoverRadius: 2,
},
],
};
},
},
watch: {
crashdata: {
handler: 'updateData',
immediate: true
}
},
methods: {
updateData() {
let nextDataValue
if (this.crashdata.Status === 'WaitingForPlayers') {
this.data = this.chartData;
this.labels = [""];
this.dataValues = [this.numberGraph, this.numberGraph];
}
else if (this.crashdata.Status === 'InGame') {
if (this.dataValues.length === 0) {
this.dataValues = [this.crashdata.CurrentX, this.crashdata.CurrentX]
nextDataValue = this.crashdata.CurrentX
this.numberGraph = this.crashdata.CurrentX
this.data = this.chartData
this.labels.push("")
this.dataValues.push(nextDataValue)
}
this.numberGraph = this.numberGraph + .01
nextDataValue = this.numberGraph
this.data = this.chartData;
this.labels.push("");
this.dataValues.push(nextDataValue);
}
else if (this.crashdata.Status === 'GameEnd') {
this.dataValues = []
this.numberGraph = 1
}
else {
console.log('Error game')
}
},
},
};
</script>
<style>
</style>