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

363 lines
10 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DTP3 Vaccine Coverage & Child Mortality - Global Correlation Analysis 2024</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: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: #0a0e27;
color: #ffffff;
overflow: hidden;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
.header {
position: absolute;
top: 20px;
left: 20px;
right: 20px;
z-index: 1000;
background: rgba(10, 14, 39, 0.95);
padding: 20px 30px;
border-radius: 12px;
border: 1px solid rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
}
.header h1 {
font-size: 28px;
margin-bottom: 8px;
background: linear-gradient(135deg, #4ade80, #22d3ee);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.header p {
font-size: 14px;
color: #94a3b8;
margin-bottom: 15px;
}
.view-controls {
display: flex;
gap: 10px;
margin-top: 15px;
}
.view-btn {
padding: 10px 20px;
background: rgba(74, 222, 128, 0.1);
border: 1px solid rgba(74, 222, 128, 0.3);
color: #4ade80;
border-radius: 8px;
cursor: pointer;
font-size: 13px;
font-weight: 500;
transition: all 0.3s ease;
}
.view-btn:hover {
background: rgba(74, 222, 128, 0.2);
border-color: rgba(74, 222, 128, 0.5);
transform: translateY(-2px);
}
.view-btn.active {
background: rgba(74, 222, 128, 0.3);
border-color: #4ade80;
}
.legend {
position: absolute;
bottom: 40px;
right: 20px;
background: rgba(10, 14, 39, 0.95);
padding: 20px;
border-radius: 12px;
border: 1px solid rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
z-index: 1000;
min-width: 280px;
}
.legend h3 {
font-size: 16px;
margin-bottom: 15px;
color: #4ade80;
}
.legend-item {
display: flex;
align-items: center;
margin-bottom: 10px;
font-size: 13px;
}
.legend-color {
width: 30px;
height: 20px;
border-radius: 4px;
margin-right: 10px;
border: 1px solid rgba(255, 255, 255, 0.2);
}
.legend-gradient {
height: 20px;
border-radius: 4px;
margin-bottom: 5px;
border: 1px solid rgba(255, 255, 255, 0.2);
}
.legend-labels {
display: flex;
justify-content: space-between;
font-size: 11px;
color: #94a3b8;
margin-bottom: 15px;
}
.stats-panel {
position: absolute;
top: 160px;
left: 20px;
background: rgba(10, 14, 39, 0.95);
padding: 20px;
border-radius: 12px;
border: 1px solid rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
z-index: 1000;
width: 300px;
}
.stat-item {
margin-bottom: 15px;
}
.stat-label {
font-size: 12px;
color: #94a3b8;
margin-bottom: 5px;
}
.stat-value {
font-size: 24px;
font-weight: 600;
color: #4ade80;
}
.stat-change {
font-size: 11px;
color: #22d3ee;
margin-top: 3px;
}
.tooltip {
position: absolute;
background: rgba(10, 14, 39, 0.98);
padding: 15px;
border-radius: 8px;
border: 1px solid rgba(74, 222, 128, 0.3);
pointer-events: none;
z-index: 2000;
display: none;
max-width: 350px;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.tooltip h4 {
margin-bottom: 10px;
color: #4ade80;
font-size: 15px;
}
.tooltip-row {
display: flex;
justify-content: space-between;
margin-bottom: 6px;
font-size: 12px;
}
.tooltip-label {
color: #94a3b8;
}
.tooltip-value {
color: #ffffff;
font-weight: 500;
}
.circle-legend {
margin-top: 15px;
padding-top: 15px;
border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.circle-legend-title {
font-size: 13px;
color: #94a3b8;
margin-bottom: 10px;
}
.circle-sizes {
display: flex;
align-items: flex-end;
gap: 15px;
}
.circle-example {
text-align: center;
}
.circle-visual {
width: 40px;
height: 40px;
border-radius: 50%;
background: rgba(34, 211, 238, 0.3);
border: 2px solid rgba(34, 211, 238, 0.6);
margin: 0 auto 5px;
}
.circle-visual.small {
width: 20px;
height: 20px;
}
.circle-visual.medium {
width: 30px;
height: 30px;
}
.circle-label {
font-size: 10px;
color: #94a3b8;
}
.loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 18px;
color: #4ade80;
z-index: 999;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
.loading {
animation: pulse 2s ease-in-out infinite;
}
</style>
</head>
<body>
<div id="map"></div>
<div class="loading" id="loading">Loading Global Immunization Data...</div>
<div class="header">
<h1>DTP3 Vaccine Coverage & Child Mortality Correlation</h1>
<p>2024 Global Snapshot: From 5% (1974) to 85% Coverage - 40% Reduction in Infant Deaths</p>
<div class="view-controls">
<button class="view-btn active" data-view="coverage">DTP3 Coverage %</button>
<button class="view-btn" data-view="mortality">Under-5 Mortality Rate</button>
<button class="view-btn" data-view="zerodose">Zero-Dose Children</button>
<button class="view-btn" data-view="lives">Lives Saved Since 1974</button>
</div>
</div>
<div class="stats-panel">
<div class="stat-item">
<div class="stat-label">Global DTP3 Coverage</div>
<div class="stat-value">85%</div>
<div class="stat-change">↑ from 5% in 1974</div>
</div>
<div class="stat-item">
<div class="stat-label">Infants Vaccinated (2024)</div>
<div class="stat-value">109M</div>
<div class="stat-change">of 128M births globally</div>
</div>
<div class="stat-item">
<div class="stat-label">Zero-Dose Children</div>
<div class="stat-value">19M</div>
<div class="stat-change">15% of global infants</div>
</div>
<div class="stat-item">
<div class="stat-label">Infant Deaths Prevented</div>
<div class="stat-value">40%↓</div>
<div class="stat-change">50%+ reduction in Africa</div>
</div>
</div>
<div class="legend">
<h3 id="legend-title">DTP3 Coverage 2024</h3>
<div class="legend-gradient" id="legend-gradient"></div>
<div class="legend-labels" id="legend-labels">
<span>0%</span>
<span>25%</span>
<span>50%</span>
<span>75%</span>
<span>100%</span>
</div>
<div class="legend-item">
<div class="legend-color" style="background: rgba(239, 68, 68, 0.4); border-color: #ef4444;"></div>
<span>Critical (<50%)</span>
</div>
<div class="legend-item">
<div class="legend-color" style="background: rgba(251, 191, 36, 0.4); border-color: #fbbf24;"></div>
<span>Needs Improvement (50-75%)</span>
</div>
<div class="legend-item">
<div class="legend-color" style="background: rgba(74, 222, 128, 0.4); border-color: #4ade80;"></div>
<span>Good Coverage (>75%)</span>
</div>
<div class="circle-legend">
<div class="circle-legend-title">Lives Saved (Circle Size)</div>
<div class="circle-sizes">
<div class="circle-example">
<div class="circle-visual small"></div>
<div class="circle-label">10K</div>
</div>
<div class="circle-example">
<div class="circle-visual medium"></div>
<div class="circle-label">100K</div>
</div>
<div class="circle-example">
<div class="circle-visual"></div>
<div class="circle-label">500K+</div>
</div>
</div>
</div>
</div>
<div class="tooltip" id="tooltip"></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>