Skip to content

Commit 62d8564

Browse files
updates
1 parent f8fca8a commit 62d8564

File tree

6 files changed

+42
-32
lines changed

6 files changed

+42
-32
lines changed

index.html

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,22 @@
7373

7474

7575

76-
.locations-container {
76+
.locations-container {
7777
width: 100%;
78-
position: fixed;
78+
position: absolute;
7979
margin-bottom: 0;
80-
bottom: 0;
80+
bottom: 2px;
8181
background: #02020252;
82+
z-index: 10;
8283
}
8384
a.launch-local-forecasts {
8485
text-decoration: none;
8586
}
8687

8788
div#map {
88-
position: absolute;
89+
min-height: 90vh !important;
90+
height: 90vh !important;
8991
width: 100%;
90-
height: 100%;
91-
z-index: 0 !important;
9292
}
9393

9494
header.p-3.bg-dark.text-white {
@@ -220,19 +220,30 @@
220220
</div>
221221

222222

223-
<footer class="bg-dark text-inverse">
224-
223+
224+
<footer class="bg-white text-inverse pt-3">
225+
<div class="container pb-2">
226+
<div class="row align-items-center">
227+
<div class="col-12 d-flex justify-content-start">
228+
<a href="https://gmao.gsfc.nasa.gov/" target="_blank" rel="noopener">
229+
<img src="parametres/ESD-logo.png" alt="NASA Logo" style="height:40px; margin-left:18px;">
230+
</a>
231+
<a href="https://marroninstitute.nyu.edu/" target="_blank" rel="noopener">
232+
<img src="parametres/Marron_logo.png" alt="NYU Marron Logo" style="height:40px; margin-left:18px;">
233+
</a>
234+
</div>
235+
</div>
236+
</div>
225237
<div class="container">
226238
<div class="d-md-flex align-items-center justify-content-between">
227-
<div class="footer-left text-white">
239+
<div class="footer-left">
228240
<p class="mb-0">© 2025 SNWG Localized Forecasts.</p>
229241
</div>
230-
<div class="footer-right text-white">
242+
<div class="footer-right">
231243
<p class="mb-0">Version: 1.1</p>
232244
</div>
233245
</div>
234246
</div>
235-
236247
</footer>
237248

238249
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>

local_forecasts.js

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,6 @@ function readApiBaker(options = {}) {
10461046
fetch(fileUrl)
10471047
.then(response => {
10481048
if (!response.ok) {
1049-
// Try again with underscores if hyphens fail
10501049
const fallbackUrl = `precomputed/all_dts/${location.replace(/[-\s]/g, "_")}.json`;
10511050
return fetch(fallbackUrl).then(fallbackResponse => {
10521051
if (!fallbackResponse.ok) throw new Error('Network response was not ok');
@@ -1284,24 +1283,31 @@ function readApiBaker(options = {}) {
12841283
let currentValue = 'N/A';
12851284
let nextValue = 'N/A';
12861285

1286+
// ...inside readApiBaker, after defining currentValue and nextValue for each plot...
1287+
12871288
if (plot.param === "pm25") {
1288-
1289+
// For PM2.5, use 3-hour window logic for current and next values
1290+
currentValue = 'N/A';
1291+
nextValue = 'N/A';
12891292
for (let i = 0; i < masterData.master_datetime.length; i++) {
12901293
const dtStr = masterData.master_datetime[i];
12911294
if (!dtStr) continue;
12921295
const forecastStart = new Date(dtStr.replace(' ', 'T'));
12931296
const forecastEnd = new Date(forecastStart.getTime() + 3 * 60 * 60 * 1000);
1297+
// Current: is now within this 3-hour window?
12941298
if (siteLocalNow >= forecastStart && siteLocalNow < forecastEnd) {
12951299
currentValue = masterData[plot.columns[0].column][i];
12961300
}
1297-
1301+
// Next: is 1 hour from now within this 3-hour window?
12981302
const nextLocalDate = new Date(siteLocalNow.getTime() + 1 * 60 * 60 * 1000);
12991303
if (nextLocalDate >= forecastStart && nextLocalDate < forecastEnd) {
13001304
nextValue = masterData[plot.columns[0].column][i];
13011305
}
13021306
}
13031307
} else {
1304-
1308+
// For other species, match by hour
1309+
currentValue = 'N/A';
1310+
nextValue = 'N/A';
13051311
for (let i = 0; i < masterData.master_datetime.length; i++) {
13061312
const dtStr = masterData.master_datetime[i];
13071313
if (!dtStr) continue;
@@ -1314,17 +1320,8 @@ function readApiBaker(options = {}) {
13141320
}
13151321
}
13161322
}
1317-
1318-
for (let i = 0; i < masterData.master_datetime.length; i++) {
1319-
const dtStr = masterData.master_datetime[i];
1320-
const hour = parseInt(dtStr.slice(11, 13), 10);
1321-
if (hour === currentHour) {
1322-
currentValue = masterData[plot.columns[0].column][i];
1323-
}
1324-
if (hour === nextHour) {
1325-
nextValue = masterData[plot.columns[0].column][i];
1326-
}
1327-
}
1323+
1324+
// Remove the extra for-loop that matches by hour for all species (it would overwrite the correct 3-hour logic for PM2.5)
13281325

13291326
if (plot.displayAQI) {
13301327
const currentAqi = currentValue;
@@ -1712,21 +1709,21 @@ function generateMetricsHtml({
17121709
<div class="d-xvg">
17131710
<div class="xvg_aqi me-3">${currentVal !== 'N/A' ? currentVal : '--'}</div>
17141711
<div class="xvg_aqi-change ${change.class}">${change.arrow} ${change.sign}${change.diff} (${change.sign}${change.pct !== "N/A" ? change.pct + "%" : "--"})</div>
1715-
<div class="xvg_timestamp">Current AQI (US Scale): ${formatTime(currentIdx)}</div>
1712+
<div class="xvg_timestamp">Current AQI (US Scale)}</div>
17161713
</div>
17171714
17181715
</div>
17191716
17201717
<div class="d-xvg">
17211718
<div class="xvg_aqi me-3">${nextVal !== 'N/A' ? nextVal : '--'}</div>
17221719
<div class="xvg_aqi-change ${nextChange.class}">${nextChange.arrow} ${nextChange.sign}${nextChange.diff} (${nextChange.sign}${nextChange.pct !== "N/A" ? nextChange.pct + "%" : "--"})</div>
1723-
<div class="xvg_timestamp">Next hour: ${formatTime(nextIdx)}</div>
1720+
<div class="xvg_timestamp">Next hour</div>
17241721
</div>
17251722
17261723
<div class="d-xvg">
17271724
<div class="xvg_aqi me-3">${prevVal !== 'N/A' ? prevVal : '--'}</div>
17281725
<div class="xvg_aqi-change ${prevChange.class}">${prevChange.arrow} ${prevChange.sign}${prevChange.diff} (${prevChange.sign}${prevChange.pct !== "N/A" ? prevChange.pct + "%" : "--"})</div>
1729-
<div class="xvg_timestamp">Previous hour: ${formatTime(prevIdx)}</div>
1726+
<div class="xvg_timestamp">Previous hour</div>
17301727
</div>
17311728
<div class="d-xvg">
17321729
<div class="xvg_aqi me-3">${dailyAvg !== 'N/A' ? dailyAvg.toFixed(2) : '--'}</div>

parametres/ESD-logo.png

20.8 KB
Loading

parametres/Marron_logo.png

32.7 KB
Loading

parametres/lf-style.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ a#global-view {
864864
}
865865

866866
button#toggle-locations-box {
867-
bottom: 25px;
867+
bottom: 13px;
868868
background: none;
869869
color: #ffffff;
870870
display: flex;
@@ -874,6 +874,8 @@ button#toggle-locations-box {
874874
border-radius: 0px !important;
875875
padding-left: 1%;
876876
width: 100%;
877+
font-size: large;
878+
font-weight: 600;
877879
}
878880

879881
input#filter-input {
@@ -1005,7 +1007,7 @@ h5.plot_title {
10051007
}
10061008

10071009
section.wrapper.image-wrapper.bg-image.bg-overlay.bg-overlay-300 {
1008-
min-height: 100vh;
1010+
min-height: 90vh;
10091011
}
10101012

10111013
div#species-filter-container {

vues/home.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<span>Hide Locations</span>
1818
</button>
1919
<div id="species-filter-container" style="color: white;">
20-
<label for="species-filter" style="font-weight:600;margin-right:8px;">Species:</label>
20+
<label for="species-filter" style="font-weight:600;margin-right:8px;">Species</label>
2121
<select id="species-filter" class="form-select form-select-sm" style="width:auto;display:inline-block;">
2222
<option value="no2">NO₂</option>
2323
<option value="pm25" selected>PM2.5</option>

0 commit comments

Comments
 (0)