Download index.html from LuHof/testspace: direct link, hf CLI and curl.
- Browser
- Download file 32.4 kB
-
https://huggingface.co/spaces/LuHof/testspace/resolve/main/index.html
- Command line
-
hf download hf://spaces/LuHof/testspace/index.html
-
curl -L -o index.html https://huggingface.co/spaces/LuHof/testspace/resolve/main/index.html
32.4 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Live Satellite Imagery Viewer</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <script src="https://cdn.jsdelivr.net/npm/leaflet@1.9.4/dist/leaflet.js"></script> | |
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.9.4/dist/leaflet.css"> | |
| <style> | |
| #map { | |
| height: 70vh; | |
| width: 100%; | |
| border-radius: 0.5rem; | |
| box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); | |
| } | |
| .satellite-layer { | |
| filter: brightness(1.1) contrast(1.1); | |
| } | |
| .timeline-container { | |
| scrollbar-width: thin; | |
| scrollbar-color: #4b5563 #1f2937; | |
| } | |
| .timeline-container::-webkit-scrollbar { | |
| height: 8px; | |
| } | |
| .timeline-container::-webkit-scrollbar-track { | |
| background: #1f2937; | |
| border-radius: 10px; | |
| } | |
| .timeline-container::-webkit-scrollbar-thumb { | |
| background-color: #4b5563; | |
| border-radius: 10px; | |
| } | |
| .loading-spinner { | |
| border-top-color: #3b82f6; | |
| animation: spin 1s linear infinite; | |
| } | |
| @keyframes spin { | |
| 0% { transform: rotate(0deg); } | |
| 100% { transform: rotate(360deg); } | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-900 text-gray-100"> | |
| <div class="container mx-auto px-4 py-8"> | |
| <!-- Header --> | |
| <header class="mb-8"> | |
| <div class="flex justify-between items-center"> | |
| <div> | |
| <h1 class="text-3xl font-bold text-blue-400">OrbitView</h1> | |
| <p class="text-gray-400">Live & Historical Satellite Imagery Platform</p> | |
| </div> | |
| <div class="flex items-center space-x-4"> | |
| <button id="loginBtn" class="px-4 py-2 bg-blue-600 hover:bg-blue-700 rounded-lg transition"> | |
| <i class="fas fa-sign-in-alt mr-2"></i>Sign In | |
| </button> | |
| <button class="px-4 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg transition"> | |
| <i class="fas fa-question-circle mr-2"></i>Help | |
| </button> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Main Content --> | |
| <main> | |
| <!-- Search and Controls --> | |
| <div class="grid grid-cols-1 lg:grid-cols-4 gap-6 mb-6"> | |
| <!-- Search Box --> | |
| <div class="lg:col-span-3 bg-gray-800 p-4 rounded-lg"> | |
| <div class="flex"> | |
| <input type="text" id="locationSearch" placeholder="Search location or coordinates (e.g., 52.52, 13.41)" | |
| class="flex-grow px-4 py-2 bg-gray-700 rounded-l-lg focus:outline-none focus:ring-2 focus:ring-blue-500"> | |
| <button id="searchBtn" class="px-4 py-2 bg-blue-600 hover:bg-blue-700 rounded-r-lg transition"> | |
| <i class="fas fa-search"></i> | |
| </button> | |
| </div> | |
| <div class="mt-4 grid grid-cols-2 md:grid-cols-4 gap-3"> | |
| <button data-location="europe" class="px-3 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg text-sm flex items-center justify-center"> | |
| <i class="fas fa-globe-europe mr-2"></i>Europe | |
| </button> | |
| <button data-location="north-america" class="px-3 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg text-sm flex items-center justify-center"> | |
| <i class="fas fa-globe-americas mr-2"></i>North America | |
| </button> | |
| <button data-location="asia" class="px-3 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg text-sm flex items-center justify-center"> | |
| <i class="fas fa-globe-asia mr-2"></i>Asia | |
| </button> | |
| <button id="currentLocationBtn" class="px-3 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg text-sm flex items-center justify-center"> | |
| <i class="fas fa-crosshairs mr-2"></i>My Location | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Date and Provider Selection --> | |
| <div class="bg-gray-800 p-4 rounded-lg"> | |
| <div class="mb-4"> | |
| <label class="block text-sm font-medium mb-1">Date Range</label> | |
| <div class="flex"> | |
| <input type="date" id="startDate" class="flex-grow px-2 py-1 bg-gray-700 rounded-l-lg text-sm"> | |
| <input type="date" id="endDate" class="flex-grow px-2 py-1 bg-gray-700 rounded-r-lg text-sm"> | |
| </div> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium mb-1">Imagery Source</label> | |
| <select id="providerSelect" class="w-full px-2 py-1 bg-gray-700 rounded-lg text-sm"> | |
| <option value="maxar">Maxar (Premium)</option> | |
| <option value="planet">Planet Labs</option> | |
| <option value="sentinel">Sentinel-2</option> | |
| <option value="landsat">Landsat 9</option> | |
| <option value="up42">UP42 Marketplace</option> | |
| </select> | |
| </div> | |
| <button id="applyBtn" class="mt-4 w-full py-2 bg-blue-600 hover:bg-blue-700 rounded-lg transition"> | |
| <i class="fas fa-sync-alt mr-2"></i>Apply Filters | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Map Container --> | |
| <div class="relative mb-6"> | |
| <div id="map"></div> | |
| <div id="loadingOverlay" class="absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden"> | |
| <div class="loading-spinner h-12 w-12 border-4 border-gray-600 rounded-full"></div> | |
| </div> | |
| </div> | |
| <!-- Timeline --> | |
| <div class="bg-gray-800 p-4 rounded-lg mb-6"> | |
| <h3 class="text-lg font-medium mb-3">Historical Timeline</h3> | |
| <div class="timeline-container overflow-x-auto pb-2"> | |
| <div id="timelineItems" class="flex space-x-2" style="min-width: max-content;"> | |
| <!-- Timeline items will be added here dynamically --> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Imagery Details --> | |
| <div class="grid grid-cols-1 lg:grid-cols-3 gap-6"> | |
| <!-- Current Image Details --> | |
| <div class="bg-gray-800 p-4 rounded-lg"> | |
| <h3 class="text-lg font-medium mb-3">Current Image Details</h3> | |
| <div class="space-y-2"> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-400">Provider:</span> | |
| <span id="currentProvider" class="font-medium">Maxar</span> | |
| </div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-400">Resolution:</span> | |
| <span id="currentResolution" class="font-medium">0.3m</span> | |
| </div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-400">Capture Date:</span> | |
| <span id="currentDate" class="font-medium">2023-06-15</span> | |
| </div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-400">Cloud Cover:</span> | |
| <span id="currentCloudCover" class="font-medium">5%</span> | |
| </div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-400">Coordinates:</span> | |
| <span id="currentCoords" class="font-medium">52.52, 13.41</span> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Analysis Tools --> | |
| <div class="bg-gray-800 p-4 rounded-lg"> | |
| <h3 class="text-lg font-medium mb-3">Analysis Tools</h3> | |
| <div class="grid grid-cols-2 gap-3"> | |
| <button class="px-3 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg text-sm flex items-center justify-center"> | |
| <i class="fas fa-ruler-combined mr-2"></i>Measure | |
| </button> | |
| <button class="px-3 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg text-sm flex items-center justify-center"> | |
| <i class="fas fa-layer-group mr-2"></i>Compare | |
| </button> | |
| <button class="px-3 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg text-sm flex items-center justify-center"> | |
| <i class="fas fa-chart-line mr-2"></i>NDVI | |
| </button> | |
| <button class="px-3 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg text-sm flex items-center justify-center"> | |
| <i class="fas fa-water mr-2"></i>Water Mask | |
| </button> | |
| </div> | |
| <div class="mt-4"> | |
| <label class="block text-sm font-medium mb-1">Image Enhancement</label> | |
| <select id="enhancementSelect" class="w-full px-2 py-1 bg-gray-700 rounded-lg text-sm"> | |
| <option value="natural">Natural Color</option> | |
| <option value="urban">False Color (Urban)</option> | |
| <option value="vegetation">Vegetation Analysis</option> | |
| <option value="atmospheric">Atmospheric Penetration</option> | |
| </select> | |
| </div> | |
| </div> | |
| <!-- Order Options --> | |
| <div class="bg-gray-800 p-4 rounded-lg"> | |
| <h3 class="text-lg font-medium mb-3">Order Options</h3> | |
| <div class="space-y-3"> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <div class="font-medium">High-Res Download</div> | |
| <div class="text-sm text-gray-400">GeoTIFF format</div> | |
| </div> | |
| <button class="px-3 py-1 bg-blue-600 hover:bg-blue-700 rounded-lg text-sm"> | |
| $49.99 | |
| </button> | |
| </div> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <div class="font-medium">Time Series Analysis</div> | |
| <div class="text-sm text-gray-400">5-image package</div> | |
| </div> | |
| <button class="px-3 py-1 bg-blue-600 hover:bg-blue-700 rounded-lg text-sm"> | |
| $199.99 | |
| </button> | |
| </div> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <div class="font-medium">UP42 API Access</div> | |
| <div class="text-sm text-gray-400">Monthly subscription</div> | |
| </div> | |
| <button class="px-3 py-1 bg-blue-600 hover:bg-blue-700 rounded-lg text-sm"> | |
| $299.99/mo | |
| </button> | |
| </div> | |
| <button id="addToCartBtn" class="w-full py-2 bg-green-600 hover:bg-green-700 rounded-lg transition mt-2"> | |
| <i class="fas fa-shopping-cart mr-2"></i>Add to Cart | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </main> | |
| <!-- Footer --> | |
| <footer class="mt-12 pt-6 border-t border-gray-800"> | |
| <div class="grid grid-cols-1 md:grid-cols-4 gap-8"> | |
| <div> | |
| <h4 class="text-lg font-medium mb-3">OrbitView</h4> | |
| <p class="text-gray-400 text-sm">The premier platform for accessing live and historical satellite imagery from leading providers worldwide.</p> | |
| </div> | |
| <div> | |
| <h4 class="text-lg font-medium mb-3">Providers</h4> | |
| <ul class="space-y-2 text-gray-400 text-sm"> | |
| <li><a href="https://www.maxar.com/" target="_blank" class="hover:text-blue-400">Maxar</a></li> | |
| <li><a href="https://www.planet.com/" target="_blank" class="hover:text-blue-400">Planet Labs</a></li> | |
| <li><a href="https://www.sentinel-hub.com/" target="_blank" class="hover:text-blue-400">Sentinel Hub</a></li> | |
| <li><a href="https://up42.com/" target="_blank" class="hover:text-blue-400">UP42 Marketplace</a></li> | |
| </ul> | |
| </div> | |
| <div> | |
| <h4 class="text-lg font-medium mb-3">Resources</h4> | |
| <ul class="space-y-2 text-gray-400 text-sm"> | |
| <li><a href="https://developers.planet.com/docs/" target="_blank" class="hover:text-blue-400">API Documentation</a></li> | |
| <li><a href="https://www.satimagingcorp.com/satellite-sensors/" target="_blank" class="hover:text-blue-400">Satellite Sensors</a></li> | |
| <li><a href="https://earthdata.nasa.gov/learn" target="_blank" class="hover:text-blue-400">NASA Earthdata</a></li> | |
| <li><a href="https://eos.com/blog/satellite-imagery/" target="_blank" class="hover:text-blue-400">Imagery Blog</a></li> | |
| </ul> | |
| </div> | |
| <div> | |
| <h4 class="text-lg font-medium mb-3">Contact</h4> | |
| <ul class="space-y-2 text-gray-400 text-sm"> | |
| <li><i class="fas fa-envelope mr-2"></i> support@orbitview.com</li> | |
| <li><i class="fas fa-phone mr-2"></i> +1 (555) 123-4567</li> | |
| <li><i class="fas fa-map-marker-alt mr-2"></i> San Francisco, CA</li> | |
| <li class="flex space-x-4 mt-4"> | |
| <a href="#"><i class="fab fa-twitter text-xl hover:text-blue-400"></i></a> | |
| <a href="#"><i class="fab fa-linkedin text-xl hover:text-blue-400"></i></a> | |
| <a href="#"><i class="fab fa-github text-xl hover:text-blue-400"></i></a> | |
| </li> | |
| </ul> | |
| </div> | |
| </div> | |
| <div class="mt-8 text-center text-gray-500 text-sm"> | |
| <p>© 2023 OrbitView. All rights reserved. | <a href="#" class="hover:text-blue-400">Privacy Policy</a> | <a href="#" class="hover:text-blue-400">Terms of Service</a></p> | |
| </div> | |
| </footer> | |
| </div> | |
| <!-- Login Modal --> | |
| <div id="loginModal" class="fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50 hidden"> | |
| <div class="bg-gray-800 rounded-lg p-6 w-full max-w-md"> | |
| <div class="flex justify-between items-center mb-4"> | |
| <h3 class="text-xl font-bold">Sign In</h3> | |
| <button id="closeModal" class="text-gray-400 hover:text-white"> | |
| <i class="fas fa-times"></i> | |
| </button> | |
| </div> | |
| <form> | |
| <div class="mb-4"> | |
| <label class="block text-sm font-medium mb-1">Email</label> | |
| <input type="email" class="w-full px-3 py-2 bg-gray-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"> | |
| </div> | |
| <div class="mb-4"> | |
| <label class="block text-sm font-medium mb-1">Password</label> | |
| <input type="password" class="w-full px-3 py-2 bg-gray-700 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"> | |
| </div> | |
| <div class="flex items-center justify-between mb-4"> | |
| <div class="flex items-center"> | |
| <input type="checkbox" id="rememberMe" class="mr-2"> | |
| <label for="rememberMe" class="text-sm">Remember me</label> | |
| </div> | |
| <a href="#" class="text-sm text-blue-400 hover:underline">Forgot password?</a> | |
| </div> | |
| <button type="submit" class="w-full py-2 bg-blue-600 hover:bg-blue-700 rounded-lg transition"> | |
| Sign In | |
| </button> | |
| </form> | |
| <div class="mt-4 text-center text-sm"> | |
| <p>Don't have an account? <a href="#" class="text-blue-400 hover:underline">Sign up</a></p> | |
| </div> | |
| <div class="mt-6 pt-4 border-t border-gray-700"> | |
| <p class="text-xs text-gray-400">By signing in, you agree to our <a href="#" class="text-blue-400 hover:underline">Terms of Service</a> and <a href="#" class="text-blue-400 hover:underline">Privacy Policy</a>.</p> | |
| </div> | |
| </div> | |
| </div> | |
| <script> | |
| // Initialize map | |
| const map = L.map('map').setView([52.52, 13.41], 12); | |
| // Add base layer | |
| L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { | |
| attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' | |
| }).addTo(map); | |
| // Satellite layers from different providers | |
| const satelliteLayers = { | |
| maxar: L.tileLayer('https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', { | |
| attribution: 'Tiles © Esri — Source: Esri, Maxar, Earthstar Geographics', | |
| className: 'satellite-layer' | |
| }), | |
| planet: L.tileLayer('https://tiles.planet.com/basemaps/v1/planet-tiles/global_monthly_{month}_{year}_mosaic/gmap/{z}/{x}/{y}.png?api_key=YOUR_PLANET_API_KEY', { | |
| attribution: '© Planet Labs', | |
| className: 'satellite-layer' | |
| }), | |
| sentinel: L.tileLayer('https://tiles.maps.eox.at/wmts/1.0.0/s2cloudless-2020_3857/default/g/{z}/{y}/{x}.jpg', { | |
| attribution: 'Contains modified Copernicus Sentinel data 2020', | |
| className: 'satellite-layer' | |
| }), | |
| landsat: L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/Landsat/World_NDVI/MapServer/tile/{z}/{y}/{x}', { | |
| attribution: 'Source: USGS/NASA Landsat', | |
| className: 'satellite-layer' | |
| }), | |
| up42: L.tileLayer('https://tiles.up42.com/up42-ogc/wmts/1.0.0/ortho_30cm/{z}/{y}/{x}.png?token=YOUR_UP42_TOKEN', { | |
| attribution: '© UP42', | |
| className: 'satellite-layer' | |
| }) | |
| }; | |
| // Add default layer | |
| satelliteLayers.maxar.addTo(map); | |
| let currentLayer = 'maxar'; | |
| // Modal functionality | |
| const loginBtn = document.getElementById('loginBtn'); | |
| const loginModal = document.getElementById('loginModal'); | |
| const closeModal = document.getElementById('closeModal'); | |
| loginBtn.addEventListener('click', () => { | |
| loginModal.classList.remove('hidden'); | |
| }); | |
| closeModal.addEventListener('click', () => { | |
| loginModal.classList.add('hidden'); | |
| }); | |
| // Search functionality | |
| const searchBtn = document.getElementById('searchBtn'); | |
| const locationSearch = document.getElementById('locationSearch'); | |
| const currentLocationBtn = document.getElementById('currentLocationBtn'); | |
| // Quick location buttons | |
| document.querySelectorAll('[data-location]').forEach(btn => { | |
| btn.addEventListener('click', () => { | |
| const location = btn.dataset.location; | |
| let coords, zoom; | |
| switch(location) { | |
| case 'europe': | |
| coords = [48.8566, 2.3522]; // Paris | |
| zoom = 5; | |
| break; | |
| case 'north-america': | |
| coords = [40.7128, -74.0060]; // New York | |
| zoom = 4; | |
| break; | |
| case 'asia': | |
| coords = [35.6762, 139.6503]; // Tokyo | |
| zoom = 4; | |
| break; | |
| } | |
| map.setView(coords, zoom); | |
| updateImageDetails('Maxar', '0.3m', getCurrentDate(), '5%', `${coords[0].toFixed(2)}, ${coords[1].toFixed(2)}`); | |
| updateTimeline(coords); | |
| }); | |
| }); | |
| // Current location button | |
| currentLocationBtn.addEventListener('click', () => { | |
| if (navigator.geolocation) { | |
| const loadingOverlay = document.getElementById('loadingOverlay'); | |
| loadingOverlay.classList.remove('hidden'); | |
| navigator.geolocation.getCurrentPosition( | |
| position => { | |
| const coords = [position.coords.latitude, position.coords.longitude]; | |
| map.setView(coords, 15); | |
| updateImageDetails('Maxar', '0.3m', getCurrentDate(), '5%', `${coords[0].toFixed(2)}, ${coords[1].toFixed(2)}`); | |
| updateTimeline(coords); | |
| loadingOverlay.classList.add('hidden'); | |
| }, | |
| error => { | |
| alert('Could not get your location: ' + error.message); | |
| loadingOverlay.classList.add('hidden'); | |
| } | |
| ); | |
| } else { | |
| alert('Geolocation is not supported by your browser'); | |
| } | |
| }); | |
| searchBtn.addEventListener('click', () => { | |
| const query = locationSearch.value.trim(); | |
| if (query) { | |
| const loadingOverlay = document.getElementById('loadingOverlay'); | |
| loadingOverlay.classList.remove('hidden'); | |
| if (query.includes(',')) { | |
| // Handle coordinates | |
| const [lat, lng] = query.split(',').map(coord => parseFloat(coord.trim())); | |
| if (!isNaN(lat) && !isNaN(lng)) { | |
| map.setView([lat, lng], 15); | |
| updateImageDetails('Maxar', '0.3m', getCurrentDate(), '5%', `${lat.toFixed(2)}, ${lng.toFixed(2)}`); | |
| updateTimeline([lat, lng]); | |
| } | |
| } else { | |
| // Handle place names using Nominatim API | |
| fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(query)}`) | |
| .then(response => response.json()) | |
| .then(data => { | |
| if (data.length > 0) { | |
| const result = data[0]; | |
| const coords = [parseFloat(result.lat), parseFloat(result.lon)]; | |
| map.setView(coords, 12); | |
| updateImageDetails('Maxar', '0.3m', getCurrentDate(), '5%', `${coords[0].toFixed(2)}, ${coords[1].toFixed(2)}`); | |
| updateTimeline(coords); | |
| } else { | |
| alert('Location not found'); | |
| } | |
| }) | |
| .catch(error => { | |
| console.error('Error fetching location:', error); | |
| alert('Error searching for location'); | |
| }) | |
| .finally(() => { | |
| loadingOverlay.classList.add('hidden'); | |
| }); | |
| } | |
| } | |
| }); | |
| // Provider selection | |
| const providerSelect = document.getElementById('providerSelect'); | |
| const applyBtn = document.getElementById('applyBtn'); | |
| applyBtn.addEventListener('click', () => { | |
| const provider = providerSelect.value; | |
| const loadingOverlay = document.getElementById('loadingOverlay'); | |
| loadingOverlay.classList.remove('hidden'); | |
| // Remove current layer | |
| satelliteLayers[currentLayer].remove(); | |
| // Add new layer | |
| satelliteLayers[provider].addTo(map); | |
| currentLayer = provider; | |
| // Update details based on provider | |
| const center = map.getCenter(); | |
| let resolution, cloudCover; | |
| switch(provider) { | |
| case 'maxar': | |
| resolution = '0.3m'; | |
| cloudCover = '5%'; | |
| break; | |
| case 'planet': | |
| resolution = '0.5m'; | |
| cloudCover = '15%'; | |
| break; | |
| case 'sentinel': | |
| resolution = '10m'; | |
| cloudCover = '20%'; | |
| break; | |
| case 'landsat': | |
| resolution = '15m'; | |
| cloudCover = '8%'; | |
| break; | |
| case 'up42': | |
| resolution = '0.5m'; | |
| cloudCover = '12%'; | |
| break; | |
| } | |
| updateImageDetails( | |
| provider.charAt(0).toUpperCase() + provider.slice(1), | |
| resolution, | |
| getCurrentDate(), | |
| cloudCover, | |
| `${center.lat.toFixed(2)}, ${center.lng.toFixed(2)}` | |
| ); | |
| loadingOverlay.classList.add('hidden'); | |
| }); | |
| // Image enhancement | |
| const enhancementSelect = document.getElementById('enhancementSelect'); | |
| enhancementSelect.addEventListener('change', () => { | |
| const enhancement = enhancementSelect.value; | |
| const layer = document.querySelector('.satellite-layer'); | |
| switch(enhancement) { | |
| case 'natural': | |
| layer.style.filter = 'brightness(1.1) contrast(1.1)'; | |
| break; | |
| case 'urban': | |
| layer.style.filter = 'brightness(1.2) contrast(1.2) saturate(1.5)'; | |
| break; | |
| case 'vegetation': | |
| layer.style.filter = 'brightness(1.1) contrast(1.3) hue-rotate(90deg)'; | |
| break; | |
| case 'atmospheric': | |
| layer.style.filter = 'brightness(1.3) contrast(1.3)'; | |
| break; | |
| } | |
| }); | |
| // Update image details panel | |
| function updateImageDetails(provider, resolution, date, cloudCover, coords) { | |
| document.getElementById('currentProvider').textContent = provider; | |
| document.getElementById('currentResolution').textContent = resolution; | |
| document.getElementById('currentDate').textContent = date; | |
| document.getElementById('currentCloudCover').textContent = cloudCover; | |
| document.getElementById('currentCoords').textContent = coords; | |
| } | |
| // Update timeline with historical images | |
| function updateTimeline(coords) { | |
| const timelineItems = document.getElementById('timelineItems'); | |
| timelineItems.innerHTML = ''; | |
| // Generate 5 historical dates | |
| const dates = []; | |
| const today = new Date(); | |
| for (let i = 0; i < 5; i++) { | |
| const date = new Date(today); | |
| date.setMonth(date.getMonth() - (i * 2)); | |
| dates.push(date.toISOString().split('T')[0]); | |
| } | |
| // Add timeline items | |
| dates.forEach((date, index) => { | |
| const provider = ['Maxar', 'Planet', 'Sentinel-2', 'Landsat 9', 'UP42'][index]; | |
| const resolution = ['0.3m', '0.5m', '10m', '15m', '0.5m'][index]; | |
| const cloudCover = ['5%', '15%', '20%', '8%', '12%'][index]; | |
| const item = document.createElement('div'); | |
| item.className = 'timeline-item flex-shrink-0 w-32 h-24 bg-gray-700 rounded-lg overflow-hidden relative cursor-pointer hover:ring-2 hover:ring-blue-500'; | |
| // Generate thumbnail URL based on provider | |
| let thumbnailUrl; | |
| if (provider === 'Maxar') { | |
| thumbnailUrl = `https://maps.googleapis.com/maps/api/staticmap?center=${coords[0]},${coords[1]}&zoom=14&size=300x200&maptype=satellite&key=YOUR_GOOGLE_API_KEY`; | |
| } else if (provider === 'Planet') { | |
| thumbnailUrl = `https://tiles.planet.com/basemaps/v1/planet-tiles/global_monthly_${date.substring(5,7)}_${date.substring(0,4)}_mosaic/thumb/{z}/{x}/{y}.png?api_key=YOUR_PLANET_API_KEY`; | |
| } else { | |
| // Fallback to generic placeholder | |
| thumbnailUrl = `https://maps.googleapis.com/maps/api/staticmap?center=${coords[0]},${coords[1]}&zoom=14&size=300x200&maptype=satellite&key=YOUR_GOOGLE_API_KEY`; | |
| } | |
| item.innerHTML = ` | |
| <img src="${thumbnailUrl}" class="w-full h-full object-cover"> | |
| <div class="absolute bottom-0 left-0 right-0 bg-black bg-opacity-70 p-1 text-xs"> | |
| <div>${provider} • ${date}</div> | |
| </div> | |
| `; | |
| item.addEventListener('click', () => { | |
| // When clicked, update the main map view | |
| map.setView(coords, 14); | |
| updateImageDetails(provider, resolution, date, cloudCover, `${coords[0].toFixed(2)}, ${coords[1].toFixed(2)}`); | |
| }); | |
| timelineItems.appendChild(item); | |
| }); | |
| } | |
| // Get current date in YYYY-MM-DD format | |
| function getCurrentDate() { | |
| const today = new Date(); | |
| return today.toISOString().split('T')[0]; | |
| } | |
| // Initialize with default values | |
| updateImageDetails('Maxar', '0.3m', getCurrentDate(), '5%', '52.52, 13.41'); | |
| updateTimeline([52.52, 13.41]); | |
| // Set today's date as default | |
| document.getElementById('startDate').value = getCurrentDate(); | |
| document.getElementById('endDate').value = getCurrentDate(); | |
| // Add to cart functionality | |
| document.getElementById('addToCartBtn').addEventListener('click', () => { | |
| alert('Added current image to your cart'); | |
| }); | |
| </script> | |
| <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=LuHof/testspace" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |