384 lines
9.1 KiB
HTML
384 lines
9.1 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 Visualization 4: Global Digital Infrastructure</title>
|
|
|
|
<!-- Mapbox GL JS -->
|
|
<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: #0a0a0a;
|
|
color: #ffffff;
|
|
overflow: hidden;
|
|
}
|
|
|
|
#map {
|
|
position: absolute;
|
|
top: 0;
|
|
bottom: 0;
|
|
width: 100%;
|
|
}
|
|
|
|
.title {
|
|
position: absolute;
|
|
top: 20px;
|
|
left: 20px;
|
|
z-index: 1;
|
|
background: rgba(0, 0, 0, 0.85);
|
|
padding: 20px 25px;
|
|
border-radius: 8px;
|
|
backdrop-filter: blur(10px);
|
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
max-width: 350px;
|
|
}
|
|
|
|
.title h1 {
|
|
font-size: 24px;
|
|
margin-bottom: 8px;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
background-clip: text;
|
|
}
|
|
|
|
.title p {
|
|
font-size: 13px;
|
|
color: #aaa;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.controls {
|
|
position: absolute;
|
|
top: 20px;
|
|
right: 20px;
|
|
z-index: 1;
|
|
background: rgba(0, 0, 0, 0.85);
|
|
padding: 20px;
|
|
border-radius: 8px;
|
|
backdrop-filter: blur(10px);
|
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
width: 320px;
|
|
max-height: calc(100vh - 40px);
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.controls h3 {
|
|
font-size: 16px;
|
|
margin-bottom: 15px;
|
|
color: #fff;
|
|
border-bottom: 2px solid rgba(102, 126, 234, 0.5);
|
|
padding-bottom: 8px;
|
|
}
|
|
|
|
.control-section {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.control-section h4 {
|
|
font-size: 14px;
|
|
margin-bottom: 10px;
|
|
color: #ddd;
|
|
}
|
|
|
|
.toggle-group {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 10px;
|
|
}
|
|
|
|
.toggle-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
}
|
|
|
|
.toggle-item input[type="checkbox"] {
|
|
width: 18px;
|
|
height: 18px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.toggle-item label {
|
|
font-size: 13px;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
}
|
|
|
|
.select-group {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
}
|
|
|
|
.select-group select {
|
|
padding: 8px 12px;
|
|
border-radius: 4px;
|
|
background: rgba(255, 255, 255, 0.1);
|
|
color: #fff;
|
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
font-size: 13px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.select-group select option {
|
|
background: #1a1a1a;
|
|
color: #fff;
|
|
}
|
|
|
|
.slider-group {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 10px;
|
|
}
|
|
|
|
.slider-item {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 5px;
|
|
}
|
|
|
|
.slider-label {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
font-size: 13px;
|
|
}
|
|
|
|
.slider-item input[type="range"] {
|
|
width: 100%;
|
|
height: 4px;
|
|
background: rgba(255, 255, 255, 0.2);
|
|
border-radius: 2px;
|
|
outline: none;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.slider-item input[type="range"]::-webkit-slider-thumb {
|
|
-webkit-appearance: none;
|
|
appearance: none;
|
|
width: 16px;
|
|
height: 16px;
|
|
background: #667eea;
|
|
border-radius: 50%;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.slider-item input[type="range"]::-moz-range-thumb {
|
|
width: 16px;
|
|
height: 16px;
|
|
background: #667eea;
|
|
border-radius: 50%;
|
|
cursor: pointer;
|
|
border: none;
|
|
}
|
|
|
|
.legend {
|
|
position: absolute;
|
|
bottom: 20px;
|
|
left: 20px;
|
|
z-index: 1;
|
|
background: rgba(0, 0, 0, 0.85);
|
|
padding: 15px 20px;
|
|
border-radius: 8px;
|
|
backdrop-filter: blur(10px);
|
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
font-size: 13px;
|
|
max-width: 250px;
|
|
}
|
|
|
|
.legend h4 {
|
|
font-size: 14px;
|
|
margin-bottom: 10px;
|
|
color: #fff;
|
|
}
|
|
|
|
.info {
|
|
position: absolute;
|
|
bottom: 20px;
|
|
right: 20px;
|
|
z-index: 1;
|
|
background: rgba(0, 0, 0, 0.85);
|
|
padding: 15px 20px;
|
|
border-radius: 8px;
|
|
backdrop-filter: blur(10px);
|
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
font-size: 13px;
|
|
max-width: 250px;
|
|
}
|
|
|
|
.info h4 {
|
|
font-size: 14px;
|
|
margin-bottom: 10px;
|
|
color: #fff;
|
|
}
|
|
|
|
/* Popup styling */
|
|
.mapboxgl-popup-content {
|
|
background: rgba(0, 0, 0, 0.95);
|
|
color: #fff;
|
|
border-radius: 8px;
|
|
padding: 0;
|
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
}
|
|
|
|
.mapboxgl-popup-content h3 {
|
|
color: #fff;
|
|
}
|
|
|
|
.mapboxgl-popup-close-button {
|
|
color: #fff;
|
|
font-size: 20px;
|
|
padding: 5px 10px;
|
|
}
|
|
|
|
.mapboxgl-popup-close-button:hover {
|
|
background: rgba(255, 255, 255, 0.1);
|
|
}
|
|
|
|
.mapboxgl-popup-tip {
|
|
border-top-color: rgba(0, 0, 0, 0.95);
|
|
}
|
|
|
|
/* Scrollbar styling */
|
|
.controls::-webkit-scrollbar {
|
|
width: 6px;
|
|
}
|
|
|
|
.controls::-webkit-scrollbar-track {
|
|
background: rgba(255, 255, 255, 0.1);
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.controls::-webkit-scrollbar-thumb {
|
|
background: rgba(102, 126, 234, 0.5);
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.controls::-webkit-scrollbar-thumb:hover {
|
|
background: rgba(102, 126, 234, 0.7);
|
|
}
|
|
|
|
/* Responsive design */
|
|
@media (max-width: 768px) {
|
|
.title {
|
|
max-width: calc(100vw - 40px);
|
|
top: 10px;
|
|
left: 10px;
|
|
}
|
|
|
|
.controls {
|
|
width: calc(100vw - 40px);
|
|
top: auto;
|
|
bottom: 10px;
|
|
right: 10px;
|
|
max-height: 50vh;
|
|
}
|
|
|
|
.legend,
|
|
.info {
|
|
display: none;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="map"></div>
|
|
|
|
<div class="title">
|
|
<h1>Global Digital Infrastructure</h1>
|
|
<p>Multi-layer visualization combining internet penetration (choropleth), tech hubs (circles), and international connections (lines). Iteration 4 of progressive Mapbox learning.</p>
|
|
</div>
|
|
|
|
<div class="controls">
|
|
<h3>Layer Controls</h3>
|
|
|
|
<div class="control-section">
|
|
<h4>Visibility</h4>
|
|
<div class="toggle-group">
|
|
<div class="toggle-item">
|
|
<input type="checkbox" id="toggle-countries" checked>
|
|
<label for="toggle-countries">Country Layer (Choropleth)</label>
|
|
</div>
|
|
<div class="toggle-item">
|
|
<input type="checkbox" id="toggle-cities" checked>
|
|
<label for="toggle-cities">Tech Hubs (Circles)</label>
|
|
</div>
|
|
<div class="toggle-item">
|
|
<input type="checkbox" id="toggle-connections" checked>
|
|
<label for="toggle-connections">Connections (Lines)</label>
|
|
</div>
|
|
<div class="toggle-item">
|
|
<input type="checkbox" id="toggle-labels" checked>
|
|
<label for="toggle-labels">City Labels</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="control-section">
|
|
<h4>Filters</h4>
|
|
<div class="select-group">
|
|
<label for="region-filter">Region:</label>
|
|
<select id="region-filter">
|
|
<option value="all">All Regions</option>
|
|
<option value="North America">North America</option>
|
|
<option value="South America">South America</option>
|
|
<option value="Europe">Europe</option>
|
|
<option value="Asia">Asia</option>
|
|
<option value="Africa">Africa</option>
|
|
<option value="Oceania">Oceania</option>
|
|
</select>
|
|
|
|
<label for="metric-filter" style="margin-top: 10px;">Country Metric:</label>
|
|
<select id="metric-filter">
|
|
<option value="penetration">Internet Penetration</option>
|
|
<option value="digital-index">Digital Infrastructure Index</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="control-section">
|
|
<h4>Opacity</h4>
|
|
<div class="slider-group">
|
|
<div class="slider-item">
|
|
<div class="slider-label">
|
|
<span>Country Layer</span>
|
|
<span id="country-opacity-value">70%</span>
|
|
</div>
|
|
<input type="range" id="country-opacity" min="0" max="1" step="0.1" value="0.7">
|
|
</div>
|
|
<div class="slider-item">
|
|
<div class="slider-label">
|
|
<span>Tech Hubs</span>
|
|
<span id="city-opacity-value">85%</span>
|
|
</div>
|
|
<input type="range" id="city-opacity" min="0" max="1" step="0.1" value="0.85">
|
|
</div>
|
|
<div class="slider-item">
|
|
<div class="slider-label">
|
|
<span>Connections</span>
|
|
<span id="connection-opacity-value">40%</span>
|
|
</div>
|
|
<input type="range" id="connection-opacity" min="0" max="1" step="0.1" value="0.4">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="legend" id="legend"></div>
|
|
<div class="info" id="info"></div>
|
|
|
|
<script type="module" src="./src/index.js"></script>
|
|
</body>
|
|
</html>
|