-
Notifications
You must be signed in to change notification settings - Fork 1
/
solar-system.html
310 lines (287 loc) · 7.9 KB
/
solar-system.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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Solar System</title>
<style>
@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Secular+One&display=swap");
:root {
--bg: rgb(40, 105, 254, 0.25);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Poppins", sans-serif;
font-size: 16px;
}
html,
body {
overflow: hidden;
overflow-y: scroll;
}
.webgl {
left: 0;
outline: none;
position: fixed;
top: 0;
}
.loading {
background: #000000;
height: 100%;
position: absolute;
width: 100%;
z-index: 99;
}
.loading.ended {
opacity: 0%;
transition: opacity 1.5s ease-in-out;
}
.loading__bar {
background: #ffffff;
height: 2px;
position: absolute;
top: 50%;
transform-origin: top left;
transform: scaleX(0);
transition: transform 0.5s;
width: 100%;
z-index: 99;
}
.loading__bar.ended {
transform-origin: 100% 0;
transform: scaleX(0);
transition: transform 1.5s ease-in-out;
}
#sidepanel {
background-color: var(--bg);
min-height: 100vh;
height: fit-content;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 20px;
position: absolute;
top: 0;
left: 0;
z-index: 1000;
}
.sidepanel-item {
margin-top: 2rem;
margin-bottom: 2rem;
}
#sidepanel p {
font-weight: 800;
color: #2869fe;
margin-bottom: 5px;
text-align: center;
}
#sidepanel button {
border: none;
color: #ffefef;
cursor: pointer;
display: block;
padding: 5px;
transition: all 0.4s;
}
.divider {
height: 1px;
width: 100%;
background-color: grey;
opacity: 50%;
}
#info {
background-color: var(--bg);
border-radius: 1.2rem;
color: #2869FE;
margin: 20px;
width: fit-content;
max-width: 25vw;
padding: 20px;
position: fixed;
right: 0;
top: 0;
visibility: hidden;
z-index: 98;
}
#info p {
color: #fff;
margin-bottom: 5px;
}
.cta {
position: relative;
margin: auto;
padding: 12px 18px;
transition: all 0.2s ease;
border: none;
background: none;
}
.cta:before {
content: "";
position: absolute;
top: 0;
left: 0;
display: block;
border-radius: 50px;
background: #2869fe;
width: 32px;
height: 32px;
transition: all 0.3s ease;
}
.cta span {
position: relative;
font-size: 0.1rem;
/* font-weight: 700; */
color: #fff;
padding-left: 8px;
}
.cta svg {
position: relative;
top: 0;
margin-left: 8px;
fill: none;
stroke-linecap: round;
stroke-linejoin: round;
stroke: #fff;
stroke-width: 2;
margin-right: 8px;
transform: translateX(-4px);
transition: all 0.3s ease;
}
.cta:hover:before {
width: 100%;
background: #2869fe;
}
.cta:hover svg {
transform: translateX(0);
}
.cta:active {
transform: scale(0.95);
}
</style>
</head>
<body style="background-color: #000000">
<div class="loading"></div>
<div class="loading__bar"></div>
<div id="sidepanel">
<div class="sidepanel-item" id="sun">
<p>Sun</p>
<button class="cta" id="sunLocate">
<span>Find Sun</span>
<svg viewBox="0 0 13 10" height="10px" width="15px">
<path d="M1,5 L11,5"></path>
<polyline points="8 1 12 5 8 9"></polyline>
</svg>
</button>
</div>
<div class="divider"></div>
<div class="sidepanel-item" id="mercury">
<p>Mercury</p>
<button class="cta" id="mercuryLocate">
<span>Find Mercury</span>
<svg viewBox="0 0 13 10" height="10px" width="15px">
<path d="M1,5 L11,5"></path>
<polyline points="8 1 12 5 8 9"></polyline>
</svg>
</button>
</div>
<div class="divider"></div>
<div class="sidepanel-item" id="venus">
<p>Venus</p>
<button class="cta" id="venusLocate">
<span>Find Venus</span>
<svg viewBox="0 0 13 10" height="10px" width="15px">
<path d="M1,5 L11,5"></path>
<polyline points="8 1 12 5 8 9"></polyline>
</svg>
</button>
</div>
<div class="divider"></div>
<div class="sidepanel-item" id="earth">
<p>Earth</p>
<button class="cta" id="earthLocate">
<span>Find Earth</span>
<svg viewBox="0 0 13 10" height="10px" width="15px">
<path d="M1,5 L11,5"></path>
<polyline points="8 1 12 5 8 9"></polyline>
</svg>
</button>
</div>
<div class="divider"></div>
<div class="sidepanel-item" id="mars">
<p>Mars</p>
<button class="cta" id="marsLocate">
<span>Find Mars</span>
<svg viewBox="0 0 13 10" height="10px" width="15px">
<path d="M1,5 L11,5"></path>
<polyline points="8 1 12 5 8 9"></polyline>
</svg>
</button>
</div>
<div class="divider"></div>
<div class="sidepanel-item" id="jupiter">
<p>Jupiter</p>
<button class="cta" id="jupiterLocate">
<span>Find Jupiter</span>
<svg viewBox="0 0 13 10" height="10px" width="15px">
<path d="M1,5 L11,5"></path>
<polyline points="8 1 12 5 8 9"></polyline>
</svg>
</button>
</div>
<div class="divider"></div>
<div class="sidepanel-item" id="saturn">
<p>Saturn</p>
<button class="cta" id="saturnLocate">
<span>Find Saturn</span>
<svg viewBox="0 0 13 10" height="10px" width="15px">
<path d="M1,5 L11,5"></path>
<polyline points="8 1 12 5 8 9"></polyline>
</svg>
</button>
</div>
<div class="divider"></div>
<div class="sidepanel-item" id="uranus">
<p>Uranus</p>
<button class="cta" id="uranusLocate">
<span>Find Uranus</span>
<svg viewBox="0 0 13 10" height="10px" width="15px">
<path d="M1,5 L11,5"></path>
<polyline points="8 1 12 5 8 9"></polyline>
</svg>
</button>
</div>
<div class="divider"></div>
<div class="sidepanel-item" id="neptune">
<p>Neptune</p>
<button class="cta" id="neptuneLocate">
<span>Find Neptune</span>
<svg viewBox="0 0 13 10" height="10px" width="15px">
<path d="M1,5 L11,5"></path>
<polyline points="8 1 12 5 8 9"></polyline>
</svg>
</button>
</div>
</div>
<div id="info">
<h3>Name</h3>
<p id="name"></p>
<h3>Mass</h3>
<p id="mass"></p>
<h3>Diameter</h3>
<p id="diameter"></p>
<h3>Gravity</h3>
<p id="gravity"></p>
<h3>Length of Year</h3>
<p id="lengthOfYear"></p>
<h3>Length of day</h3>
<p id="lengthOfDay"></p>
<h3>Description</h3>
<p id="desc"></p>
</div>
<canvas class="webgl"></canvas>
<script type="module" src="./simulations/index.js"></script>
</body>
</html>