-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
163 lines (147 loc) · 6.38 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html data-bs-theme="dark">
<head>
<title>RF's Mars Clock</title>
<link rel="icon" type="image/x-icon" href="https://i0.wp.com/exomars.wales/wp-content/uploads/2018/06/exomars-wales-logo-250.png?fit=220%2C250&ssl=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<script src="dateTime.js"></script>
<script src="colourmode.js"></script>
<script>
var dayFormatYMD = true;
var currentLang = "En";
var langChange = true; // make it run once
var launchString = "", landingString = "";
var titletext = "", utctag = "", mtctag = "";
var launchYmd = "", landingYmd = "", launchD = "", landingD = "";
// nominal dates, backup EMM LW 8-28 Dec 28, land 15 Jul - 16 Aug 30
const launchwindowopen = new Date(2028, 09, 21);
const launchwindowclose = new Date(2028, 09, 05);
const landing = new Date(2030, 11, 16); // window opens; closes 19 Dec 2030
var daysUntilLaunch = 0, daysUntilLaunchClose = 0, daysUntilLanding = 0;
function startTime() {
const today = new Date();
const ut = new Date(0);
let h = today.getHours();
let m = today.getMinutes();
let s = today.getSeconds();
m = checkTime(m);
s = checkTime(s);
/// update times
daysUntilLaunch = Math.floor((Date.UTC(launchwindowopen.getFullYear(), launchwindowopen.getMonth(), launchwindowopen.getDate()) - Date.UTC(today.getFullYear(), today.getMonth(), today.getDate())) / (1000 * 3600 * 24));
daysUntilLaunchClose = Math.floor((Date.UTC(launchwindowclose.getFullYear(), launchwindowclose.getMonth(), launchwindowclose.getDate()) - Date.UTC(today.getFullYear(), today.getMonth(), today.getDate())) / (1000 * 3600 * 24));
daysUntilLanding = Math.floor((Date.UTC(landing.getFullYear(), landing.getMonth(), landing.getDate()) - Date.UTC(today.getFullYear(), today.getMonth(), today.getDate())) / (1000 * 3600 * 24));
dateTimeCalcs();
// update the visible text
if(langChange){
setStrings(currentLang);
langChange = false;
}
// update strings
document.getElementById('title').innerHTML = titletext;
document.getElementById('utcCap').innerHTML = utctag;
document.getElementById('mtcCap').innerHTML = mtctag;
if(dayFormatYMD){
document.getElementById('landing').innerHTML = landingYmd;
document.getElementById('launch').innerHTML = launchYmd;
} else {
document.getElementById('landing').innerHTML = landingD;
document.getElementById('launch').innerHTML = launchD;
}
// non-lang specific
document.getElementById('earthUTC').innerHTML = h + ":" + m + ":" + s;
document.getElementById('marsCT').innerHTML = h_to_hms(mstPM);
document.getElementById('ltstOP').innerHTML = h_to_hms(within_24(ltst));
// make time tick
setTimeout(startTime, 1000);
}
function toggleDateFormatting(){
dayFormatYMD = !dayFormatYMD;
}
</script>
<script src="lang.js"></script>
</head>
<body class="d-flex h-100 text-center" onload="startTime()">
<div class="cover-container d-flex w-100 h-100 p-3 mx-auto flex-column">
<div class="container-fluid">
<div class="hstack gap-3">
<div class="p-2">
<a href="./debug/">
<button type="button" class="btn btn-secondary">
<i class="bi bi-bug-fill"></i>
</button>
</a>
</div>
<div class="vr"></div>
<div class="p-2">
<button type="button" class="btn btn-secondary" data-bs-theme-value="light">
<i class="bi bi-sun-fill"></i>
</button>
<button type="button" class="btn btn-secondary" data-bs-theme-value="dark">
<i class="bi bi-moon-stars-fill"></i>
</button>
</div>
<div class="vr"></div>
<div class="p-2">
<button type="button" class="btn btn-secondary" onclick="toggleDateFormatting()">
<i class="bi bi-123"></i>
</button>
</div>
<div class="p-2">
<button type="button" class="btn btn-secondary" onclick="currentLang = toggleLang(currentLang); langChange = true;">
<i class="bi bi-chat-square-quote-fill"></i>
</button>
</div>
</div>
<header class="mb-auto">
<div style="padding:50px">
<h1 id="title" class="display-1 float-md-mid mb-0"></h1>
<h2 id="launch"></h2>
</div>
</header>
<main class="px-3">
<div class="row">
<div class="col">
<figure>
<blockquote class="blockquote">
<h1 id="earthUTC">00:00:00</h1>
</blockquote>
<figcaption id="utcCap" class="blockquote-footer">
</figcaption>
</figure>
</div>
<div class="col">
<figure>
<blockquote class="blockquote">
<h1 id="marsCT">00:00:00</h1>
</blockquote>
<figcaption id="mtcCap" class="blockquote-footer">
</figcaption>
</figure>
</div>
<div class="col">
<figure>
<blockquote class="blockquote">
<h1 id="ltstOP">00:00:00</h1>
</blockquote>
<figcaption class="blockquote-footer">
LTST Oxia Planum
</figcaption>
</figure>
</div>
<div class="row">
<h2 id="landing" style="padding:50px"></h2>
</div>
</div>
</main>
<footer class="mt-auto">
<p>
<a href="https://exomars.wales">
<img src="https://i0.wp.com/exomars.wales/wp-content/uploads/2018/06/exomars-wales-logo-250.png?fit=220%2C250&ssl=1" alt="PanCam Calibration Target logo links to exomars.wales" style="width:50px;">
</a>
</p>
</footer>
</div>
</body>
</html>