Calculator Tools Calculator Tools
Create

Space Launch Countdown Timer App

Nov 5, 2023

About this app

Real-time countdown timer for upcoming space launches with detailed launch information, live stream integration, notification alerts, and historical launches.

Space Launch Countdown Timer App Watch Live Stream 🚀

Related apps

Put this on your site

Source

                    <html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">

<title>Space Launch Countdown Timer App</title>
<meta name="description" content="Real-time countdown timer for upcoming space launches with detailed launch information, live stream integration, notification alerts, and historical launches.">
<meta name="keywords" content="space, launch, countdown, timer, app">

<link href="https://fonts.googleapis.com/css2?family=Orbitron&display=swap" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

<script type="text/javascript">
try {
var launchData = {
name: 'Starlink 1-5',
date: new Date('2022-12-31T00:00:00Z'),
site: 'Cape Canaveral, FL',
description: 'The fifth batch of Starlink satellites launched by SpaceX.',
streamLink: 'https://www.youtube.com/watch?v=123456789'
};

function countdown() {
var now = new Date();
var distance = launchData.date - now;

var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);

document.getElementById('countdown').innerHTML = days + 'd ' + hours + 'h ' + minutes + 'm ' + seconds + 's ';
}

document.addEventListener("DOMContentLoaded", function() {
setInterval(countdown, 1000);

document.getElementById('launchName').innerText = launchData.name;
document.getElementById('launchDate').innerText = launchData.date;
document.getElementById('launchSite').innerText = launchData.site;
document.getElementById('launchDescription').innerText = launchData.description;

document.getElementById('streamLink').setAttribute('href', launchData.streamLink);
});

} catch (error) {
throw error;
}
</script>

<style>
body {
font-family: 'Orbitron', sans-serif;
background: linear-gradient(to right, #141E30, #243B55);
color: #FFF;
}
#countdown {
font-size: 3em;
text-align: center;
margin-top: 20%;
}
.launch-info {
margin-top: 3em;
text-align: center;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<div id="countdown"></div>
<div class="launch-info">
<h2 id="launchName"></h2>
<p id="launchDate"></p>
<p id="launchSite"></p>
<p id="launchDescription"></p>
<a id="streamLink" href="#" target="_blank">Watch Live Stream 🚀</a>
</div>
</div>
</body>
</html>