infinite-agents-public/mapbox_test/mapbox_globe_10/index.html

382 lines
11 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Polio Eradication Progress (1980-2020) - Global Vaccination Coverage</title>
<script src='https://api.mapbox.com/mapbox-gl-js/v3.0.1/mapbox-gl.js'></script>
<link href='https://api.mapbox.com/mapbox-gl-js/v3.0.1/mapbox-gl.css' rel='stylesheet' />
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
background: #0a0e1a;
color: #ffffff;
overflow: hidden;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
.info-panel {
position: absolute;
top: 20px;
left: 20px;
background: rgba(10, 14, 26, 0.95);
padding: 25px;
border-radius: 12px;
max-width: 380px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
border: 1px solid rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
}
.info-panel h1 {
font-size: 24px;
margin-bottom: 8px;
background: linear-gradient(135deg, #4CAF50, #8BC34A);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: 700;
}
.info-panel .subtitle {
font-size: 14px;
color: #9ca3af;
margin-bottom: 20px;
line-height: 1.5;
}
.stats-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 15px;
margin-top: 20px;
}
.stat-card {
background: rgba(76, 175, 80, 0.1);
padding: 15px;
border-radius: 8px;
border: 1px solid rgba(76, 175, 80, 0.2);
}
.stat-card.endemic {
background: rgba(244, 67, 54, 0.1);
border-color: rgba(244, 67, 54, 0.2);
}
.stat-value {
font-size: 28px;
font-weight: 700;
margin-bottom: 5px;
}
.stat-label {
font-size: 12px;
color: #9ca3af;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.timeline-control {
position: absolute;
bottom: 40px;
left: 50%;
transform: translateX(-50%);
background: rgba(10, 14, 26, 0.95);
padding: 25px 40px;
border-radius: 12px;
min-width: 600px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
border: 1px solid rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
}
.year-display {
text-align: center;
font-size: 48px;
font-weight: 700;
margin-bottom: 20px;
background: linear-gradient(135deg, #4CAF50, #8BC34A);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.slider-container {
position: relative;
margin-bottom: 20px;
}
.slider {
width: 100%;
height: 8px;
border-radius: 4px;
background: linear-gradient(90deg, #f44336 0%, #ff9800 25%, #ffeb3b 50%, #8bc34a 75%, #4caf50 100%);
outline: none;
-webkit-appearance: none;
cursor: pointer;
}
.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 24px;
height: 24px;
border-radius: 50%;
background: #ffffff;
cursor: pointer;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
transition: transform 0.2s;
}
.slider::-webkit-slider-thumb:hover {
transform: scale(1.2);
}
.slider::-moz-range-thumb {
width: 24px;
height: 24px;
border-radius: 50%;
background: #ffffff;
cursor: pointer;
border: none;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.controls {
display: flex;
justify-content: center;
gap: 15px;
margin-top: 15px;
}
.btn {
background: rgba(76, 175, 80, 0.2);
border: 1px solid rgba(76, 175, 80, 0.4);
color: #ffffff;
padding: 10px 24px;
border-radius: 6px;
cursor: pointer;
font-size: 14px;
font-weight: 600;
transition: all 0.2s;
}
.btn:hover {
background: rgba(76, 175, 80, 0.3);
transform: translateY(-2px);
}
.btn.active {
background: #4CAF50;
border-color: #4CAF50;
}
.legend {
position: absolute;
bottom: 40px;
right: 20px;
background: rgba(10, 14, 26, 0.95);
padding: 20px;
border-radius: 12px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
border: 1px solid rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
}
.legend h3 {
font-size: 14px;
margin-bottom: 15px;
text-transform: uppercase;
letter-spacing: 0.5px;
color: #9ca3af;
}
.legend-item {
display: flex;
align-items: center;
margin-bottom: 10px;
}
.legend-color {
width: 30px;
height: 20px;
border-radius: 4px;
margin-right: 10px;
border: 1px solid rgba(255, 255, 255, 0.2);
}
.legend-label {
font-size: 13px;
}
.milestone {
margin-top: 15px;
padding-top: 15px;
border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.milestone-text {
font-size: 12px;
color: #8bc34a;
line-height: 1.6;
font-style: italic;
}
.mapboxgl-popup-content {
background: rgba(10, 14, 26, 0.98);
color: #ffffff;
border-radius: 8px;
padding: 15px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
border: 1px solid rgba(255, 255, 255, 0.1);
}
.mapboxgl-popup-close-button {
color: #ffffff;
font-size: 20px;
}
.popup-title {
font-size: 16px;
font-weight: 700;
margin-bottom: 10px;
}
.popup-data {
font-size: 13px;
line-height: 1.8;
}
.popup-data .coverage-high {
color: #4caf50;
font-weight: 600;
}
.popup-data .coverage-medium {
color: #ffeb3b;
font-weight: 600;
}
.popup-data .coverage-low {
color: #f44336;
font-weight: 600;
}
.popup-certified {
margin-top: 10px;
padding: 8px;
background: rgba(76, 175, 80, 0.2);
border-radius: 4px;
font-size: 12px;
color: #8bc34a;
text-align: center;
}
.popup-endemic {
margin-top: 10px;
padding: 8px;
background: rgba(244, 67, 54, 0.2);
border-radius: 4px;
font-size: 12px;
color: #ff5252;
text-align: center;
font-weight: 600;
}
</style>
</head>
<body>
<div id="map"></div>
<div class="info-panel">
<h1>Polio Eradication Progress</h1>
<p class="subtitle">Global Polio Immunization Coverage (1980-2020)</p>
<div class="stats-grid">
<div class="stat-card">
<div class="stat-value" id="global-coverage">--</div>
<div class="stat-label">Global Coverage</div>
</div>
<div class="stat-card">
<div class="stat-value" id="certified-countries">--</div>
<div class="stat-label">Certified Polio-Free</div>
</div>
<div class="stat-card endemic">
<div class="stat-value" id="endemic-countries">--</div>
<div class="stat-label">Endemic Countries</div>
</div>
<div class="stat-card">
<div class="stat-value" id="cases-prevented">--</div>
<div class="stat-label">Cases Prevented</div>
</div>
</div>
<div class="milestone">
<div class="milestone-text" id="milestone-text">
Loading historical milestones...
</div>
</div>
</div>
<div class="timeline-control">
<div class="year-display" id="year-display">1980</div>
<div class="slider-container">
<input type="range" min="1980" max="2020" value="1980" class="slider" id="year-slider" step="1">
</div>
<div class="controls">
<button class="btn" id="play-btn">Play</button>
<button class="btn" id="reset-btn">Reset</button>
</div>
</div>
<div class="legend">
<h3>Vaccination Coverage</h3>
<div class="legend-item">
<div class="legend-color" style="background: #4caf50;"></div>
<div class="legend-label">80-100% Coverage</div>
</div>
<div class="legend-item">
<div class="legend-color" style="background: #8bc34a;"></div>
<div class="legend-label">60-79% Coverage</div>
</div>
<div class="legend-item">
<div class="legend-color" style="background: #ffeb3b;"></div>
<div class="legend-label">40-59% Coverage</div>
</div>
<div class="legend-item">
<div class="legend-color" style="background: #ff9800;"></div>
<div class="legend-label">20-39% Coverage</div>
</div>
<div class="legend-item">
<div class="legend-color" style="background: #f44336;"></div>
<div class="legend-label">0-19% Coverage</div>
</div>
<div class="legend-item" style="margin-top: 15px;">
<div class="legend-color" style="background: rgba(76, 175, 80, 0.3); border: 2px solid #4caf50;"></div>
<div class="legend-label">Certified Polio-Free</div>
</div>
<div class="legend-item">
<div class="legend-color" style="background: rgba(244, 67, 54, 0.3); border: 2px solid #f44336;"></div>
<div class="legend-label">Endemic (2020)</div>
</div>
</div>
<!-- Load shared Mapbox configuration BEFORE main script -->
<script type="module">
import { MAPBOX_CONFIG } from '../shared/mapbox-config.js';
MAPBOX_CONFIG.applyToken(); // Validates and applies token
</script>
<!-- Load main application -->
<script type="module" src="src/index.js"></script>
</body>
</html>