Spaces:
Running
Running
Add 2 files
Browse files- README.md +6 -4
- index.html +556 -19
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
colorTo: blue
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: h-kais
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: blue
|
5 |
colorTo: blue
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,556 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Interactive Solar System Simulation</title>
|
7 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
8 |
+
<style>
|
9 |
+
* {
|
10 |
+
margin: 0;
|
11 |
+
padding: 0;
|
12 |
+
box-sizing: border-box;
|
13 |
+
}
|
14 |
+
|
15 |
+
body {
|
16 |
+
background-color: #000;
|
17 |
+
color: #fff;
|
18 |
+
font-family: 'Arial', sans-serif;
|
19 |
+
overflow: hidden;
|
20 |
+
height: 100vh;
|
21 |
+
display: flex;
|
22 |
+
flex-direction: column;
|
23 |
+
}
|
24 |
+
|
25 |
+
header {
|
26 |
+
padding: 15px;
|
27 |
+
text-align: center;
|
28 |
+
background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(9,31,121,0.5) 50%, rgba(0,0,0,0) 100%);
|
29 |
+
border-bottom: 1px solid #333;
|
30 |
+
}
|
31 |
+
|
32 |
+
h1 {
|
33 |
+
font-size: 2.5rem;
|
34 |
+
margin-bottom: 10px;
|
35 |
+
background: linear-gradient(to right, #fff, #5bc0de);
|
36 |
+
-webkit-background-clip: text;
|
37 |
+
background-clip: text;
|
38 |
+
color: transparent;
|
39 |
+
text-shadow: 0 0 10px rgba(91, 192, 222, 0.3);
|
40 |
+
}
|
41 |
+
|
42 |
+
.controls {
|
43 |
+
display: flex;
|
44 |
+
justify-content: center;
|
45 |
+
gap: 20px;
|
46 |
+
padding: 10px;
|
47 |
+
background: rgba(0, 0, 0, 0.7);
|
48 |
+
border-bottom: 1px solid #333;
|
49 |
+
}
|
50 |
+
|
51 |
+
.control-group {
|
52 |
+
display: flex;
|
53 |
+
align-items: center;
|
54 |
+
gap: 10px;
|
55 |
+
}
|
56 |
+
|
57 |
+
label {
|
58 |
+
font-size: 0.9rem;
|
59 |
+
color: #ddd;
|
60 |
+
}
|
61 |
+
|
62 |
+
button {
|
63 |
+
background: rgba(50, 50, 100, 0.5);
|
64 |
+
color: white;
|
65 |
+
border: 1px solid #444;
|
66 |
+
border-radius: 5px;
|
67 |
+
padding: 5px 10px;
|
68 |
+
cursor: pointer;
|
69 |
+
transition: all 0.3s;
|
70 |
+
}
|
71 |
+
|
72 |
+
button:hover {
|
73 |
+
background: rgba(70, 70, 150, 0.7);
|
74 |
+
transform: scale(1.05);
|
75 |
+
}
|
76 |
+
|
77 |
+
button.active {
|
78 |
+
background: rgba(91, 192, 222, 0.7);
|
79 |
+
border-color: #5bc0de;
|
80 |
+
}
|
81 |
+
|
82 |
+
input[type="range"] {
|
83 |
+
width: 150px;
|
84 |
+
cursor: pointer;
|
85 |
+
}
|
86 |
+
|
87 |
+
.solar-system {
|
88 |
+
position: relative;
|
89 |
+
width: 100%;
|
90 |
+
height: calc(100vh - 150px);
|
91 |
+
display: flex;
|
92 |
+
justify-content: center;
|
93 |
+
align-items: center;
|
94 |
+
perspective: 1000px;
|
95 |
+
}
|
96 |
+
|
97 |
+
.sun {
|
98 |
+
position: absolute;
|
99 |
+
width: 80px;
|
100 |
+
height: 80px;
|
101 |
+
background: radial-gradient(circle at 30% 30%, #fff, #ffdf00, #ff9900, #ff5e00);
|
102 |
+
border-radius: 50%;
|
103 |
+
box-shadow: 0 0 50px #ff5e00, 0 0 100px #ff9900;
|
104 |
+
z-index: 1;
|
105 |
+
animation: sunPulse 10s infinite alternate;
|
106 |
+
}
|
107 |
+
|
108 |
+
.orbit {
|
109 |
+
position: absolute;
|
110 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
111 |
+
border-radius: 50%;
|
112 |
+
transform-style: preserve-3d;
|
113 |
+
}
|
114 |
+
|
115 |
+
.planet {
|
116 |
+
position: absolute;
|
117 |
+
border-radius: 50%;
|
118 |
+
transform-origin: center;
|
119 |
+
}
|
120 |
+
|
121 |
+
.planet-label {
|
122 |
+
position: absolute;
|
123 |
+
color: white;
|
124 |
+
font-size: 12px;
|
125 |
+
text-shadow: 0 0 3px black;
|
126 |
+
pointer-events: none;
|
127 |
+
opacity: 1;
|
128 |
+
transition: opacity 0.3s;
|
129 |
+
}
|
130 |
+
|
131 |
+
.planet-label.hidden {
|
132 |
+
opacity: 0;
|
133 |
+
}
|
134 |
+
|
135 |
+
/* Mercury */
|
136 |
+
.mercury-orbit {
|
137 |
+
width: 120px;
|
138 |
+
height: 120px;
|
139 |
+
animation: orbitRotation 4s linear infinite;
|
140 |
+
}
|
141 |
+
|
142 |
+
.mercury {
|
143 |
+
top: 0;
|
144 |
+
left: 50%;
|
145 |
+
width: 5px;
|
146 |
+
height: 5px;
|
147 |
+
background: linear-gradient(135deg, #a9a9a9, #696969);
|
148 |
+
box-shadow: 0 0 5px #a9a9a9;
|
149 |
+
}
|
150 |
+
|
151 |
+
/* Venus */
|
152 |
+
.venus-orbit {
|
153 |
+
width: 180px;
|
154 |
+
height: 180px;
|
155 |
+
animation: orbitRotation 10s linear infinite;
|
156 |
+
}
|
157 |
+
|
158 |
+
.venus {
|
159 |
+
top: 0;
|
160 |
+
left: 50%;
|
161 |
+
width: 10px;
|
162 |
+
height: 10px;
|
163 |
+
background: linear-gradient(135deg, #e6c229, #c88f2d);
|
164 |
+
box-shadow: 0 0 5px #e6c229;
|
165 |
+
}
|
166 |
+
|
167 |
+
/* Earth */
|
168 |
+
.earth-orbit {
|
169 |
+
width: 250px;
|
170 |
+
height: 250px;
|
171 |
+
animation: orbitRotation 15s linear infinite;
|
172 |
+
}
|
173 |
+
|
174 |
+
.earth {
|
175 |
+
top: 0;
|
176 |
+
left: 50%;
|
177 |
+
width: 11px;
|
178 |
+
height: 11px;
|
179 |
+
background: linear-gradient(135deg, #1da1f2, #0c5a8a);
|
180 |
+
box-shadow: 0 0 5px #1da1f2;
|
181 |
+
}
|
182 |
+
|
183 |
+
/* Mars */
|
184 |
+
.mars-orbit {
|
185 |
+
width: 320px;
|
186 |
+
height: 320px;
|
187 |
+
animation: orbitRotation 28s linear infinite;
|
188 |
+
}
|
189 |
+
|
190 |
+
.mars {
|
191 |
+
top: 0;
|
192 |
+
left: 50%;
|
193 |
+
width: 7px;
|
194 |
+
height: 7px;
|
195 |
+
background: linear-gradient(135deg, #ff7b25, #b33a15);
|
196 |
+
box-shadow: 0 0 5px #ff7b25;
|
197 |
+
}
|
198 |
+
|
199 |
+
/* Jupiter */
|
200 |
+
.jupiter-orbit {
|
201 |
+
width: 450px;
|
202 |
+
height: 450px;
|
203 |
+
animation: orbitRotation 95s linear infinite;
|
204 |
+
}
|
205 |
+
|
206 |
+
.jupiter {
|
207 |
+
top: 0;
|
208 |
+
left: 50%;
|
209 |
+
width: 20px;
|
210 |
+
height: 20px;
|
211 |
+
background: linear-gradient(135deg, #e8b56d, #b78a3f);
|
212 |
+
box-shadow: 0 0 5px #e8b56d;
|
213 |
+
}
|
214 |
+
|
215 |
+
/* Saturn */
|
216 |
+
.saturn-orbit {
|
217 |
+
width: 550px;
|
218 |
+
height: 550px;
|
219 |
+
animation: orbitRotation 230s linear infinite;
|
220 |
+
}
|
221 |
+
|
222 |
+
.saturn {
|
223 |
+
top: 0;
|
224 |
+
left: 50%;
|
225 |
+
width: 17px;
|
226 |
+
height: 17px;
|
227 |
+
background: linear-gradient(135deg, #e8e0b5, #c9b96b);
|
228 |
+
box-shadow: 0 0 5px #e8e0b5;
|
229 |
+
}
|
230 |
+
|
231 |
+
/* Saturn's rings */
|
232 |
+
.saturn::after {
|
233 |
+
content: '';
|
234 |
+
position: absolute;
|
235 |
+
top: 50%;
|
236 |
+
left: 50%;
|
237 |
+
transform: translate(-50%, -50%) rotate(20deg);
|
238 |
+
width: 30px;
|
239 |
+
height: 5px;
|
240 |
+
background: rgba(210, 210, 170, 0.6);
|
241 |
+
border-radius: 50%;
|
242 |
+
box-shadow: 0 0 5px rgba(210, 210, 170, 0.8);
|
243 |
+
}
|
244 |
+
|
245 |
+
/* Uranus */
|
246 |
+
.uranus-orbit {
|
247 |
+
width: 650px;
|
248 |
+
height: 650px;
|
249 |
+
animation: orbitRotation 680s linear infinite;
|
250 |
+
}
|
251 |
+
|
252 |
+
.uranus {
|
253 |
+
top: 0;
|
254 |
+
left: 50%;
|
255 |
+
width: 14px;
|
256 |
+
height: 14px;
|
257 |
+
background: linear-gradient(135deg, #a3d3e0, #5baebd);
|
258 |
+
box-shadow: 0 0 5px #a3d3e0;
|
259 |
+
}
|
260 |
+
|
261 |
+
/* Neptune */
|
262 |
+
.neptune-orbit {
|
263 |
+
width: 750px;
|
264 |
+
height: 750px;
|
265 |
+
animation: orbitRotation 1330s linear infinite;
|
266 |
+
}
|
267 |
+
|
268 |
+
.neptune {
|
269 |
+
top: 0;
|
270 |
+
left: 50%;
|
271 |
+
width: 13px;
|
272 |
+
height: 13px;
|
273 |
+
background: linear-gradient(135deg, #4e90b8, #2a5675);
|
274 |
+
box-shadow: 0 0 5px #4e90b8;
|
275 |
+
}
|
276 |
+
|
277 |
+
@keyframes orbitRotation {
|
278 |
+
from {
|
279 |
+
transform: rotate(0deg);
|
280 |
+
}
|
281 |
+
to {
|
282 |
+
transform: rotate(360deg);
|
283 |
+
}
|
284 |
+
}
|
285 |
+
|
286 |
+
@keyframes sunPulse {
|
287 |
+
0% {
|
288 |
+
box-shadow: 0 0 50px #ff5e00, 0 0 100px #ff9900;
|
289 |
+
}
|
290 |
+
100% {
|
291 |
+
box-shadow: 0 0 70px #ff5e00, 0 0 140px #ff9900, 0 0 180px #ffdf00;
|
292 |
+
}
|
293 |
+
}
|
294 |
+
|
295 |
+
.stars {
|
296 |
+
position: absolute;
|
297 |
+
top: 0;
|
298 |
+
left: 0;
|
299 |
+
width: 100%;
|
300 |
+
height: 100%;
|
301 |
+
z-index: -1;
|
302 |
+
}
|
303 |
+
|
304 |
+
.star {
|
305 |
+
position: absolute;
|
306 |
+
background-color: white;
|
307 |
+
border-radius: 50%;
|
308 |
+
animation: twinkle 1s infinite alternate;
|
309 |
+
}
|
310 |
+
|
311 |
+
@keyframes twinkle {
|
312 |
+
0% {
|
313 |
+
opacity: 0.3;
|
314 |
+
}
|
315 |
+
100% {
|
316 |
+
opacity: 1;
|
317 |
+
}
|
318 |
+
}
|
319 |
+
|
320 |
+
footer {
|
321 |
+
text-align: center;
|
322 |
+
padding: 10px;
|
323 |
+
font-size: 0.8rem;
|
324 |
+
color: #666;
|
325 |
+
background: rgba(0, 0, 0, 0.7);
|
326 |
+
}
|
327 |
+
|
328 |
+
.speed-display {
|
329 |
+
min-width: 30px;
|
330 |
+
text-align: center;
|
331 |
+
}
|
332 |
+
|
333 |
+
/* Responsive adjustments */
|
334 |
+
@media (max-width: 768px) {
|
335 |
+
h1 {
|
336 |
+
font-size: 1.8rem;
|
337 |
+
}
|
338 |
+
.controls {
|
339 |
+
flex-wrap: wrap;
|
340 |
+
gap: 10px;
|
341 |
+
}
|
342 |
+
.neptune-orbit {
|
343 |
+
width: 500px;
|
344 |
+
height: 500px;
|
345 |
+
}
|
346 |
+
.uranus-orbit {
|
347 |
+
width: 450px;
|
348 |
+
height: 450px;
|
349 |
+
}
|
350 |
+
.saturn-orbit {
|
351 |
+
width: 400px;
|
352 |
+
height: 400px;
|
353 |
+
}
|
354 |
+
.jupiter-orbit {
|
355 |
+
width: 350px;
|
356 |
+
height: 350px;
|
357 |
+
}
|
358 |
+
}
|
359 |
+
</style>
|
360 |
+
</head>
|
361 |
+
<body>
|
362 |
+
<header>
|
363 |
+
<h1>Solar System Simulation</h1>
|
364 |
+
</header>
|
365 |
+
|
366 |
+
<div class="controls">
|
367 |
+
<div class="control-group">
|
368 |
+
<button id="pauseBtn"><i class="fas fa-pause"></i></button>
|
369 |
+
<button id="playBtn" class="active"><i class="fas fa-play"></i></button>
|
370 |
+
</div>
|
371 |
+
<div class="control-group">
|
372 |
+
<label for="speedControl"><i class="fas fa-tachometer-alt"></i> Speed</label>
|
373 |
+
<input type="range" id="speedControl" min="0.1" max="5" step="0.1" value="1">
|
374 |
+
<span class="speed-display" id="speedValue">1x</span>
|
375 |
+
</div>
|
376 |
+
<div class="control-group">
|
377 |
+
<button id="toggleLabels" class="active"><i class="fas fa-tag"></i> Labels</button>
|
378 |
+
</div>
|
379 |
+
</div>
|
380 |
+
|
381 |
+
<div class="solar-system">
|
382 |
+
<div class="stars" id="stars"></div>
|
383 |
+
<div class="sun"></div>
|
384 |
+
|
385 |
+
<!-- Mercury -->
|
386 |
+
<div class="orbit mercury-orbit">
|
387 |
+
<div class="planet mercury"></div>
|
388 |
+
<div class="planet-label">Mercury</div>
|
389 |
+
</div>
|
390 |
+
|
391 |
+
<!-- Venus -->
|
392 |
+
<div class="orbit venus-orbit">
|
393 |
+
<div class="planet venus"></div>
|
394 |
+
<div class="planet-label">Venus</div>
|
395 |
+
</div>
|
396 |
+
|
397 |
+
<!-- Earth -->
|
398 |
+
<div class="orbit earth-orbit">
|
399 |
+
<div class="planet earth"></div>
|
400 |
+
<div class="planet-label">Earth</div>
|
401 |
+
</div>
|
402 |
+
|
403 |
+
<!-- Mars -->
|
404 |
+
<div class="orbit mars-orbit">
|
405 |
+
<div class="planet mars"></div>
|
406 |
+
<div class="planet-label">Mars</div>
|
407 |
+
</div>
|
408 |
+
|
409 |
+
<!-- Jupiter -->
|
410 |
+
<div class="orbit jupiter-orbit">
|
411 |
+
<div class="planet jupiter"></div>
|
412 |
+
<div class="planet-label">Jupiter</div>
|
413 |
+
</div>
|
414 |
+
|
415 |
+
<!-- Saturn -->
|
416 |
+
<div class="orbit saturn-orbit">
|
417 |
+
<div class="planet saturn"></div>
|
418 |
+
<div class="planet-label">Saturn</div>
|
419 |
+
</div>
|
420 |
+
|
421 |
+
<!-- Uranus -->
|
422 |
+
<div class="orbit uranus-orbit">
|
423 |
+
<div class="planet uranus"></div>
|
424 |
+
<div class="planet-label">Uranus</div>
|
425 |
+
</div>
|
426 |
+
|
427 |
+
<!-- Neptune -->
|
428 |
+
<div class="orbit neptune-orbit">
|
429 |
+
<div class="planet neptune"></div>
|
430 |
+
<div class="planet-label">Neptune</div>
|
431 |
+
</div>
|
432 |
+
</div>
|
433 |
+
|
434 |
+
<footer>
|
435 |
+
Interactive Solar System Simulation | All planetary orbits are to relative scale
|
436 |
+
</footer>
|
437 |
+
|
438 |
+
<script>
|
439 |
+
document.addEventListener('DOMContentLoaded', function() {
|
440 |
+
// Create stars background
|
441 |
+
const starsContainer = document.getElementById('stars');
|
442 |
+
for (let i = 0; i < 200; i++) {
|
443 |
+
const star = document.createElement('div');
|
444 |
+
star.classList.add('star');
|
445 |
+
star.style.width = `${Math.random() * 2}px`;
|
446 |
+
star.style.height = star.style.width;
|
447 |
+
star.style.left = `${Math.random() * 100}%`;
|
448 |
+
star.style.top = `${Math.random() * 100}%`;
|
449 |
+
star.style.animationDuration = `${2 + Math.random() * 3}s`;
|
450 |
+
star.style.animationDelay = `${Math.random() * 5}s`;
|
451 |
+
starsContainer.appendChild(star);
|
452 |
+
}
|
453 |
+
|
454 |
+
// Get control elements
|
455 |
+
const playBtn = document.getElementById('playBtn');
|
456 |
+
const pauseBtn = document.getElementById('pauseBtn');
|
457 |
+
const speedControl = document.getElementById('speedControl');
|
458 |
+
const speedValue = document.getElementById('speedValue');
|
459 |
+
const toggleLabels = document.getElementById('toggleLabels');
|
460 |
+
const planetLabels = document.querySelectorAll('.planet-label');
|
461 |
+
|
462 |
+
// Get all orbit elements
|
463 |
+
const orbits = document.querySelectorAll('.orbit');
|
464 |
+
|
465 |
+
// Store base animation durations
|
466 |
+
const baseDurations = {};
|
467 |
+
orbits.forEach(orbit => {
|
468 |
+
const style = window.getComputedStyle(orbit);
|
469 |
+
baseDurations[orbit.className.split(' ')[0]] = parseFloat(style.animationDuration);
|
470 |
+
});
|
471 |
+
|
472 |
+
// Animation control
|
473 |
+
let isPlaying = true;
|
474 |
+
let speedFactor = 1;
|
475 |
+
|
476 |
+
// Play/pause functionality
|
477 |
+
playBtn.addEventListener('click', function() {
|
478 |
+
if (!isPlaying) {
|
479 |
+
orbits.forEach(orbit => {
|
480 |
+
orbit.style.animationPlayState = 'running';
|
481 |
+
});
|
482 |
+
isPlaying = true;
|
483 |
+
playBtn.classList.add('active');
|
484 |
+
pauseBtn.classList.remove('active');
|
485 |
+
}
|
486 |
+
});
|
487 |
+
|
488 |
+
pauseBtn.addEventListener('click', function() {
|
489 |
+
if (isPlaying) {
|
490 |
+
orbits.forEach(orbit => {
|
491 |
+
orbit.style.animationPlayState = 'paused';
|
492 |
+
});
|
493 |
+
isPlaying = false;
|
494 |
+
pauseBtn.classList.add('active');
|
495 |
+
playBtn.classList.remove('active');
|
496 |
+
}
|
497 |
+
});
|
498 |
+
|
499 |
+
// Speed control
|
500 |
+
speedControl.addEventListener('input', function() {
|
501 |
+
speedFactor = parseFloat(this.value);
|
502 |
+
speedValue.textContent = `${speedFactor.toFixed(1)}x`;
|
503 |
+
|
504 |
+
orbits.forEach(orbit => {
|
505 |
+
const orbitClass = orbit.className.split(' ')[0];
|
506 |
+
const baseDuration = baseDurations[orbitClass];
|
507 |
+
orbit.style.animationDuration = `${baseDuration / speedFactor}s`;
|
508 |
+
});
|
509 |
+
});
|
510 |
+
|
511 |
+
// Toggle labels
|
512 |
+
toggleLabels.addEventListener('click', function() {
|
513 |
+
const isActive = this.classList.contains('active');
|
514 |
+
this.classList.toggle('active');
|
515 |
+
|
516 |
+
planetLabels.forEach(label => {
|
517 |
+
if (isActive) {
|
518 |
+
label.classList.add('hidden');
|
519 |
+
} else {
|
520 |
+
label.classList.remove('hidden');
|
521 |
+
}
|
522 |
+
});
|
523 |
+
});
|
524 |
+
|
525 |
+
// Position labels near planets
|
526 |
+
function updateLabelPositions() {
|
527 |
+
planetLabels.forEach(label => {
|
528 |
+
const orbit = label.parentElement;
|
529 |
+
const planet = orbit.querySelector('.planet');
|
530 |
+
const orbitRect = orbit.getBoundingClientRect();
|
531 |
+
const planetRect = planet.getBoundingClientRect();
|
532 |
+
|
533 |
+
// Position label near the planet
|
534 |
+
const planetCenterX = planetRect.left + planetRect.width / 2;
|
535 |
+
const planetCenterY = planetRect.top + planetRect.height / 2;
|
536 |
+
|
537 |
+
// Adjust position based on planet's position in orbit
|
538 |
+
const orbitCenterX = orbitRect.left + orbitRect.width / 2;
|
539 |
+
const orbitCenterY = orbitRect.top + orbitRect.height / 2;
|
540 |
+
|
541 |
+
// Determine which side of the orbit the planet is on
|
542 |
+
const isRight = planetCenterX > orbitCenterX;
|
543 |
+
|
544 |
+
label.style.left = `${isRight ? planetCenterX + 15 : planetCenterX - 55}px`;
|
545 |
+
label.style.top = `${planetCenterY - 10}px`;
|
546 |
+
});
|
547 |
+
|
548 |
+
requestAnimationFrame(updateLabelPositions);
|
549 |
+
}
|
550 |
+
|
551 |
+
// Start updating label positions
|
552 |
+
updateLabelPositions();
|
553 |
+
});
|
554 |
+
</script>
|
555 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <a href="https://enzostvs-deepsite.hf.space" style="color: #fff;" target="_blank" >DeepSite</a> <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;"></p></body>
|
556 |
+
</html>
|