From 1237b5d621b50a1728c39544b0977706ec608350 Mon Sep 17 00:00:00 2001 From: Xiexe Date: Fri, 2 Oct 2020 21:12:09 -0400 Subject: [PATCH] add dc --- assets/css/styles.css | 6 +++++- assets/js/audiohandler.js | 42 ++++++++++++++++++++++++++------------- index.html | 18 ++++++++++++++--- 3 files changed, 48 insertions(+), 18 deletions(-) diff --git a/assets/css/styles.css b/assets/css/styles.css index 76e771f..c910674 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -30,6 +30,10 @@ html, body { width: 720px; } +#queue { + +} + #queueTextContainer { position: fixed; margin-bottom: 50px; @@ -81,7 +85,7 @@ html, body { font-size: 22px; text-align: center; color: #ffc700; - text-shadow: 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 3px #000; + text-shadow: 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 3px #000, 10px 10px 2px #0000; } .button { diff --git a/assets/js/audiohandler.js b/assets/js/audiohandler.js index 90c4cad..ea41d26 100644 --- a/assets/js/audiohandler.js +++ b/assets/js/audiohandler.js @@ -46,16 +46,8 @@ function determineIfDisconnect() if(!disconnected) { var rand = Math.random(); - - if(rand > 0.2) - { - if(rand < 0.75) - getPositionInQueue(); - } - else - { - doDisconnect(); - } + if(rand < 0.75) + getPositionInQueue(); } } @@ -72,10 +64,11 @@ function getPositionInQueue() number = Math.floor(queuePos - (Math.random() * Math.floor(15))); queuePos = number; - if(queuePos < 1) + if(queuePos < 3) { number = 0; queuePos = 0; + doDisconnect(); } } @@ -91,8 +84,11 @@ function getEstimatedTime(qPos) function doDisconnect() { - // disconnected = true; - // console.log("DC'd") + hideQueue(); + showDisconnect(); + + disconnected = true; + console.log("DC'd") } function manualChangeExpac() @@ -178,11 +174,29 @@ function playButtonAudio(index) { buttonAudio.pause(); buttonAudio.time = 0; - + if(index === 0) buttonAudio.src = './assets/audio/ui/button_click.ogg'; else buttonAudio.src = './assets/audio/ui/button_click_big.ogg'; buttonAudio.play(); +} + +function hideQueue() +{ + var x = document.getElementById("queue"); + if(x.style.display === "none") + x.style.display = "flex"; + else + x.style.display = "none"; +} + +function showDisconnect() +{ + var x = document.getElementById("disconnectBox"); + if(x.style.display === "none") + x.style.display = "flex"; + else + x.style.display = "none"; } \ No newline at end of file diff --git a/index.html b/index.html index 182e67e..0268f66 100644 --- a/index.html +++ b/index.html @@ -13,11 +13,11 @@
- +
-
+
@@ -26,7 +26,19 @@

Estimated time: 999 min

- + +
+ + +