Skip to content

Commit

Permalink
fix navigation; back to CONUS
Browse files Browse the repository at this point in the history
  • Loading branch information
harborlighttech authored Oct 20, 2024
1 parent 3c0e18e commit a09e215
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions county.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,19 @@

const urlParams = new URLSearchParams(window.location.search);
const datefile = urlParams.get('date');

const DATE_LABEL = formatDateFromFile(datefile)
const DATEOBJ = getDateObjFromFile(datefile)
const HOUR = getHourFromFile(datefile)

const PREV_DAY = getPreviousDay(DATEOBJ, HOUR)
const PREV_HOUR = getPreviousHour(DATEOBJ, HOUR)
const PREV = getLink(PREV_DAY, '<< day') + " " + getLink(PREV_HOUR, '< hour')
const NEXT_DAY = getNextDay(DATEOBJ, HOUR)
const NEXT_HOUR = getNextHour(DATEOBJ, HOUR)
const NEXT = getLink(NEXT_HOUR, ' hour >') + " " + getLink(NEXT_DAY, ' day >>')
const NAVIGATION = PREV + " || " + NEXT

const scope = urlParams.get('scope');

let centroid = [37.8, -96]
Expand Down Expand Up @@ -239,18 +251,8 @@
counties = props.counties.join('')
}

const dateobj = getDateObjFromFile(datefile)
const hour = getHourFromFile(datefile)

const prevday = getPreviousDay(dateobj, hour)
const prevhour = getPreviousHour(dateobj, hour)
const prev = getLink(prevday, scope, '<< day') + " " + getLink(prevhour, scope, '< hour')
const nextday = getNextDay(dateobj, hour)
const nexthour = getNextHour(dateobj, hour)
const next = getLink(nexthour, scope, ' hour >') + " " + getLink(nextday, scope, ' day >>')
const navigation = prev + " || " + next

const contents = props ? `<b>${props.name}</b><br />${numberWithCommas(props.count)} impacts<br /><br />${counties}` : 'Hover over a county<br/><br/>' + navigation;
const back_link = 'index.html?date='+ datefile
const contents = props ? `${NAVIGATION}<br /><br /><b>${props.name}</b><br />${numberWithCommas(props.count)} impacts<br /><br />${counties}<br /><br />${back_link}` : '${NAVIGATION}<br /><br />Hover over a county<br/><br/>' + back_link;
this._div.innerHTML = `<h4>${title}</h4>${contents}`;
};

Expand Down

0 comments on commit a09e215

Please sign in to comment.