-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
83 lines (76 loc) · 3.15 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
<!DOCTYPE html>
<html>
<!--
Radio mission animation - by Andrew Healey
Displays an animation of three example 'radio waves' of different frequencies interacting with the ionosphere. The red wave is the lowest frequency, the green a bit higher, and the blue is the highest frequency.
MODES
There are multiple query parameters that can be modified:
iris - boolean value, defaults to false
oblique - boolean value, defaults to true
csloc - numeric value, defaults to 900 (pixels from the very left of the screen)
txangle - numeric value, multiple of PI that represents the location of the ionosondes - ex: 17/36 would place the transmitting antenna 1/36th pi to the right ofthe center of the screen, and the receiving 1/36th to the left.
-->
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Blair3sat - The Mission</title>
<style>
canvas {
position: absolute;
left: 0px;
top: 0px;
width: 500px;
height: 500px;
}
#headsup {
position: absolute;
left: 0px;
top: 0px;
border-color: black;
border-width: 2px;
border-style: none outset outset none;
padding: 10px;
background-color: #AAAAAA;
}
</style>
</head>
<body>
<div id="two" onclick="if(!two.paused){two.pause();two.paused=true;}else{two.play();two.paused=false;}"></div>
<script src="./two.js"></script>
<div id="headsup">
<a id="i">Iris: <span id="iris"></span>ctivated</a><br>
<a id="o">Mode: <span id="oblique"></span>static</a>
</div>
<script defer>
let urlParams = new URLSearchParams(window.location.search);
const OBLIQUE = urlParams.get('oblique') != 'false'; //If you want it to be oblique or not - false for monostatic
let txangle = Number(urlParams.get('txangle'));
const TXANGLE = ![NaN, 0].includes(txangle) ? txangle : Math.PI * 17 / 36; //Where the transmitting ionosonde transmits from
let csloc = Number(urlParams.get('csloc'));
const CSLOC = ![NaN, 0].includes(csloc) ? csloc : 900; //X position of CubeSat
const IRIS = urlParams.get('iris') == 'true'; //True if you want to show the iris in effect - the iris refracts the signal upward and doesn't reflect it downward
const I = document.getElementById('iris');
I.innerText = IRIS ? "A" : "Not a";
switchVal = (matched) => {
return {
"true": "false",
"false": "true"
}[matched];
}
function toggleParam(param, id, def) {
let init = window.location.href.replace(new RegExp(param + "=(true|false)", "g"), m => param + "=" + switchVal(m.replace(new RegExp(param + "=", "g"), "")));
if (!init.includes(param + "=")) init += "&" + param + "=" + !def;
init=init.replace(/\/&/g,"/?");
console.log(init);
document.getElementById(id).href = init;
}
document.getElementById('oblique').innerText = OBLIQUE ? "Bi" : "Mono";
toggleParam("oblique", "o", true);
document.getElementById('iris').innerText = IRIS ? "A" : "Not a";
toggleParam("iris", "i", false)
</script>
<script defer src="./oblique.js">
</script>
</body>
</html>