yaspred commited on
Commit
75a16b7
·
verified ·
1 Parent(s): 84ab2ed

Add 2 files

Browse files
Files changed (2) hide show
  1. README.md +6 -4
  2. index.html +306 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Iss
3
- emoji: 👁
4
- colorFrom: gray
5
  colorTo: pink
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: iss
3
+ emoji: 🐳
4
+ colorFrom: blue
5
  colorTo: pink
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,306 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="fr">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Suivi en temps réel de l'ISS</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/globe.gl@2.24.0/dist/globe.gl.min.js"></script>
10
+ <style>
11
+ .globe-container {
12
+ position: relative;
13
+ width: 100%;
14
+ height: 100%;
15
+ }
16
+ .iss-marker {
17
+ position: absolute;
18
+ width: 12px;
19
+ height: 12px;
20
+ background-color: #FFD700;
21
+ border-radius: 50%;
22
+ box-shadow: 0 0 10px 5px rgba(255, 215, 0, 0.7);
23
+ transform: translate(-50%, -50%);
24
+ z-index: 10;
25
+ }
26
+ .pulse {
27
+ animation: pulse 2s infinite;
28
+ }
29
+ @keyframes pulse {
30
+ 0% {
31
+ transform: translate(-50%, -50%) scale(1);
32
+ opacity: 1;
33
+ }
34
+ 70% {
35
+ transform: translate(-50%, -50%) scale(1.5);
36
+ opacity: 0.7;
37
+ }
38
+ 100% {
39
+ transform: translate(-50%, -50%) scale(1);
40
+ opacity: 0;
41
+ }
42
+ }
43
+ .info-panel {
44
+ backdrop-filter: blur(10px);
45
+ background-color: rgba(15, 23, 42, 0.7);
46
+ }
47
+ .orbit-path {
48
+ stroke: rgba(255, 215, 0, 0.3);
49
+ stroke-width: 1px;
50
+ fill: none;
51
+ }
52
+ </style>
53
+ </head>
54
+ <body class="bg-slate-900 text-white min-h-screen flex flex-col">
55
+ <header class="py-6 px-4 sm:px-6 lg:px-8 border-b border-slate-800">
56
+ <div class="max-w-7xl mx-auto flex justify-between items-center">
57
+ <h1 class="text-2xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-cyan-400 to-blue-500">
58
+ Suivi de l'ISS en temps réel
59
+ </h1>
60
+ <div class="flex items-center space-x-4">
61
+ <div id="last-updated" class="text-sm text-slate-400"></div>
62
+ <div class="flex items-center">
63
+ <div class="w-3 h-3 rounded-full bg-green-500 animate-pulse mr-2"></div>
64
+ <span class="text-sm">En ligne</span>
65
+ </div>
66
+ </div>
67
+ </div>
68
+ </header>
69
+
70
+ <main class="flex-1 flex flex-col lg:flex-row gap-6 p-4 sm:p-6 lg:p-8 max-w-7xl mx-auto w-full">
71
+ <div class="flex-1 h-96 lg:h-auto rounded-xl overflow-hidden shadow-2xl relative">
72
+ <div id="globe" class="globe-container w-full h-full"></div>
73
+ <div id="iss-marker" class="iss-marker pulse hidden"></div>
74
+ </div>
75
+
76
+ <div class="w-full lg:w-80 space-y-6">
77
+ <div class="info-panel rounded-xl p-6 shadow-lg">
78
+ <h2 class="text-lg font-semibold mb-4 text-cyan-400">Informations de l'ISS</h2>
79
+ <div class="space-y-3">
80
+ <div>
81
+ <p class="text-sm text-slate-400">Position actuelle</p>
82
+ <p id="iss-position" class="font-medium">Chargement...</p>
83
+ </div>
84
+ <div>
85
+ <p class="text-sm text-slate-400">Altitude</p>
86
+ <p id="iss-altitude" class="font-medium">Chargement...</p>
87
+ </div>
88
+ <div>
89
+ <p class="text-sm text-slate-400">Vitesse</p>
90
+ <p id="iss-velocity" class="font-medium">Chargement...</p>
91
+ </div>
92
+ <div>
93
+ <p class="text-sm text-slate-400">Prochain passage</p>
94
+ <p id="next-pass" class="font-medium">Chargement...</p>
95
+ </div>
96
+ </div>
97
+ </div>
98
+
99
+ <div class="info-panel rounded-xl p-6 shadow-lg">
100
+ <h2 class="text-lg font-semibold mb-4 text-cyan-400">Statistiques</h2>
101
+ <div class="space-y-3">
102
+ <div>
103
+ <p class="text-sm text-slate-400">Temps en orbite</p>
104
+ <p id="orbital-time" class="font-medium">22 ans, 10 mois, 3 jours</p>
105
+ </div>
106
+ <div>
107
+ <p class="text-sm text-slate-400">Tours de Terre</p>
108
+ <p id="orbits-count" class="font-medium">~133,500</p>
109
+ </div>
110
+ <div>
111
+ <p class="text-sm text-slate-400">Distance parcourue</p>
112
+ <p id="distance-traveled" class="font-medium">~3.7 milliards km</p>
113
+ </div>
114
+ </div>
115
+ </div>
116
+
117
+ <div class="info-panel rounded-xl p-6 shadow-lg">
118
+ <h2 class="text-lg font-semibold mb-4 text-cyan-400">Équipage actuel</h2>
119
+ <div id="crew-members" class="space-y-3">
120
+ <div class="flex items-center space-x-3">
121
+ <div class="w-8 h-8 rounded-full bg-slate-700"></div>
122
+ <p class="text-sm">Chargement des données d'équipage...</p>
123
+ </div>
124
+ </div>
125
+ </div>
126
+ </div>
127
+ </main>
128
+
129
+ <footer class="py-4 px-4 sm:px-6 lg:px-8 border-t border-slate-800 text-center text-sm text-slate-500">
130
+ <p>Données fournies par l'API Where the ISS at? • Mise à jour toutes les 5 secondes</p>
131
+ </footer>
132
+
133
+ <script>
134
+ // Configuration initiale
135
+ const EARTH_RADIUS_KM = 6371;
136
+ const ISS_ALTITUDE_KM = 408;
137
+ const ISS_SPEED_KM_S = 7.66;
138
+
139
+ let issPositionHistory = [];
140
+ const maxHistoryPoints = 100;
141
+ let lastUpdateTime = null;
142
+
143
+ // Initialiser le globe
144
+ const globeContainer = document.getElementById('globe');
145
+ const world = Globe()
146
+ .globeImageUrl('//unpkg.com/three-globe/example/img/earth-blue-marble.jpg')
147
+ .bumpImageUrl('//unpkg.com/three-globe/example/img/earth-topology.png')
148
+ .backgroundImageUrl('//unpkg.com/three-globe/example/img/night-sky.png')
149
+ .showAtmosphere(true)
150
+ .atmosphereColor('rgba(63, 201, 255, 0.2)')
151
+ .atmosphereAltitude(0.25)
152
+ (globeContainer);
153
+
154
+ // Ajuster la taille du globe lors du redimensionnement
155
+ window.addEventListener('resize', () => {
156
+ world.width(globeContainer.clientWidth);
157
+ world.height(globeContainer.clientHeight);
158
+ });
159
+
160
+ // Fonction pour convertir les coordonnées géographiques en position 3D
161
+ function getPositionOnGlobe(lat, lng) {
162
+ const phi = (90 - lat) * (Math.PI / 180);
163
+ const theta = (lng + 180) * (Math.PI / 180);
164
+
165
+ const radius = EARTH_RADIUS_KM + ISS_ALTITUDE_KM;
166
+
167
+ const x = -(radius * Math.sin(phi) * Math.cos(theta));
168
+ const y = radius * Math.cos(phi);
169
+ const z = radius * Math.sin(phi) * Math.sin(theta);
170
+
171
+ return { x, y, z };
172
+ }
173
+
174
+ // Fonction pour mettre à jour la position de l'ISS
175
+ function updateISSPosition(latitude, longitude) {
176
+ // Mettre à jour l'historique des positions
177
+ issPositionHistory.push({ lat: latitude, lng: longitude });
178
+ if (issPositionHistory.length > maxHistoryPoints) {
179
+ issPositionHistory.shift();
180
+ }
181
+
182
+ // Mettre à jour le marqueur de l'ISS
183
+ const issMarker = document.getElementById('iss-marker');
184
+ const { x, y, z } = getPositionOnGlobe(latitude, longitude);
185
+
186
+ // Convertir les coordonnées 3D en coordonnées d'écran
187
+ const widthHalf = globeContainer.clientWidth / 2;
188
+ const heightHalf = globeContainer.clientHeight / 2;
189
+
190
+ const vector = new THREE.Vector3(x, y, z);
191
+ vector.project(world.camera());
192
+
193
+ const screenX = Math.round((vector.x * widthHalf) + widthHalf);
194
+ const screenY = Math.round(-(vector.y * heightHalf) + heightHalf);
195
+
196
+ issMarker.style.left = `${screenX}px`;
197
+ issMarker.style.top = `${screenY}px`;
198
+ issMarker.classList.remove('hidden');
199
+
200
+ // Mettre à jour les données affichées
201
+ document.getElementById('iss-position').textContent = `${latitude.toFixed(4)}° N, ${longitude.toFixed(4)}° E`;
202
+ document.getElementById('iss-altitude').textContent = `${ISS_ALTITUDE_KM} km`;
203
+ document.getElementById('iss-velocity').textContent = `${(ISS_SPEED_KM_S * 3600).toLocaleString()} km/h`;
204
+
205
+ // Mettre à jour l'heure de la dernière mise à jour
206
+ const now = new Date();
207
+ lastUpdateTime = now;
208
+ document.getElementById('last-updated').textContent = `Mis à jour: ${now.toLocaleTimeString()}`;
209
+
210
+ // Calculer le prochain passage (simulation)
211
+ const nextPassTime = new Date(now.getTime() + 90 * 60 * 1000);
212
+ document.getElementById('next-pass').textContent = `${nextPassTime.toLocaleTimeString()} (${Math.round(90 - (now.getMinutes() % 90))} min)`;
213
+
214
+ // Mettre à jour l'orbite sur le globe
215
+ updateOrbitPath();
216
+ }
217
+
218
+ // Fonction pour mettre à jour le chemin de l'orbite
219
+ function updateOrbitPath() {
220
+ if (issPositionHistory.length < 2) return;
221
+
222
+ // Créer un tableau de points pour l'orbite
223
+ const orbitPoints = issPositionHistory.map(pos => [pos.lat, pos.lng]);
224
+
225
+ // Mettre à jour le globe avec le nouveau chemin d'orbite
226
+ world.pathsData([{
227
+ points: orbitPoints,
228
+ color: 'rgba(255, 215, 0, 0.3)',
229
+ dashLength: 0.2,
230
+ dashGap: 0.01,
231
+ dashAnimateTime: 1000
232
+ }]);
233
+ }
234
+
235
+ // Fonction pour récupérer les données de l'ISS
236
+ async function fetchISSData() {
237
+ try {
238
+ // Récupérer la position actuelle
239
+ const positionResponse = await fetch('https://api.wheretheiss.at/v1/satellites/25544');
240
+ const positionData = await positionResponse.json();
241
+
242
+ // Mettre à jour la position
243
+ updateISSPosition(positionData.latitude, positionData.longitude);
244
+
245
+ // Récupérer les informations sur l'équipage (simulé)
246
+ setTimeout(() => {
247
+ const crewContainer = document.getElementById('crew-members');
248
+ crewContainer.innerHTML = `
249
+ <div class="flex items-center space-x-3">
250
+ <div class="w-8 h-8 rounded-full bg-slate-700"></div>
251
+ <div>
252
+ <p class="font-medium">Jasmin Moghbeli</p>
253
+ <p class="text-xs text-slate-400">Commandant (NASA)</p>
254
+ </div>
255
+ </div>
256
+ <div class="flex items-center space-x-3">
257
+ <div class="w-8 h-8 rounded-full bg-slate-700"></div>
258
+ <div>
259
+ <p class="font-medium">Andreas Mogensen</p>
260
+ <p class="text-xs text-slate-400">Ingénieur de vol (ESA)</p>
261
+ </div>
262
+ </div>
263
+ <div class="flex items-center space-x-3">
264
+ <div class="w-8 h-8 rounded-full bg-slate-700"></div>
265
+ <div>
266
+ <p class="font-medium">Satoshi Furukawa</p>
267
+ <p class="text-xs text-slate-400">Médecin (JAXA)</p>
268
+ </div>
269
+ </div>
270
+ <div class="flex items-center space-x-3">
271
+ <div class="w-8 h-8 rounded-full bg-slate-700"></div>
272
+ <div>
273
+ <p class="font-medium">Konstantin Borisov</p>
274
+ <p class="text-xs text-slate-400">Spécialiste (Roscosmos)</p>
275
+ </div>
276
+ </div>
277
+ `;
278
+ }, 1000);
279
+
280
+ } catch (error) {
281
+ console.error('Erreur lors de la récupération des données ISS:', error);
282
+ document.getElementById('iss-position').textContent = "Erreur de chargement";
283
+ document.getElementById('last-updated').textContent = "Erreur de connexion";
284
+ }
285
+ }
286
+
287
+ // Charger les données initiales
288
+ fetchISSData();
289
+
290
+ // Mettre à jour les données toutes les 5 secondes
291
+ setInterval(fetchISSData, 5000);
292
+
293
+ // Animation du globe
294
+ (function animate() {
295
+ world.controls().autoRotate = true;
296
+ world.controls().autoRotateSpeed = 0.3;
297
+ world.controls().enableZoom = true;
298
+ world.controls().enablePan = false;
299
+ world.controls().minDistance = 200;
300
+ world.controls().maxDistance = 1000;
301
+
302
+ requestAnimationFrame(animate);
303
+ })();
304
+ </script>
305
+ <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 <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=yaspred/iss" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
306
+ </html>