Fixed splashscreen and changed the way results are handled by front and back

This commit is contained in:
Laurent
2024-10-29 22:54:00 +01:00
parent 8be7b82db6
commit a19533a20f
13 changed files with 104 additions and 38 deletions

View File

@@ -12,9 +12,7 @@
async function roll() {
toggleLoading();
result = Math.floor(Math.random() * (range + 1));
result = getRandomNumber();
await new Promise(r => setTimeout(r, 3000));
toggleLoading();
@@ -23,6 +21,12 @@
await scoreStore.add(playerName, result)
}
function getRandomNumber(){
let unit = Math.floor(Math.random() * (range + 1));
let dec = Math.floor(Math.random() * (range));
return unit + (dec/100);
}
function toggleLoading(){
window.$(".loader").toggleClass("disabled");
window.$(".player").toggleClass("disabled");
@@ -70,6 +74,7 @@
.name
{
min-width: 210px;
width: 22vmax;
height: 5vh;
background-color: #fcdcab;
@@ -99,6 +104,10 @@
transform: scale(1.1);
}
.name::placeholder
{
}
@keyframes rotate {
to{transform: rotate(360deg)}
}