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

466 lines
13 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 7: Global Online Education Growth Timeline (2010-2024)</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>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
overflow: hidden;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
/* Title overlay */
.title-overlay {
position: absolute;
top: 20px;
left: 20px;
background: rgba(0, 8, 20, 0.9);
padding: 20px 25px;
border-radius: 8px;
color: white;
max-width: 450px;
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.title-overlay h1 {
font-size: 22px;
margin-bottom: 8px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.title-overlay p {
font-size: 13px;
color: #b0b8c0;
line-height: 1.6;
}
/* Timeline controls */
.timeline-controls {
position: absolute;
bottom: 30px;
left: 50%;
transform: translateX(-50%);
background: rgba(0, 8, 20, 0.95);
padding: 20px 30px;
border-radius: 12px;
color: white;
min-width: 600px;
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.timeline-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
}
.year-display {
font-size: 32px;
font-weight: bold;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
min-width: 100px;
}
.play-button {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border: none;
color: white;
padding: 10px 24px;
border-radius: 6px;
font-size: 14px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}
.play-button:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}
.play-button:active {
transform: translateY(0);
}
.slider-container {
margin: 15px 0;
}
.year-slider {
width: 100%;
height: 8px;
border-radius: 4px;
background: linear-gradient(to right,
#d73027 0%,
#fee08b 25%,
#a6d96a 50%,
#1a9850 75%,
#0571b0 100%);
outline: none;
-webkit-appearance: none;
cursor: pointer;
}
.year-slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 20px;
height: 20px;
border-radius: 50%;
background: white;
cursor: pointer;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
transition: all 0.2s ease;
}
.year-slider::-webkit-slider-thumb:hover {
transform: scale(1.2);
box-shadow: 0 4px 12px rgba(255, 255, 255, 0.6);
}
.year-slider::-moz-range-thumb {
width: 20px;
height: 20px;
border-radius: 50%;
background: white;
cursor: pointer;
border: none;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.year-labels {
display: flex;
justify-content: space-between;
margin-top: 8px;
font-size: 11px;
color: #808896;
}
/* Statistics panel */
.statistics-panel {
position: absolute;
top: 20px;
right: 20px;
background: rgba(0, 8, 20, 0.9);
padding: 20px;
border-radius: 8px;
color: white;
min-width: 280px;
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.statistics-panel h2 {
font-size: 16px;
margin-bottom: 15px;
color: #b0b8c0;
text-transform: uppercase;
letter-spacing: 1px;
}
.stat-item {
margin-bottom: 12px;
padding-bottom: 12px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.stat-item:last-child {
border-bottom: none;
margin-bottom: 0;
padding-bottom: 0;
}
.stat-label {
font-size: 12px;
color: #808896;
display: block;
margin-bottom: 4px;
}
.stat-value {
font-size: 24px;
font-weight: bold;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
/* Legend */
.legend {
position: absolute;
bottom: 30px;
right: 20px;
background: rgba(0, 8, 20, 0.9);
padding: 15px;
border-radius: 8px;
color: white;
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.legend h3 {
font-size: 12px;
margin-bottom: 10px;
color: #b0b8c0;
text-transform: uppercase;
letter-spacing: 1px;
}
.legend-item {
display: flex;
align-items: center;
margin-bottom: 6px;
font-size: 11px;
}
.legend-item:last-child {
margin-bottom: 0;
}
.legend-color {
width: 18px;
height: 18px;
border-radius: 50%;
margin-right: 8px;
border: 1px solid rgba(255, 255, 255, 0.3);
}
.legend-size {
margin-top: 12px;
padding-top: 12px;
border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.legend-size-item {
display: flex;
align-items: center;
margin-bottom: 6px;
font-size: 11px;
}
.legend-circle {
border-radius: 50%;
background: rgba(102, 126, 234, 0.7);
margin-right: 8px;
border: 1px solid rgba(255, 255, 255, 0.3);
}
/* Popup styling */
.mapboxgl-popup-content {
background: rgba(0, 8, 20, 0.95);
color: white;
padding: 15px;
border-radius: 8px;
border: 1px solid rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
min-width: 240px;
}
.mapboxgl-popup-content h3 {
margin: 0 0 5px 0;
font-size: 16px;
color: white;
}
.platform-type {
color: #808896;
font-size: 12px;
margin-bottom: 12px;
}
.popup-stats {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}
.stat {
display: flex;
flex-direction: column;
}
.stat-label {
font-size: 11px;
color: #808896;
}
.stat-value {
font-size: 16px;
font-weight: 600;
color: white;
}
.growth-positive {
color: #1a9850 !important;
}
.growth-negative {
color: #d73027 !important;
}
.mapboxgl-popup-close-button {
color: white;
font-size: 18px;
}
.mapboxgl-popup-tip {
border-top-color: rgba(0, 8, 20, 0.95) !important;
}
/* Responsive design */
@media (max-width: 768px) {
.title-overlay {
max-width: 90%;
padding: 15px;
}
.timeline-controls {
min-width: 90%;
left: 5%;
transform: none;
padding: 15px;
}
.statistics-panel {
position: relative;
top: auto;
right: auto;
margin: 10px;
}
.legend {
display: none;
}
}
</style>
</head>
<body>
<div id="map"></div>
<!-- Title overlay -->
<div class="title-overlay">
<h1>Global Online Education Growth</h1>
<p>
Timeline visualization of MOOC platforms, online universities, and educational centers
worldwide (2010-2024). Explore the explosive growth of online learning through interactive
temporal analysis.
</p>
</div>
<!-- Statistics panel -->
<div class="statistics-panel">
<h2>Global Statistics</h2>
<div class="stat-item">
<span class="stat-label">Total Enrollment</span>
<span class="stat-value" id="total-enrollment">0</span>
</div>
<div class="stat-item">
<span class="stat-label">Total Courses</span>
<span class="stat-value" id="total-courses">0</span>
</div>
<div class="stat-item">
<span class="stat-label">Active Platforms</span>
<span class="stat-value" id="platform-count">0</span>
</div>
<div class="stat-item">
<span class="stat-label">Avg. Completion Rate</span>
<span class="stat-value" id="avg-completion">0%</span>
</div>
</div>
<!-- Timeline controls -->
<div class="timeline-controls">
<div class="timeline-header">
<div class="year-display" id="year-display">2010</div>
<button class="play-button" id="play-button">Play</button>
</div>
<div class="slider-container">
<input type="range" class="year-slider" id="year-slider" min="0" max="7" value="0" step="1">
<div class="year-labels">
<span>2010</span>
<span>2012</span>
<span>2014</span>
<span>2016</span>
<span>2018</span>
<span>2020</span>
<span>2022</span>
<span>2024</span>
</div>
</div>
</div>
<!-- Legend -->
<div class="legend">
<h3>Growth Rate (YoY)</h3>
<div class="legend-item">
<div class="legend-color" style="background: #d73027;"></div>
<span>Decline (&lt;0%)</span>
</div>
<div class="legend-item">
<div class="legend-color" style="background: #fee08b;"></div>
<span>Stable (0-50%)</span>
</div>
<div class="legend-item">
<div class="legend-color" style="background: #a6d96a;"></div>
<span>Growing (50-100%)</span>
</div>
<div class="legend-item">
<div class="legend-color" style="background: #1a9850;"></div>
<span>Strong (100-200%)</span>
</div>
<div class="legend-item">
<div class="legend-color" style="background: #0571b0;"></div>
<span>Explosive (&gt;200%)</span>
</div>
<div class="legend-size">
<div class="legend-size-item">
<div class="legend-circle" style="width: 8px; height: 8px;"></div>
<span>&lt;1M students</span>
</div>
<div class="legend-size-item">
<div class="legend-circle" style="width: 14px; height: 14px;"></div>
<span>10M students</span>
</div>
<div class="legend-size-item">
<div class="legend-circle" style="width: 20px; height: 20px;"></div>
<span>50M+ students</span>
</div>
</div>
</div>
<script src="src/data/data.js"></script>
<script src="src/index.js"></script>
</body>
</html>