Artemis 1 Countdown

Artemis 1 Countdown

I've been following the Artemis 1 Launch Schedule quite closely on a few forums and discussing it with serveral people, and I had been regularly posting updated DateandTime countdown links for the revised launch attempts. With the schedule chnages and scrubs that have happened lately, updating the times was becoming tedious.

The first attempt to get functionality to the site

I then bought a new domain and created a basic website which does nothing but count down to the current scheduled (estimated) launch time.

The current iteration, with CSS magic

A friend of mine who's a whiz with CSS made the page look not terrible and made some SEO optimisations, resulting in the page you see here. Whenever NASA and the SLS team update the launch schedule, I will be updating the site to reflect any changes. This will allow the one link to always be up to date.

The page itself is entirely serverless, and uses some modified countdown code from the GeeksForGeeks website (How To Create A Countdown Timer Using JavaScript - GeeksforGeeks) originally written by Shubrodeep Banerjee.

The code was modified to better represent the data, include handling for Timezones and include leading zeros.

<script>
	const zeroPad = (num, places) => String(num).padStart(places, '0')

	var deadline = new Date("2022-10-17T08:00:00.000-04:00").getTime();

	const d = new Date();
	let localtz = "UTC " + d.getTimezoneOffset() / 60;
	let launchtz = "UTC +4";
		  
	var x = setInterval(function() {
		  
	var now = new Date().getTime();
	var t = deadline - now;
	var days    = Math.floor(t / (1000 * 60 * 60 * 24));
	var hours   = Math.floor((t % (1000 * 60 * 60 * 24))/(1000 * 60 * 60));
	var minutes = Math.floor((t % (1000 * 60 * 60)) / (1000 * 60));
	var seconds = Math.floor((t % (1000 * 60)) / 1000);
	document.getElementById("day").innerHTML =    zeroPad(days, 2);
	document.getElementById("hour").innerHTML =   zeroPad(hours, 2);
	document.getElementById("minute").innerHTML = zeroPad(minutes,2); 
	document.getElementById("second").innerHTML = zeroPad(seconds,2); 

	document.getElementById("mytz").innerHTML     = localtz ;
	document.getElementById("launchtz").innerHTML = launchtz ;

	if (t < 0) {
	        clearInterval(x);
	        document.getElementById("demo").innerHTML   = "LAUNCH!";
	        document.getElementById("day").innerHTML    = '0';
	        document.getElementById("hour").innerHTML   = '0';
	        document.getElementById("minute").innerHTML = '0' ; 
	        document.getElementById("second").innerHTML = '0'; }
	}, 1000);
</script>

As I get more free time I will add more functionality to the page, however currently it does have a link to the Space+ Livestream which is a nice and uncluttered YouTube livestream of the Artemis 1 platform.

The site can be accessed at https://artemiscountdown.net/. Enjoy.

If you have any suggestions for things to add to the page, please feel free to drop me a line at https://twitter.com/optoio