Spaces:
Running
Running
Can we add actual images of the moon phases or illustrations, please? - Initial Deployment
Browse files- README.md +7 -5
- index.html +382 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 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: test
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: yellow
|
| 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,382 @@
|
|
| 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>Space Dashboard - Moon Phases & Rocket Launches</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<script>
|
| 10 |
+
tailwind.config = {
|
| 11 |
+
theme: {
|
| 12 |
+
extend: {
|
| 13 |
+
colors: {
|
| 14 |
+
space: {
|
| 15 |
+
dark: '#0f172a',
|
| 16 |
+
light: '#1e293b',
|
| 17 |
+
accent: '#7c3aed',
|
| 18 |
+
}
|
| 19 |
+
}
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
}
|
| 23 |
+
</script>
|
| 24 |
+
<style>
|
| 25 |
+
.moon-phase {
|
| 26 |
+
transition: all 0.3s ease;
|
| 27 |
+
}
|
| 28 |
+
.moon-phase:hover {
|
| 29 |
+
transform: scale(1.05);
|
| 30 |
+
}
|
| 31 |
+
.launch-card {
|
| 32 |
+
transition: all 0.3s ease;
|
| 33 |
+
}
|
| 34 |
+
.launch-card:hover {
|
| 35 |
+
transform: translateY(-5px);
|
| 36 |
+
box-shadow: 0 10px 25px rgba(124, 58, 237, 0.3);
|
| 37 |
+
}
|
| 38 |
+
.animate-pulse-slow {
|
| 39 |
+
animation: pulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
| 40 |
+
}
|
| 41 |
+
@keyframes pulse {
|
| 42 |
+
0%, 100% {
|
| 43 |
+
opacity: 1;
|
| 44 |
+
}
|
| 45 |
+
50% {
|
| 46 |
+
opacity: 0.5;
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
</style>
|
| 50 |
+
</head>
|
| 51 |
+
<body class="bg-space-dark text-gray-100 min-h-screen">
|
| 52 |
+
<div class="container mx-auto px-4 py-8">
|
| 53 |
+
<!-- Header -->
|
| 54 |
+
<header class="flex flex-col md:flex-row justify-between items-center mb-12">
|
| 55 |
+
<div class="mb-4 md:mb-0">
|
| 56 |
+
<h1 class="text-3xl font-bold bg-gradient-to-r from-purple-500 to-indigo-600 bg-clip-text text-transparent">
|
| 57 |
+
<i class="fas fa-moon mr-2"></i>Space Dashboard
|
| 58 |
+
</h1>
|
| 59 |
+
<p class="text-sm text-gray-400">Track celestial events and space exploration</p>
|
| 60 |
+
</div>
|
| 61 |
+
<div id="location" class="bg-space-light px-4 py-2 rounded-lg flex items-center">
|
| 62 |
+
<i class="fas fa-map-marker-alt text-purple-500 mr-2"></i>
|
| 63 |
+
<span class="animate-pulse-slow">Detecting your location...</span>
|
| 64 |
+
</div>
|
| 65 |
+
</header>
|
| 66 |
+
|
| 67 |
+
<!-- Main Content -->
|
| 68 |
+
<main class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
| 69 |
+
<!-- Moon Phases Section -->
|
| 70 |
+
<section class="lg:col-span-2 bg-space-light rounded-xl p-6 shadow-lg">
|
| 71 |
+
<div class="flex justify-between items-center mb-6">
|
| 72 |
+
<h2 class="text-2xl font-semibold">
|
| 73 |
+
<i class="fas fa-moon mr-2 text-purple-500"></i>Moon Phases
|
| 74 |
+
</h2>
|
| 75 |
+
<div class="text-sm bg-purple-900 bg-opacity-50 px-3 py-1 rounded-full">
|
| 76 |
+
<span id="current-moon-phase">Loading...</span>
|
| 77 |
+
</div>
|
| 78 |
+
</div>
|
| 79 |
+
|
| 80 |
+
<div class="flex flex-col items-center mb-8">
|
| 81 |
+
<div id="current-moon-image" class="w-48 h-48 rounded-full mb-4 overflow-hidden">
|
| 82 |
+
<img src="https://svs.gsfc.nasa.gov/vis/a000000/a004700/a004720/phase0001_print.jpg" class="w-full h-full object-cover" id="moon-phase-image" alt="Current Moon Phase">
|
| 83 |
+
</div>
|
| 84 |
+
<h3 class="text-xl font-medium" id="current-phase-title">Current Moon Phase</h3>
|
| 85 |
+
</div>
|
| 86 |
+
|
| 87 |
+
<div class="grid grid-cols-4 md:grid-cols-8 gap-4 mb-8">
|
| 88 |
+
<div class="moon-phase flex flex-col items-center p-2 rounded-lg cursor-pointer hover:bg-space-dark">
|
| 89 |
+
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Moon_phases_en.jpg/120px-Moon_phases_en.jpg" class="w-12 h-12 rounded-full object-cover object-left" style="object-position: 0% 0%" alt="New Moon">
|
| 90 |
+
<span class="text-xs">New Moon</span>
|
| 91 |
+
</div>
|
| 92 |
+
<div class="moon-phase flex flex-col items-center p-2 rounded-lg cursor-pointer hover:bg-space-dark">
|
| 93 |
+
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Moon_phases_en.jpg/120px-Moon_phases_en.jpg" class="w-12 h-12 rounded-full object-cover object-left" style="object-position: 14.2857% 0%" alt="Waxing Crescent">
|
| 94 |
+
<span class="text-xs">Waxing Crescent</span>
|
| 95 |
+
</div>
|
| 96 |
+
<div class="moon-phase flex flex-col items-center p-2 rounded-lg cursor-pointer hover:bg-space-dark">
|
| 97 |
+
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Moon_phases_en.jpg/120px-Moon_phases_en.jpg" class="w-12 h-12 rounded-full object-cover object-left" style="object-position: 28.5714% 0%" alt="First Quarter">
|
| 98 |
+
<span class="text-xs">First Quarter</span>
|
| 99 |
+
</div>
|
| 100 |
+
<div class="moon-phase flex flex-col items-center p-2 rounded-lg cursor-pointer hover:bg-space-dark">
|
| 101 |
+
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Moon_phases_en.jpg/120px-Moon_phases_en.jpg" class="w-12 h-12 rounded-full object-cover object-left" style="object-position: 42.8571% 0%" alt="Waxing Gibbous">
|
| 102 |
+
<span class="text-xs">Waxing Gibbous</span>
|
| 103 |
+
</div>
|
| 104 |
+
<div class="moon-phase flex flex-col items-center p-2 rounded-lg cursor-pointer hover:bg-space-dark">
|
| 105 |
+
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Moon_phases_en.jpg/120px-Moon_phases_en.jpg" class="w-12 h-12 rounded-full object-cover object-left" style="object-position: 57.1428% 0%" alt="Full Moon">
|
| 106 |
+
<span class="text-xs">Full Moon</span>
|
| 107 |
+
</div>
|
| 108 |
+
<div class="moon-phase flex flex-col items-center p-2 rounded-lg cursor-pointer hover:bg-space-dark">
|
| 109 |
+
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Moon_phases_en.jpg/120px-Moon_phases_en.jpg" class="w-12 h-12 rounded-full object-cover object-left" style="object-position: 71.4285% 0%" alt="Waning Gibbous">
|
| 110 |
+
<span class="text-xs">Waning Gibbous</span>
|
| 111 |
+
</div>
|
| 112 |
+
<div class="moon-phase flex flex-col items-center p-2 rounded-lg cursor-pointer hover:bg-space-dark">
|
| 113 |
+
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Moon_phases_en.jpg/120px-Moon_phases_en.jpg" class="w-12 h-12 rounded-full object-cover object-left" style="object-position: 85.7142% 0%" alt="Last Quarter">
|
| 114 |
+
<span class="text-xs">Last Quarter</span>
|
| 115 |
+
</div>
|
| 116 |
+
<div class="moon-phase flex flex-col items-center p-2 rounded-lg cursor-pointer hover:bg-space-dark">
|
| 117 |
+
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Moon_phases_en.jpg/120px-Moon_phases_en.jpg" class="w-12 h-12 rounded-full object-cover object-left" style="object-position: 100% 0%" alt="Waning Crescent">
|
| 118 |
+
<span class="text-xs">Waning Crescent</span>
|
| 119 |
+
</div>
|
| 120 |
+
</div>
|
| 121 |
+
|
| 122 |
+
<div class="bg-space-dark rounded-lg p-4">
|
| 123 |
+
<h3 class="font-medium mb-2">Current Moon Information</h3>
|
| 124 |
+
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
|
| 125 |
+
<div class="bg-space-light p-3 rounded-lg">
|
| 126 |
+
<p class="text-xs text-gray-400">Illumination</p>
|
| 127 |
+
<p class="font-semibold" id="moon-illumination">--%</p>
|
| 128 |
+
</div>
|
| 129 |
+
<div class="bg-space-light p-3 rounded-lg">
|
| 130 |
+
<p class="text-xs text-gray-400">Age</p>
|
| 131 |
+
<p class="font-semibold" id="moon-age">-- days</p>
|
| 132 |
+
</div>
|
| 133 |
+
<div class="bg-space-light p-3 rounded-lg">
|
| 134 |
+
<p class="text-xs text-gray-400">Next Full Moon</p>
|
| 135 |
+
<p class="font-semibold" id="next-full-moon">-- days</p>
|
| 136 |
+
</div>
|
| 137 |
+
<div class="bg-space-light p-3 rounded-lg">
|
| 138 |
+
<p class="text-xs text-gray-400">Next New Moon</p>
|
| 139 |
+
<p class="font-semibold" id="next-new-moon">-- days</p>
|
| 140 |
+
</div>
|
| 141 |
+
</div>
|
| 142 |
+
</div>
|
| 143 |
+
</section>
|
| 144 |
+
|
| 145 |
+
<!-- Rocket Launches Section -->
|
| 146 |
+
<section class="bg-space-light rounded-xl p-6 shadow-lg">
|
| 147 |
+
<div class="flex justify-between items-center mb-6">
|
| 148 |
+
<h2 class="text-2xl font-semibold">
|
| 149 |
+
<i class="fas fa-rocket mr-2 text-purple-500"></i>Upcoming Launches
|
| 150 |
+
</h2>
|
| 151 |
+
<button id="refresh-launches" class="text-purple-500 hover:text-purple-400">
|
| 152 |
+
<i class="fas fa-sync-alt"></i>
|
| 153 |
+
</button>
|
| 154 |
+
</div>
|
| 155 |
+
|
| 156 |
+
<div id="launches-container" class="space-y-4">
|
| 157 |
+
<!-- Launch cards will be inserted here -->
|
| 158 |
+
<div class="launch-card bg-space-dark rounded-lg p-4 border-l-4 border-purple-500">
|
| 159 |
+
<div class="flex justify-between items-start mb-2">
|
| 160 |
+
<h3 class="font-medium">Loading launches...</h3>
|
| 161 |
+
<span class="text-xs bg-purple-900 bg-opacity-50 px-2 py-1 rounded-full">TBD</span>
|
| 162 |
+
</div>
|
| 163 |
+
<p class="text-sm text-gray-400 mb-3">Fetching launch data...</p>
|
| 164 |
+
<div class="flex items-center text-xs text-gray-400">
|
| 165 |
+
<i class="fas fa-map-marker-alt mr-1"></i>
|
| 166 |
+
<span>Unknown Launch Site</span>
|
| 167 |
+
</div>
|
| 168 |
+
</div>
|
| 169 |
+
</div>
|
| 170 |
+
|
| 171 |
+
<div class="mt-6 text-center">
|
| 172 |
+
<a href="https://www.rocketlaunch.live/" target="_blank" class="text-purple-500 hover:text-purple-400 text-sm inline-flex items-center">
|
| 173 |
+
View all launches <i class="fas fa-external-link-alt ml-1 text-xs"></i>
|
| 174 |
+
</a>
|
| 175 |
+
</div>
|
| 176 |
+
</section>
|
| 177 |
+
</main>
|
| 178 |
+
|
| 179 |
+
<!-- Footer -->
|
| 180 |
+
<footer class="mt-12 pt-6 border-t border-gray-800 text-center text-sm text-gray-500">
|
| 181 |
+
<p>Data provided by free APIs. Last updated: <span id="last-updated">Just now</span></p>
|
| 182 |
+
<p class="mt-1">© <span id="current-year"></span> Space Dashboard - Not affiliated with NASA or SpaceX</p>
|
| 183 |
+
</footer>
|
| 184 |
+
</div>
|
| 185 |
+
|
| 186 |
+
<script>
|
| 187 |
+
// Set current year in footer
|
| 188 |
+
document.getElementById('current-year').textContent = new Date().getFullYear();
|
| 189 |
+
|
| 190 |
+
// Get user's location
|
| 191 |
+
function getLocation() {
|
| 192 |
+
if (navigator.geolocation) {
|
| 193 |
+
navigator.geolocation.getCurrentPosition(
|
| 194 |
+
showPosition,
|
| 195 |
+
showError,
|
| 196 |
+
{ enableHighAccuracy: true, timeout: 10000 }
|
| 197 |
+
);
|
| 198 |
+
} else {
|
| 199 |
+
document.getElementById('location').innerHTML = '<i class="fas fa-map-marker-alt text-purple-500 mr-2"></i>Location not supported';
|
| 200 |
+
}
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
function showPosition(position) {
|
| 204 |
+
const latitude = position.coords.latitude.toFixed(4);
|
| 205 |
+
const longitude = position.coords.longitude.toFixed(4);
|
| 206 |
+
|
| 207 |
+
// Reverse geocoding would typically be done with a service like Google Maps API
|
| 208 |
+
// For this demo, we'll just show coordinates
|
| 209 |
+
// This would normally come from a reverse geocode API
|
| 210 |
+
const mockStates = ['Florida', 'California', 'Texas', 'New York', 'Hawaii'];
|
| 211 |
+
const userState = mockStates[Math.floor(Math.random() * mockStates.length)];
|
| 212 |
+
|
| 213 |
+
document.getElementById('location').innerHTML = `
|
| 214 |
+
<i class="fas fa-map-marker-alt text-purple-500 mr-2"></i>
|
| 215 |
+
<span>${userState}, USA</span>
|
| 216 |
+
`;
|
| 217 |
+
|
| 218 |
+
// Store state for launch filtering
|
| 219 |
+
window.userState = userState;
|
| 220 |
+
|
| 221 |
+
// Now that we have location, we can get more accurate moon data
|
| 222 |
+
updateMoonData(position.coords.latitude, position.coords.longitude);
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
function showError(error) {
|
| 226 |
+
let message = "Location access denied";
|
| 227 |
+
if (error.code === error.PERMISSION_DENIED) {
|
| 228 |
+
message = "Location access denied";
|
| 229 |
+
} else if (error.code === error.POSITION_UNAVAILABLE) {
|
| 230 |
+
message = "Location unavailable";
|
| 231 |
+
} else if (error.code === error.TIMEOUT) {
|
| 232 |
+
message = "Location request timed out";
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
document.getElementById('location').innerHTML = `
|
| 236 |
+
<i class="fas fa-map-marker-alt text-purple-500 mr-2"></i>
|
| 237 |
+
<span>${message}</span>
|
| 238 |
+
`;
|
| 239 |
+
|
| 240 |
+
// Use default coordinates if location access is denied
|
| 241 |
+
updateMoonData(0, 0);
|
| 242 |
+
}
|
| 243 |
+
|
| 244 |
+
// Moon phase calculation
|
| 245 |
+
function updateMoonData(lat, lon) {
|
| 246 |
+
// In a real app, you would call an API with the coordinates
|
| 247 |
+
// For this demo, we'll use static data
|
| 248 |
+
|
| 249 |
+
// Simulate API delay
|
| 250 |
+
setTimeout(() => {
|
| 251 |
+
const phases = ["New Moon", "Waxing Crescent", "First Quarter", "Waxing Gibbous",
|
| 252 |
+
"Full Moon", "Waning Gibbous", "Last Quarter", "Waning Crescent"];
|
| 253 |
+
const currentPhase = phases[Math.floor(Math.random() * phases.length)];
|
| 254 |
+
|
| 255 |
+
document.getElementById('current-moon-phase').textContent = currentPhase;
|
| 256 |
+
document.getElementById('current-phase-title').textContent = currentPhase;
|
| 257 |
+
document.getElementById('moon-illumination').textContent = `${Math.floor(Math.random() * 100)}%`;
|
| 258 |
+
document.getElementById('moon-age').textContent = `${Math.floor(Math.random() * 29.5)} days`;
|
| 259 |
+
document.getElementById('next-full-moon').textContent = `${Math.floor(Math.random() * 14)} days`;
|
| 260 |
+
document.getElementById('next-new-moon').textContent = `${Math.floor(Math.random() * 14)} days`;
|
| 261 |
+
|
| 262 |
+
// Update moon image based on phase
|
| 263 |
+
const moonImage = document.getElementById('moon-phase-image');
|
| 264 |
+
const phasePositions = {
|
| 265 |
+
"New Moon": "0%",
|
| 266 |
+
"Waxing Crescent": "14.2857%",
|
| 267 |
+
"First Quarter": "28.5714%",
|
| 268 |
+
"Waxing Gibbous": "42.8571%",
|
| 269 |
+
"Full Moon": "57.1428%",
|
| 270 |
+
"Waning Gibbous": "71.4285%",
|
| 271 |
+
"Last Quarter": "85.7142%",
|
| 272 |
+
"Waning Crescent": "100%"
|
| 273 |
+
};
|
| 274 |
+
|
| 275 |
+
moonImage.style.objectPosition = `${phasePositions[currentPhase]} 0%`;
|
| 276 |
+
}, 1000);
|
| 277 |
+
}
|
| 278 |
+
|
| 279 |
+
// Fetch rocket launches
|
| 280 |
+
function fetchLaunches() {
|
| 281 |
+
// In a real app, you would call the Launch Library API or similar
|
| 282 |
+
// For this demo, we'll use mock data
|
| 283 |
+
|
| 284 |
+
// Simulate API delay
|
| 285 |
+
setTimeout(() => {
|
| 286 |
+
const mockLaunches = [
|
| 287 |
+
{
|
| 288 |
+
name: "SpaceX Falcon 9 • Starlink Group 6-50",
|
| 289 |
+
date: "2023-11-15T23:00:00Z",
|
| 290 |
+
site: "Cape Canaveral SFS, Florida, USA",
|
| 291 |
+
status: "Go for Launch"
|
| 292 |
+
},
|
| 293 |
+
{
|
| 294 |
+
name: "ULA Atlas V • USSF-52",
|
| 295 |
+
date: "2023-12-07T14:00:00Z",
|
| 296 |
+
site: "Cape Canaveral SFS, Florida, USA",
|
| 297 |
+
status: "On Schedule"
|
| 298 |
+
},
|
| 299 |
+
{
|
| 300 |
+
name: "Ariane 5 • Galileo FOC FM25 & FM27",
|
| 301 |
+
date: "2023-11-24T13:00:00Z",
|
| 302 |
+
site: "Kourou, French Guiana",
|
| 303 |
+
status: "On Schedule"
|
| 304 |
+
},
|
| 305 |
+
{
|
| 306 |
+
name: "Rocket Lab Electron • The Moon God Awakens",
|
| 307 |
+
date: "2023-12-01T05:00:00Z",
|
| 308 |
+
site: "Mahia Peninsula, New Zealand",
|
| 309 |
+
status: "On Schedule"
|
| 310 |
+
}
|
| 311 |
+
];
|
| 312 |
+
|
| 313 |
+
const container = document.getElementById('launches-container');
|
| 314 |
+
container.innerHTML = '';
|
| 315 |
+
|
| 316 |
+
const filteredLaunches = mockLaunches.filter(launch => {
|
| 317 |
+
return window.userState && launch.site.includes(window.userState);
|
| 318 |
+
});
|
| 319 |
+
|
| 320 |
+
if (filteredLaunches.length === 0) {
|
| 321 |
+
const container = document.getElementById('launches-container');
|
| 322 |
+
container.innerHTML = `
|
| 323 |
+
<div class="launch-card bg-space-dark rounded-lg p-4 border-l-4 border-purple-500">
|
| 324 |
+
<div class="flex justify-between items-start mb-2">
|
| 325 |
+
<h3 class="font-medium">No upcoming launches in ${window.userState}</h3>
|
| 326 |
+
</div>
|
| 327 |
+
<p class="text-sm text-gray-400 mb-3">Check back later for updates</p>
|
| 328 |
+
</div>
|
| 329 |
+
`;
|
| 330 |
+
return;
|
| 331 |
+
}
|
| 332 |
+
|
| 333 |
+
filteredLaunches.forEach(launch => {
|
| 334 |
+
const launchDate = new Date(launch.date);
|
| 335 |
+
const now = new Date();
|
| 336 |
+
const daysUntil = Math.ceil((launchDate - now) / (1000 * 60 * 60 * 24));
|
| 337 |
+
|
| 338 |
+
let statusClass = "bg-gray-700";
|
| 339 |
+
if (launch.status.includes("Go")) statusClass = "bg-green-700";
|
| 340 |
+
else if (launch.status.includes("Schedule")) statusClass = "bg-blue-700";
|
| 341 |
+
|
| 342 |
+
const card = document.createElement('div');
|
| 343 |
+
card.className = 'launch-card bg-space-dark rounded-lg p-4 border-l-4 border-purple-500 mb-4';
|
| 344 |
+
card.innerHTML = `
|
| 345 |
+
<div class="flex justify-between items-start mb-2">
|
| 346 |
+
<h3 class="font-medium">${launch.name}</h3>
|
| 347 |
+
<span class="text-xs ${statusClass} bg-opacity-50 px-2 py-1 rounded-full">${daysUntil}d</span>
|
| 348 |
+
</div>
|
| 349 |
+
<p class="text-sm text-gray-400 mb-3">${launchDate.toLocaleString()}</p>
|
| 350 |
+
<div class="flex items-center text-xs text-gray-400">
|
| 351 |
+
<i class="fas fa-map-marker-alt mr-1"></i>
|
| 352 |
+
<span>${launch.site}</span>
|
| 353 |
+
</div>
|
| 354 |
+
`;
|
| 355 |
+
|
| 356 |
+
container.appendChild(card);
|
| 357 |
+
});
|
| 358 |
+
|
| 359 |
+
document.getElementById('last-updated').textContent = new Date().toLocaleString();
|
| 360 |
+
}, 1500);
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
+
// Refresh launches button
|
| 364 |
+
document.getElementById('refresh-launches').addEventListener('click', fetchLaunches);
|
| 365 |
+
|
| 366 |
+
// Initialize everything when page loads
|
| 367 |
+
window.addEventListener('load', () => {
|
| 368 |
+
getLocation();
|
| 369 |
+
fetchLaunches();
|
| 370 |
+
|
| 371 |
+
// Set up moon phase click events
|
| 372 |
+
document.querySelectorAll('.moon-phase').forEach((phase, index) => {
|
| 373 |
+
phase.addEventListener('click', () => {
|
| 374 |
+
const phases = ["New Moon", "Waxing Crescent", "First Quarter", "Waxing Gibbous",
|
| 375 |
+
"Full Moon", "Waning Gibbous", "Last Quarter", "Waning Crescent"];
|
| 376 |
+
document.getElementById('current-moon-phase').textContent = phases[index];
|
| 377 |
+
});
|
| 378 |
+
});
|
| 379 |
+
});
|
| 380 |
+
</script>
|
| 381 |
+
<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=drbaker171/test" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 382 |
+
</html>
|