2021-02-27 05:39:40 +00:00
|
|
|
/*
|
|
|
|
Death of Internet Explorer Javascript program
|
|
|
|
http://swagg.net/
|
|
|
|
inspiration: https://www.w3schools.com/howto/howto_js_countdown.asp
|
|
|
|
|
|
|
|
Copyright 2020 Daniel Bowling <swaggboi@slackware.uk>
|
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
Redistribution and use of this script, with or without modification, is
|
|
|
|
permitted provided that the following conditions are met:
|
|
|
|
|
|
|
|
1. Redistributions of this script must retain the above copyright
|
|
|
|
notice, this list of conditions and the following disclaimer.
|
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
|
|
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
|
|
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
|
|
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
|
|
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
|
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Set the date we're counting down to
|
|
|
|
var countDownDate = new Date("Aug 17, 2021 00:00:00").getTime();
|
|
|
|
|
|
|
|
// Update the count down every 1 second
|
2021-02-28 07:04:39 +00:00
|
|
|
var x = setInterval(function () {
|
2021-02-27 05:39:40 +00:00
|
|
|
|
|
|
|
// Get today's date and time
|
|
|
|
var now = new Date().getTime();
|
|
|
|
|
|
|
|
// Find the distance between now and the count down date
|
|
|
|
var distance = countDownDate - now;
|
|
|
|
|
|
|
|
// Time calculations for days, hours, minutes and seconds
|
2021-02-28 07:04:39 +00:00
|
|
|
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
|
|
|
|
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
2021-02-27 05:39:40 +00:00
|
|
|
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
|
|
|
|
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
|
|
|
|
|
|
|
|
// Display the result in the element with id="dethKlok"
|
2021-02-28 07:04:39 +00:00
|
|
|
document.getElementById("dethKlok").innerHTML = days + "d " + hours + "h " +
|
|
|
|
minutes + "m " + seconds + "s ";
|
2021-02-27 05:39:40 +00:00
|
|
|
|
|
|
|
// If the count down is finished, write some text
|
|
|
|
if (distance < 0) {
|
|
|
|
clearInterval(x);
|
|
|
|
document.getElementById("dethKlok").innerHTML = "DONE. Rest in pieces";
|
|
|
|
}
|
|
|
|
}, 1000);
|