-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalculator.html
181 lines (175 loc) · 10.6 KB
/
calculator.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./assets/css/accessible-autocomplete.min.css" />
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="./assets/css/style.css" />
<link rel="stylesheet" href="./assets/css/calculator.css" />
<title>Generation Ship Feasibility Calculator</title>
</head>
<body>
<header class="text-white text-center bg-black p-1">Generation Ship Feasibility Calculator</header>
<main class="flex flex-wrap min-w-screen min-h-screen">
<section class="bg-zinc-200 p-5 min-h-full w-full md:w-1/4">
<header class="text-2xl mb-5 font-semibold">Constraints</header>
<div class="justify-left">
<form id="countryForm">
<div class="mb-3">
<!-- accessible autocomplete widget from gov.uk -->
<label for="countryAutocomplete" class="form-label inline-block mb-2 text-gray-700">Select your country</label>
<div id="countryAutocomplete-container"></div>
</div>
<div class="mb-3">
<label for="exampleText0" class="form-label inline-block mb-2 text-gray-700"
>Space Budget (% of GDP)</label
>
<input
type="number"
class="form-control block w-full px-3 py-1.5 text-base font-normal text-gray-700 bg-white bg-clip-padding
border border-solid border-gray-300 rounded transition ease-in-out m-0
focus:text-gray-700 focus:bg-white focus:border-blue-600 focus:outline-none
"
id="percent"
min="0"
max="100"
placeholder="e.g., 13"
/>
</div>
<div class="mb-3">
<label for="exampleText0" class="form-label inline-block mb-2 text-gray-700"
>Time to Launch (years from now)</label>
<select id="ttl" class="form-control block w-full px-3 py-1.5 text-base font-normal text-gray-700 bg-white bg-clip-padding
border border-solid border-gray-300 rounded transition ease-in-out m-0
focus:text-gray-700 focus:bg-white focus:border-blue-600 focus:outline-none">
<option value="select-a-timeframe">Select a timeframe</option>
<option value="300">300</option>
<option value="200">200</option>
<option value="175">175</option>
<option value="150">150</option>
<option value="125">125</option>
<option value="100">100</option>
<option value="90">90</option>
<option value="80">80</option>
<option value="70">70</option>
<option value="60">60</option>
<option value="50">50</option>
<option value="40">40</option>
<option value="30">30</option>
<option value="20">20</option>
</select>
</div>
<div>
<button type="submit" id="searchBtn" data-mdb-ripple="true" data-mdb-ripple-color="light" class="inline-block mx-1 my-7 px-6 py-2.5 bg-purple-600 text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:bg-purple-700 hover:shadow-lg focus:bg-purple-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-purple-800 active:shadow-lg transition duration-150 ease-in-out">Find Candidates</button>
</div>
</form>
<form id="individualForm">
<div class="mb-3">
<!-- accessible autocomplete widget from gov.uk -->
<label for="personAutocomplete" class="form-label inline-block mb-2 text-gray-700">Select your name</label>
<div id="personAutocomplete-container"></div>
</div>
<div class="mb-3">
<label for="exampleText0" class="form-label inline-block mb-2 text-gray-700"
>Space Budget (% of personal wealth)</label
>
<input
type="number"
class="form-control block w-full px-3 py-1.5 text-base font-normal text-gray-700 bg-white bg-clip-padding
border border-solid border-gray-300 rounded transition ease-in-out m-0
focus:text-gray-700 focus:bg-white focus:border-blue-600 focus:outline-none
"
id="indivPercent"
min="0"
max="100"
placeholder="e.g., 13"
/>
</div>
<div class="mb-3">
<label for="exampleText0" class="form-label inline-block mb-2 text-gray-700"
>Time to Launch (years from now)</label>
<select id="indivTTL" class="form-control block w-full px-3 py-1.5 text-base font-normal text-gray-700 bg-white bg-clip-padding
border border-solid border-gray-300 rounded transition ease-in-out m-0
focus:text-gray-700 focus:bg-white focus:border-blue-600 focus:outline-none">
<option value="select-a-timeframe">Select a timeframe</option>
<option value="300">300</option>
<option value="200">200</option>
<option value="175">175</option>
<option value="150">150</option>
<option value="125">125</option>
<option value="100">100</option>
<option value="90">90</option>
<option value="80">80</option>
<option value="70">70</option>
<option value="60">60</option>
<option value="50">50</option>
<option value="40">40</option>
<option value="30">30</option>
<option value="20">20</option>
</select>
</div>
<div>
<button type="submit" id="indivSearchBtn" data-mdb-ripple="true" data-mdb-ripple-color="light" class="inline-block mx-1 my-7 px-6 py-2.5 bg-purple-600 text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:bg-purple-700 hover:shadow-lg focus:bg-purple-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-purple-800 active:shadow-lg transition duration-150 ease-in-out">Find Candidates</button>
</div>
</form>
<p id="validationMsg" class="text-red-700 mt-0 mb-4">Please complete all fields.</p>
<div>
<button type="button" id="loadFromLocal" class="inline-block px-6 py-2 border-2 border-purple-600 text-purple-600 font-medium text-xs leading-tight uppercase rounded hover:bg-black hover:bg-opacity-5 focus:outline-none focus:ring-0 transition duration-150 ease-in-out">Load previous data</button>
</div>
</section>
<div class="justify-left p-4 order-2 flex flex-col w-full md:w-3/4">
<div class="">
<div class="overflow-hidden">
<h2 class="font-semibold pt-5 font-bold text-2xl mb-2">Mission Details</h2>
<section id="missionSummary" class="rounded border border-slate-200 bg-white p-4">
<p>No details to display yet...</p>
</section>
<h2 class="font-semibold pt-5 font-bold text-2xl mb-2 ">Candidate Planets</h2>
<div class="overflow-x-auto">
<table class="min-w-full">
<thead class="border-b">
<tr class="odd:bg-white even:bg-slate-50">
<th scope="col" class="text-md font-bold text-gray-900 px-6 py-4 text-left">
Name
</th>
<th scope="col" class="text-md font-bold text-gray-900 px-6 py-4 text-left">
Distance
<p class="font-medium text-gray-800">Lightyears</p>
</th>
<th scope="col" class="text-md font-bold text-gray-900 px-6 py-4 text-left">
Years to arrival
</th>
<th scope="col" class="text-md font-bold text-gray-900 px-6 py-4 text-left">
Cost
<p class="font-medium text-gray-800">USD (Tn)</p>
</th>
<th scope="col" class="text-md font-bold text-gray-900 px-6 py-4 text-left">
Population
<p class="font-medium text-gray-800">(recommended)</p>
</th>
<th scope="col" class="text-md font-bold text-gray-900 px-6 py-4 text-left">
Feasible?
</th>
</tr>
</thead>
<tbody id="planetTable">
<!--Planets go here-->
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>
<footer class="text-white text-center bg-black p-1">Made by Team 🚀, blasting off at a tiny fraction of the speed of light</footer>
<!-- autocomplete widget -->
<script src="./assets/js/accessible-autocomplete.min.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<!--<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.27.0/moment.min.js"></script>-->
<!--NASA exoplanets URL suddenly went all CORS errory on me. Storing the data locally.-->
<script type="text/javascript" src="assets/js/planets.json"></script>
<script src="./assets/js/calculator.js"></script>
</body>
</html>