mirror of
https://github.com/FAUSheppy/open-web-leaderboard.git
synced 2025-12-06 15:11:35 +01:00
improve livegame display
This commit is contained in:
@@ -13,12 +13,16 @@
|
|||||||
<div id="playerDisplay" class="playerDisplay mb-3 mt-2">
|
<div id="playerDisplay" class="playerDisplay mb-3 mt-2">
|
||||||
<script>
|
<script>
|
||||||
function players(){
|
function players(){
|
||||||
|
//document.getElementById("playerDisplay").classList.remove("animate-flicker")
|
||||||
fetch("/players-online").then(
|
fetch("/players-online").then(
|
||||||
response => response.json()
|
response => response.json()
|
||||||
).then(
|
).then(
|
||||||
data => {
|
data => {
|
||||||
if(data["error"] == ""){
|
if(data["error"] == ""){
|
||||||
document.getElementById("playerDisplay").innerHTML = "Players Online: " + data["player_total"]
|
document.getElementById("playerDisplay").innerHTML = "Players Online: " + data["player_total"]
|
||||||
|
if(parseInt(data["player_total"]) == 0){
|
||||||
|
//document.getElementById("playerDisplay").classList.add("animate-flicker")
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
document.getElementById("playerDisplay").innerHTML = "Players Online: (error)" + data["error"]
|
document.getElementById("playerDisplay").innerHTML = "Players Online: (error)" + data["error"]
|
||||||
}
|
}
|
||||||
@@ -26,7 +30,7 @@
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
players()
|
players()
|
||||||
setInterval(players, 2000)
|
setInterval(players, 10000)
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
<table id="tableMain" class="table table-striped table-bordered table-sm"
|
<table id="tableMain" class="table table-striped table-bordered table-sm"
|
||||||
|
|||||||
Reference in New Issue
Block a user