-
Notifications
You must be signed in to change notification settings - Fork 0
/
water-mass-atlas-1.html
169 lines (132 loc) · 5.29 KB
/
water-mass-atlas-1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<title>Water mass atlas</title>
</head>
<body>
<div class='text'>
<h1>Atlas of water masses</h1>
<p>See how Mode Waters evolve into the ocean in 3D, and how their properties change.</p>
<div class="image-container">
<!-- Main image with clickable areas -->
<img src="figures_atlas/global_map.png" alt="Main Figure" usemap="#imagemap" id="mainImage">
<!-- Clickable points on the image -->
<div id="wmNASTMW" class="click-point" data-tooltip="NASTMW" onclick="selectWaterMass('NASTMW')"></div>
<div id="wmSAMWPac" class="click-point" data-tooltip="SAMW Pacific" onclick="selectWaterMass('SAMWPac')"></div>
<div id="wmSAMWInd" class="click-point" data-tooltip="SAMW Indian" onclick="selectWaterMass('SAMWInd')"></div>
<div id="wmNPSTMW" class="click-point" data-tooltip="NPSTMW" onclick="selectWaterMass('NPSTMW')"></div>
<div id="wmNPCMW" class="click-point" data-tooltip="NPCMW" onclick="selectWaterMass('NPCMW')"></div>
<div id="wmIOSTMW" class="click-point" data-tooltip="IOSTMW" onclick="selectWaterMass('IOSTMW')"></div>
<div id="wmSASTMW" class="click-point" data-tooltip="SASTMW" onclick="selectWaterMass('SASTMW')"></div>
<div id="wmAAIW" class="click-point" data-tooltip="AAIW" onclick="selectWaterMass('AAIW')"></div>
</div>
<!-- Buttons to select the variable -->
<div class="variable-buttons">
<button onclick="selectVariable('Temperature')">Temperature</button>
<button onclick="selectVariable('Salinity')">Salinity</button>
<button onclick="selectVariable('Doxy')">Oxygen</button>
<button onclick="selectVariable('Nitrate')">Nitrate</button>
<button onclick="selectVariable('Phosphate')">Phosphate</button>
<button onclick="selectVariable('alk')">Alkalinity</button>
<button onclick="selectVariable('DIC')">DIC</button>
<button onclick="selectVariable('pH')">pH</button>
</div>
<!-- New container specifically for dynamically generated images -->
<div id="dynamic-images-container">
<p>On the plots below, each point is a measurement made by a BGC-Argo float or included in the GLODAP dataset.</p>
</div>
<!-- Hidden figures of all water masses and variables -->
<script>
const wmValues = ['NASTMW', 'SAMWPac', 'SAMWInd', 'NPSTMW', 'NPCMW', 'IOSTMW', 'SASTMW', 'AAIW']
const varValues = ['Temperature', 'Salinity', 'Doxy', 'Nitrate', 'Phosphate', 'alk', 'DIC', 'pH']
// Select the container where images will be inserted
const dynamicContainer = document.getElementById('dynamic-images-container');
wmValues.forEach(wm => {
varValues.forEach(vari => {
// Create a new img element
const video = document.createElement('video');
// Set attributes for each image
video.src = `figures_atlas/${wm}_${vari}.mp4`;
video.alt = `${wm} ${vari}`;
video.id = `${wm}_${vari}`;
video.autoplay = true;
video.loop = true;
video.controls = true;
video.className = 'hidden-figure'; // Add the class 'hidden-figure'
// Append the image to the container
dynamicContainer.appendChild(video);
})
})
</script>
<style>
/* Example clickable points */
#wmNASTMW {
top: 230px;
left: 1125px;
}
#wmSAMWPac {
top: 520px;
left: 960px;
}
#wmNPCMW {
top:240px;
left: 770px;
}
#wmNPSTMW {
top:250px;
left: 630px;
}
#wmIOSTMW {
top:510px;
left: 245px;
}
#wmSAMWInd {
top:480px;
left: 345px;
}
#wmAAIW {
top:510px;
left: 800px;
}
#wmSASTMW {
top:490px;
left: 1300px;
}
</style>
<script>
let selectedWaterMass = null;
let selectedVariable = null;
// Function to handle water mass selection
function selectWaterMass(waterMassId) {
selectedWaterMass = waterMassId;
// Hide all figures
document.querySelectorAll('video.hidden-figure').forEach(function(figure) {
figure.style.display = 'none';
});
// Reset the variable selection
selectedVariable = 'Temperature';
const figureId = selectedWaterMass + '_' + selectedVariable; // Construct the figure ID
document.getElementById(figureId).style.display = 'block'; // Display the figure
}
// Function to handle variable selection and display the corresponding figure
function selectVariable(variable) {
if (selectedWaterMass === null) {
alert('Please select a water mass first!');
return;
}
selectedVariable = variable;
// Hide all figures again
document.querySelectorAll('video.hidden-figure').forEach(function(figure) {
figure.style.display = 'none';
});
// Show the figure corresponding to the selected water mass and variable
const figureId = selectedWaterMass + '_' + selectedVariable;
document.getElementById(figureId).style.display = 'block';
}
</script>
<a href="index.html">Back to Home Page</a>
</div>
</body>
</html>