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

666 lines
20 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Globe Viz 14: HPV Vaccine Impact on Cervical Cancer</title>
<link href="https://api.mapbox.com/mapbox-gl-js/v3.0.1/mapbox-gl.css" rel="stylesheet">
<script src="https://api.mapbox.com/mapbox-gl-js/v3.0.1/mapbox-gl.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
background: #0a0a0f;
color: #fff;
overflow: hidden;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
/* Title Panel */
.title-panel {
position: absolute;
top: 20px;
left: 20px;
background: rgba(15, 10, 25, 0.94);
backdrop-filter: blur(14px);
border: 1px solid rgba(180, 100, 255, 0.2);
border-radius: 14px;
padding: 24px 28px;
max-width: 480px;
box-shadow: 0 10px 40px rgba(120, 40, 180, 0.25);
}
.title-panel h1 {
font-size: 24px;
font-weight: 800;
margin-bottom: 10px;
background: linear-gradient(135deg, #b366ff, #ff6eb4);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.title-panel .subtitle {
font-size: 14px;
color: #b8a4cc;
line-height: 1.7;
margin-bottom: 12px;
}
.title-panel .impact-highlight {
background: rgba(179, 102, 255, 0.15);
border-left: 3px solid #b366ff;
padding: 10px 14px;
margin-top: 12px;
border-radius: 6px;
font-size: 13px;
color: #d8c8e8;
}
.title-panel .impact-highlight strong {
color: #ff6eb4;
font-weight: 700;
}
/* Control Panel */
.control-panel {
position: absolute;
top: 240px;
left: 20px;
background: rgba(15, 10, 25, 0.94);
backdrop-filter: blur(14px);
border: 1px solid rgba(180, 100, 255, 0.2);
border-radius: 14px;
padding: 20px 24px;
max-width: 480px;
box-shadow: 0 10px 40px rgba(120, 40, 180, 0.25);
}
.control-panel h3 {
font-size: 14px;
font-weight: 700;
margin-bottom: 16px;
color: #b366ff;
text-transform: uppercase;
letter-spacing: 0.6px;
}
.control-group {
margin-bottom: 18px;
}
.control-group:last-child {
margin-bottom: 0;
}
.control-group label {
display: block;
font-size: 12px;
color: #a090b8;
margin-bottom: 8px;
font-weight: 600;
}
select {
width: 100%;
padding: 11px 14px;
background: rgba(30, 20, 45, 0.85);
border: 1px solid rgba(179, 102, 255, 0.25);
border-radius: 8px;
color: #fff;
font-size: 13px;
font-family: 'Inter', sans-serif;
cursor: pointer;
transition: all 0.25s ease;
}
select:hover {
border-color: rgba(179, 102, 255, 0.5);
background: rgba(30, 20, 45, 1);
}
select:focus {
outline: none;
border-color: #b366ff;
box-shadow: 0 0 0 3px rgba(179, 102, 255, 0.2);
}
.button-group {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
margin-top: 18px;
}
button {
padding: 11px 18px;
background: rgba(179, 102, 255, 0.15);
border: 1px solid rgba(179, 102, 255, 0.4);
border-radius: 8px;
color: #b366ff;
font-size: 12px;
font-weight: 700;
cursor: pointer;
transition: all 0.25s ease;
font-family: 'Inter', sans-serif;
}
button:hover {
background: rgba(179, 102, 255, 0.25);
border-color: #b366ff;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(179, 102, 255, 0.3);
}
button:active {
transform: translateY(0);
}
button.comparison-btn {
grid-column: 1 / -1;
background: rgba(255, 110, 180, 0.15);
border-color: rgba(255, 110, 180, 0.4);
color: #ff6eb4;
}
button.comparison-btn:hover {
background: rgba(255, 110, 180, 0.25);
border-color: #ff6eb4;
box-shadow: 0 4px 12px rgba(255, 110, 180, 0.3);
}
button.active {
background: rgba(179, 102, 255, 0.35);
border-color: #b366ff;
box-shadow: 0 0 0 2px rgba(179, 102, 255, 0.2);
}
/* Statistics Panel */
.stats-panel {
position: absolute;
top: 20px;
right: 20px;
background: rgba(15, 10, 25, 0.94);
backdrop-filter: blur(14px);
border: 1px solid rgba(180, 100, 255, 0.2);
border-radius: 14px;
padding: 20px 24px;
min-width: 280px;
box-shadow: 0 10px 40px rgba(120, 40, 180, 0.25);
}
.stats-panel h3 {
font-size: 14px;
font-weight: 700;
margin-bottom: 16px;
color: #b366ff;
text-transform: uppercase;
letter-spacing: 0.6px;
}
.stat-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid rgba(180, 100, 255, 0.12);
}
.stat-item:last-child {
border-bottom: none;
}
.stat-label {
font-size: 12px;
color: #a090b8;
font-weight: 500;
}
.stat-value {
font-size: 16px;
font-weight: 700;
color: #b366ff;
}
.stat-value.warning {
color: #ff6eb4;
}
.stat-value.success {
color: #66ffb3;
}
/* Timeline Panel */
.timeline-panel {
position: absolute;
top: 280px;
right: 20px;
background: rgba(15, 10, 25, 0.94);
backdrop-filter: blur(14px);
border: 1px solid rgba(180, 100, 255, 0.2);
border-radius: 14px;
padding: 20px 24px;
min-width: 280px;
box-shadow: 0 10px 40px rgba(120, 40, 180, 0.25);
}
.timeline-panel h3 {
font-size: 14px;
font-weight: 700;
margin-bottom: 16px;
color: #b366ff;
text-transform: uppercase;
letter-spacing: 0.6px;
}
.timeline-item {
display: flex;
align-items: center;
gap: 12px;
padding: 10px 0;
border-bottom: 1px solid rgba(180, 100, 255, 0.08);
}
.timeline-item:last-child {
border-bottom: none;
}
.timeline-year {
font-size: 16px;
font-weight: 800;
color: #b366ff;
min-width: 50px;
}
.timeline-event {
font-size: 11px;
color: #b8a4cc;
line-height: 1.5;
}
/* Legend Panel */
.legend-panel {
position: absolute;
bottom: 20px;
left: 20px;
background: rgba(15, 10, 25, 0.94);
backdrop-filter: blur(14px);
border: 1px solid rgba(180, 100, 255, 0.2);
border-radius: 14px;
padding: 20px 24px;
max-width: 480px;
box-shadow: 0 10px 40px rgba(120, 40, 180, 0.25);
}
.legend-panel h3 {
font-size: 14px;
font-weight: 700;
margin-bottom: 16px;
color: #b366ff;
text-transform: uppercase;
letter-spacing: 0.6px;
}
.legend-item {
margin-bottom: 18px;
}
.legend-item:last-child {
margin-bottom: 0;
}
.legend-label {
font-size: 11px;
color: #a090b8;
margin-bottom: 10px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.4px;
}
.legend-gradient {
height: 22px;
border-radius: 6px;
margin-bottom: 8px;
border: 1px solid rgba(180, 100, 255, 0.15);
}
.coverage-gradient {
background: linear-gradient(to right,
#4a0e4e 0%,
#6b1b6b 20%,
#8e2a8e 40%,
#b366ff 60%,
#d499ff 80%,
#ebccff 100%
);
}
.cancer-gradient {
background: linear-gradient(to right,
#66ffb3 0%,
#99ff99 15%,
#ffff66 30%,
#ffcc33 45%,
#ff9933 60%,
#ff6633 75%,
#ff3333 90%,
#cc0000 100%
);
}
.lives-saved-gradient {
background: linear-gradient(to right,
#0d4d4d 0%,
#1a7a7a 25%,
#26a69a 50%,
#4db6ac 75%,
#80cbc4 100%
);
}
.legend-scale {
display: flex;
justify-content: space-between;
font-size: 10px;
color: #888;
}
/* Info Panel */
.info-panel {
position: absolute;
bottom: 20px;
right: 20px;
background: rgba(15, 10, 25, 0.94);
backdrop-filter: blur(14px);
border: 1px solid rgba(180, 100, 255, 0.2);
border-radius: 14px;
padding: 18px 22px;
max-width: 300px;
box-shadow: 0 10px 40px rgba(120, 40, 180, 0.25);
font-size: 11px;
color: #b8a4cc;
line-height: 1.7;
}
.info-panel h4 {
font-size: 13px;
font-weight: 700;
color: #b366ff;
margin-bottom: 10px;
}
.info-panel .equity-note {
background: rgba(255, 110, 180, 0.12);
border-left: 3px solid #ff6eb4;
padding: 10px 12px;
margin-top: 12px;
border-radius: 6px;
font-size: 11px;
}
.info-panel .equity-note strong {
color: #ff6eb4;
font-weight: 700;
}
/* Popup styling */
.mapboxgl-popup-content {
background: rgba(20, 15, 30, 0.98);
border: 1px solid rgba(179, 102, 255, 0.3);
border-radius: 10px;
padding: 16px;
box-shadow: 0 6px 30px rgba(120, 40, 180, 0.4);
min-width: 280px;
}
.mapboxgl-popup-tip {
border-top-color: rgba(20, 15, 30, 0.98) !important;
}
.popup-title {
font-size: 16px;
font-weight: 700;
color: #b366ff;
margin-bottom: 12px;
padding-bottom: 10px;
border-bottom: 1px solid rgba(179, 102, 255, 0.2);
}
.popup-section {
margin-bottom: 12px;
}
.popup-section:last-child {
margin-bottom: 0;
}
.popup-label {
font-size: 10px;
color: #a090b8;
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: 4px;
font-weight: 600;
}
.popup-value {
font-size: 14px;
color: #fff;
font-weight: 600;
}
.popup-value.high {
color: #66ffb3;
}
.popup-value.medium {
color: #ffff66;
}
.popup-value.low {
color: #ff6eb4;
}
/* 3D Extrusion indicator */
.extrusion-info {
position: absolute;
top: 560px;
left: 20px;
background: rgba(15, 10, 25, 0.94);
backdrop-filter: blur(14px);
border: 1px solid rgba(180, 100, 255, 0.2);
border-radius: 14px;
padding: 16px 20px;
max-width: 480px;
box-shadow: 0 10px 40px rgba(120, 40, 180, 0.25);
font-size: 11px;
color: #b8a4cc;
}
.extrusion-info strong {
color: #ff6eb4;
}
/* Responsive adjustments */
@media (max-width: 1200px) {
.timeline-panel {
display: none;
}
}
@media (max-width: 768px) {
.title-panel,
.control-panel,
.stats-panel,
.legend-panel,
.info-panel,
.extrusion-info {
max-width: calc(100vw - 40px);
}
.stats-panel {
top: auto;
bottom: 320px;
right: 20px;
}
.info-panel {
display: none;
}
.extrusion-info {
display: none;
}
}
</style>
</head>
<body>
<div id="map"></div>
<!-- Title Panel -->
<div class="title-panel">
<h1>HPV Vaccine Impact: Cervical Cancer Prevention</h1>
<p class="subtitle">Visualizing the global success and inequity of HPV vaccination programs in preventing cervical cancer (2006-2024).</p>
<div class="impact-highlight">
<strong>87% reduction</strong> in cervical cancer rates in vaccinated cohorts, yet <strong>90% of deaths</strong> occur in low/middle-income countries with limited vaccine access.
</div>
</div>
<!-- Control Panel -->
<div class="control-panel">
<h3>Visual Encoding</h3>
<div class="control-group">
<label for="size-metric">Circle Size / 3D Height:</label>
<select id="size-metric">
<option value="coverage" selected>HPV Vaccine Coverage (%)</option>
<option value="cancer-rate">Cervical Cancer Incidence</option>
<option value="lives-saved">Lives That Could Be Saved</option>
<option value="mortality">Cervical Cancer Mortality</option>
</select>
</div>
<div class="control-group">
<label for="color-metric">Circle Color:</label>
<select id="color-metric">
<option value="coverage">HPV Vaccine Coverage (%)</option>
<option value="cancer-rate" selected>Cervical Cancer Incidence</option>
<option value="lives-saved">Lives That Could Be Saved</option>
<option value="mortality">Cervical Cancer Mortality</option>
</select>
</div>
<div class="button-group">
<button id="toggle-rotation">Pause Rotation</button>
<button id="reset-view">Reset View</button>
<button id="toggle-comparison" class="comparison-btn">Toggle 3D Cancer Burden</button>
</div>
</div>
<!-- Statistics Panel -->
<div class="stats-panel">
<h3>Global Impact</h3>
<div class="stat-item">
<span class="stat-label">Countries with Programs</span>
<span class="stat-value success">146</span>
</div>
<div class="stat-item">
<span class="stat-label">Avg Coverage (Global)</span>
<span class="stat-value">48%</span>
</div>
<div class="stat-item">
<span class="stat-label">High-Income Coverage</span>
<span class="stat-value success">84%</span>
</div>
<div class="stat-item">
<span class="stat-label">Low-Income Coverage</span>
<span class="stat-value warning">27%</span>
</div>
<div class="stat-item">
<span class="stat-label">Potential Lives Saved/Year</span>
<span class="stat-value success">311K</span>
</div>
</div>
<!-- Timeline Panel -->
<div class="timeline-panel">
<h3>Vaccine Timeline</h3>
<div class="timeline-item">
<span class="timeline-year">2006</span>
<span class="timeline-event">First HPV vaccine approved (Gardasil)</span>
</div>
<div class="timeline-item">
<span class="timeline-year">2009</span>
<span class="timeline-event">20 countries adopt national programs</span>
</div>
<div class="timeline-item">
<span class="timeline-year">2014</span>
<span class="timeline-event">WHO recommends HPV vaccination</span>
</div>
<div class="timeline-item">
<span class="timeline-year">2019</span>
<span class="timeline-event">100+ countries with programs</span>
</div>
<div class="timeline-item">
<span class="timeline-year">2024</span>
<span class="timeline-event">146 countries, but coverage gaps persist</span>
</div>
</div>
<!-- Legend Panel -->
<div class="legend-panel">
<h3>Legend</h3>
<div class="legend-item">
<div class="legend-label">Color Scale: <span id="color-metric-label">Cervical Cancer Incidence</span></div>
<div class="legend-gradient cancer-gradient" id="color-gradient"></div>
<div class="legend-scale">
<span id="color-min-label">Low (2 per 100K)</span>
<span id="color-max-label">High (44 per 100K)</span>
</div>
</div>
<div class="legend-item">
<div class="legend-label">Size/Height: <span id="size-metric-label">HPV Vaccine Coverage</span></div>
<div class="legend-scale">
<span id="size-min-label">0% (No program)</span>
<span id="size-max-label">95% (High coverage)</span>
</div>
</div>
</div>
<!-- Info Panel -->
<div class="info-panel">
<h4>Gender Equity & Health Justice</h4>
<p>Cervical cancer is almost entirely preventable through HPV vaccination, yet remains the 4th most common cancer in women globally.</p>
<div class="equity-note">
<strong>Health Inequity:</strong> High-income countries achieve 80%+ coverage while low-income countries struggle below 30%, perpetuating preventable deaths among the world's most vulnerable women.
</div>
</div>
<!-- 3D Extrusion Info -->
<div class="extrusion-info">
<strong>3D Visualization Mode:</strong> When 3D cancer burden is enabled, column heights represent annual cervical cancer deaths. Taller columns indicate higher death burden, visualizing the devastating impact in regions with low vaccine coverage.
</div>
<!-- Load data and main script -->
<script src="src/data/data.js"></script>
<script src="src/index.js"></script>
</body>
</html>