diff --git a/app.php b/app.php index bea131d..6dde5dd 100644 --- a/app.php +++ b/app.php @@ -92,9 +92,14 @@ header("Link: ; rel=preload; as=script", false); echo <<
-
- - $alertmsg +
+
+ + $alertmsg +
+
+
+
diff --git a/index.php b/index.php index 6160dbf..0cf82e3 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,4 @@ ; rel=preload; as=script", false);
diff --git a/lang/en_us.php b/lang/en_us.php index a4239ed..d79269c 100644 --- a/lang/en_us.php +++ b/lang/en_us.php @@ -30,6 +30,7 @@ define("STRINGS", [ "login server error" => "The login server returned an error: {arg}", "login server user data error" => "The login server refused to provide account information. Try again or contact technical support.", "captcha error" => "There was a problem with the CAPTCHA (robot test). Try again.", + "no access permission" => "You do not have permission to access this system.", "home" => "Home", "more" => "More", "punch in out" => "Punch In/Out", diff --git a/static/js/app.js b/static/js/app.js index 2955e94..019d61d 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -8,13 +8,59 @@ $(document).ready(function () { $(this).parent().fadeOut("slow"); }); - try { - window.history.replaceState("", "", getniceurl()); - if (window.location.hash) { - document.getElementById(window.location.hash.replace("#", "")).scrollIntoView(); - } - } catch (ex) { + if ($("#msg-alert-box").length) { + $("#msg-alert-box .progress").css("height", "3px"); + $("#msg-alert-box .progress").css("border-radius", "0px 0px .25rem .25rem"); + $("#msg-alert-box .progress-bar").css("transition", "width 0.25s linear"); + var msginteractiontick = 0; + var fifty = 10; + var gone = 20; + var msgticker = setInterval(function () { + if ($('#msg-alert-box .alert:hover').length) { + msginteractiontick = 0; + } else { + msginteractiontick++; + } + if (msginteractiontick > 0) { + function setBarWidth(offset) { + $("#msg-alert-timeout-bar").css("width", (msginteractiontick + offset) / gone * 100 + "%"); + } + setBarWidth(-1 + .25); + setTimeout(function () { + setBarWidth(-1 + .5); + }, 250); + setTimeout(function () { + setBarWidth(-1 + .75); + }, 500); + setTimeout(function () { + setBarWidth(0); + }, 750); + } else { + $("#msg-alert-timeout-bar").css("width", "0%"); + } + + if (msginteractiontick < fifty) { + $("#msg-alert-box .alert").css("opacity", "1"); + } + if (msginteractiontick == fifty) { + $("#msg-alert-box .alert").fadeTo(1000, 0.5); + } + if (msginteractiontick >= gone) { + setTimeout(function () { + if (msginteractiontick >= gone) { + $("#msg-alert-box .alert").fadeOut("slow"); + window.clearInterval(msgticker); + } + }, 1000); + } + }, 1000 * 1); + + $("#msg-alert-box").on("mouseenter", function () { + $("#msg-alert-box .alert").css("opacity", "1"); + msginteractiontick = 0; + console.log("👈😎👈 zoop"); + }); } }); @@ -32,4 +78,4 @@ try { window.history.replaceState("", "", getniceurl()); } catch (ex) { -} \ No newline at end of file +}