bunchoffixesanddesignthingsplusAIRPORTLETSGOOOOOOOOFINALLY

This commit is contained in:
BuildTools 2022-03-10 23:03:38 -05:00
parent 2530008579
commit 7c6f3893b1
17 changed files with 884 additions and 673 deletions

1149
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -2,15 +2,16 @@
"name": "weatherscan",
"description": "weatherscan emulator",
"scripts": {
"start": "http-server ./webroot"
"start": "node ./webroot/js/cors.js & http-server ./webroot"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Jessecar96/Weatherscan.git"
},
"dependencies": {
"cors-anywhere": "^0.4.4",
"date-fns": "^2.23.0",
"http-server": "^0.12.3",
"http-server": "^14.1.0",
"live-server": "^1.1.0"
},
"devDependencies": {

View File

@ -1674,6 +1674,13 @@ background-image: url(/images/icons/moonphases/new.png);
transform: scale(104.5%, 100%);
transform-origin: left;
}
.info-slide-content.airportpanel .leftpanel em{
font-family: Frutiger;
font-style: normal;
transform-origin: left;
color: #fff;
font-size: 39px;
}
.info-slide-content.airportpanel .leftpanel .frost-pane.top .delayfill {
color: #fff;
font-family: Frutiger;
@ -1763,7 +1770,7 @@ background-image: url(/images/icons/moonphases/new.png);
.info-slide-content.airportpanel .leftpanel .frost-pane.bottom .source {
color: #d8c422;
font-family: Frutiger;
font-size: 22px;
font-size: 24px;
transform: scale(104%, 100%);
text-shadow: #000 2px 2px 2px;
position: absolute;
@ -1909,7 +1916,33 @@ background-image: url(/images/icons/moonphases/new.png);
color: #fff;
position: fixed;
font-size: 33px;
right: 72px;
right: 71px;
}
.info-slide-content.otherairports .airport .delay em{
font-family: Frutiger;
font-style: normal;
transform-origin: left;
color: #fff;
font-size: 39px;
}
.info-slide-content.otherairports .source {
color: #d8c422;
font-family: Frutiger;
font-size: 24px;
transform: scale(104%, 100%);
text-shadow: #000 2px 2px 2px;
position: absolute;
top: 5px;
right: 67.5px;
}
.airport-slide #subhead-source {
color: #d8c422;
font-family: Frutiger;
font-size: 24px;
transform: translateY(-16%) scale(106%, 100%);
text-shadow: #000 2px 2px 2px;
position: absolute;
right: 89px;
}
.info-slide-content.surfreport .leftpanel {
@ -4503,13 +4536,15 @@ label{
.info-slide .segment {
color: #fff;
font-family: Frutiger;
font-size: 52px;
font-family: 'Frutiger 57 Condensed';
font-size: 53px;
text-shadow: #000 2px 2px 2px;
position: absolute;
text-align: left;
right: 117.5px;
bottom: 74.75px;
right: 122.5px;
bottom: 70px;
transform: scale(129%,100%);
transform-origin: right;
}
@keyframes marqueeweatherscan {
0% {transform: translate(0, 0);}
@ -4532,6 +4567,10 @@ label{
animation: marqueeweatherscan 5.5s linear normal forwards;
z-index: 20;
}
.info-slide .weatherscanmarquee span {
display: block;
transform: scale(106%,100%);
}
.health-slide-intro {
position: relative;
background: transparent url(/images/healthintroimage.png) no-repeat bottom;
@ -5696,11 +5735,12 @@ label{
left: 145px;
top: 177px;
text-align: left;
width: 66%;
width: 62.5%;
font-weight: 400;
line-height: 117.5%;
transform: scale(106%,100%);
transform-origin: left;
white-space: normal;
}
#current-info-severe {
font-size: 31px;

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -984,7 +984,7 @@
<div class='accentvii curve'></div>
<div class='accent viii curve' style="display:none"></div>
<div class='accent ix curve' style="display:none"></div>
<div class='weatherscanmarquee' style="display:none">weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan</div>
<div class='weatherscanmarquee' style="display:none"><span>weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan</span></div>
<div class='segment' style="display:none">Airport Conditions</div>
</div>
<div class="info-slide beach-slide-intro" style="display: none">
@ -1027,7 +1027,7 @@
<div class='accent viii curve' style="display:none"></div>
<div class='accent ix curve' style="display:none"></div>
<div class='weatherscanmarquee' style="display:none">weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan</div>
<div class='segment' style="display:none">Ski & Snow</div>
<div class='segment' style="display:none">Garden</div>
</div>
<div class="info-slide ski-slide-intro" style="display: none">
<div class='accent i curve' style="display:none"></div>
@ -1041,7 +1041,7 @@
<div class='accent viii curve' style="display:none"></div>
<div class='accent ix curve' style="display:none"></div>
<div class='weatherscanmarquee' style="display:none">weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan weatherscan</div>
<div class='segment' style="display:none">Golf</div>
<div class='segment' style="display:none">Ski & Snow</div>
</div>
<div class="info-slide health-slide-intro" style="display: none">
<div class='accent i curve' style="display:none"></div>
@ -1060,7 +1060,7 @@
<!-- AIRPORT -->
<div class="info-slide airport-slide" style="display: none">
<div class="info-subheader">
<span class="subhead-titlei"></span><span id="subhead-city"></span>
<span class="subhead-titlei"></span><span id="subhead-city"></span><span id='subhead-source' style='display:none'>Source: flightaware.com</span>
</div>
<div class="info-subheadershadowfix">
<span class="subhead-title">Current Airport Conditions</span>
@ -1104,6 +1104,7 @@
<span class='delay'>DELAY</span>
</div>
<div class='frost-pane'>
<div class='source'>Source: FAA</div>
<div class="airport i">
<div class="airportname"></div>
<div class="temp"></div>
@ -1114,7 +1115,7 @@
<div class="airportname"></div>
<div class="temp"></div>
<div class="icon"></div>
<div class="delay"></div>
<div class="delay"><em>1</em> hr <em>4</em> min</div>
</div>
<div class="airport iii">
<div class="airportname"></div>

13
webroot/js/cors.js Normal file
View File

@ -0,0 +1,13 @@
// Listen on a specific host via the HOST environment variable
var host = process.env.HOST || '127.0.0.1';
// Listen on a specific port via the PORT environment variable
var port = process.env.PORT || 8081;
var cors_proxy = require('cors-anywhere');
cors_proxy.createServer({
originWhitelist: [], // Allow all origins
// requireHeader: ['origin', 'x-requested-with'],
// removeHeaders: ['cookie', 'cookie2']
}).listen(port, host, function() {
console.log('Running CORS Anywhere on ' + host + ':' + port);
});

View File

@ -1,4 +1,4 @@
var noreportmode = false;
var noreportmodecc = false, noreportmodefc = false, noreportmodeac = false;
var marqueeforecasttype = 'forecast'
//do audio thing and second marquee
$(function(){
@ -67,53 +67,95 @@ function MarqueeMan() {
}
// for ccticker
function displayCCTickerData() {
var $span,$spanfor;
var $span,$spanfor,$spanair;
// ajax the latest observation
$(".marquee-current").remove()
$(".marquee-fore").remove()
if (weatherInfo.ccticker.noReport == true) {
noreportmode = true
$('#arrow-img').attr("src",'/images/arrow.png');
} else {noreportmode == false}
$(".marquee-airport").remove()
if (weatherInfo.ccticker.noReportCC == true) {
noreportmodecc = true
} else {noreportmodecc == false}
if (weatherInfo.ccticker.noReportFC == true) {
noreportmodefc = true
} else {noreportmodefc == false}
if (weatherInfo.ccticker.noReportAC == true) {
noreportmodeac = true
} else {noreportmodeac == false}
weatherInfo.ccticker.ccLocs.forEach((ccLoc, i) => {
$span = $("<span class=marquee-current id='" + "cclocation" + i + "'></span>").appendTo('#marquee-now');
$spanfor = $("<span class=marquee-fore id='" + "cclocation" + i + "'></span>").appendTo('#marquee-now');
$span.text(ccLoc.displayname + ((noreportmode == true) ? "" : ccLoc.currentCond.temp + ' ' + ccLoc.currentCond.cond));
$span.text(ccLoc.displayname + ((noreportmodecc == true) ? "" : ccLoc.currentCond.temp + ' ' + ccLoc.currentCond.cond));
$spanfor.css('display','none')
$spanfor.text(ccLoc.displayname + ((noreportmode == true) ? "" : ccLoc.forecast.temp + ' ' + ccLoc.forecast.cond));
$span.css('display','none')
$spanfor.text(ccLoc.displayname + ((noreportmodefc == true) ? "" : ccLoc.forecast.temp + ' ' + ccLoc.forecast.cond));
});
weatherInfo.ccticker.ccairportdelays.forEach((ccAirLoc, i) => {
$spanair = $("<span class=marquee-airport id='" + "aclocation" + i + "'></span>").appendTo('#marquee-now');
$spanair.css('display','none')
$spanair.text((ccAirLoc.displayname).replace('International',"Int'l")+ ': ' + ((noreportmodeac == true) ? "" : ccAirLoc.temp + ' ' + ccAirLoc.cond + ', ' + ccAirLoc.delay));
});
};
function refreshMarquee () {
if (marqueeforecasttype == 'now') {
marqueeforecasttype = 'forecast'
if (noreportmode == false) {
$('#arrow-img').attr("src",'/images/' + weatherInfo.ccticker.arrow + 'arrow.png');
}
$('.marquee-fore').each(function(i, item) {
item.style.display = ''
});$('.marquee-current').each(function(i, item) {
item.style.display = 'none'
});
} else {
marqueeforecasttype = 'now'
if (noreportmode == false) {
function refreshMarquee (idx) {
var currentDisplay,
displays = {
marqueeairport() {
$('.track-info').show()
$('#arrow-img').attr("src",'/images/now.png');
$('.marquee-fore').each(function(i, item) {
item.style.display = 'none'
});
$('.marquee-airport').each(function(i, item) {
item.style.display = ''
});
$('.marquee-current').each(function(i, item) {
item.style.display = 'none'
});
}
,marqueecurrent() {
$('#arrow-img').attr("src",'/images/now.png');
$('.track-info').hide()
$('.marquee-fore').each(function(i, item) {
item.style.display = 'none'
});
$('.marquee-airport').each(function(i, item) {
item.style.display = 'none'
});
$('.marquee-current').each(function(i, item) {
item.style.display = ''
});
}
,marqueeforecast() {
$('.track-info').hide()
if (noreportmodefc == false) {
$('#arrow-img').attr("src",'/images/' + weatherInfo.ccticker.arrow + 'arrow.png');
} else {
$('#arrow-img').attr("src",'/images/arrow.png');
}
marqueeforecasttype = 'forecast'
$('.marquee-fore').each(function(i, item) {
item.style.display = ''
});
$('.marquee-current').each(function(i, item) {
item.style.display = 'none'
});
$('.marquee-airport').each(function(i, item) {
item.style.display = 'none'
});
}
$('.marquee-fore').each(function(i, item) {
item.style.display = 'none'
});
$('.marquee-current').each(function(i, item) {
item.style.display = ''
});
}
keys = Object.keys(displays);
if (noreportmodeac == true && idx == 0) {idx == 1}
if (noreportmodecc == true && idx == 1) {idx == 2}
currentDisplay = displays[keys[idx]];
currentDisplay();
$('#marquee-container')
.marquee('destroy')
.marquee({speed: 200, pauseOnHover:true, delayBeforeStart:3000})
.on('finished', refreshMarquee);
.marquee({speed: 200, pauseOnHover:true, delayBeforeStart:1000})
.on('finished', function() {refreshMarquee(((idx < 2) ? ++idx : 0))});
}
//init and loop the things
refreshMarquee();
refreshMarquee(0);
switchToWarningMarquee();
displayCCTickerData();
setInterval(function(){

View File

@ -18,9 +18,7 @@ function Loops() {
if (loopssevereweathermode == false){
$('#minimap').fadeIn(0)
$('#minimap-title').fadeIn(0)
if (miniMap===undefined) {
miniMap = new Radar("minimap", 3, 7, maincitycoords.lat, maincitycoords.lon);
}
miniMap = new Radar("minimap", 3, 7, maincitycoords.lat, maincitycoords.lon);
}
} else {
$('#minimap').fadeOut(0)

View File

@ -313,27 +313,29 @@ var weatherInfo = { currentCond: {
{day:"",time:"",index:"",desc:""},
{day:"",time:"",index:"",desc:""}
]}, airport: {noReport: false, mainairports:[
{displayname:"Gainesville Regional Airport",arrivals:{delay:"No Report",reason:""},departures:{delay:"No Report",reason:""},temp:"75",cond:"Mostly Cloudy",icon:"16",windspeed:"0"},
{displayname:"Jacksonville International Airport",arrivals:{delay:"1hr 15min",reason:"Rain"},departures:{delay:"",reason:""},temp:"78",cond:"Rain",icon:"16",windspeed:"0"}
], otherairports:[
{displayname:"New York / LaGaurdia",delay:"No Delay",temp:"75",icon:"16",windspeed:"0"},
{displayname:"Chicago O'hare Int'l",delay:"No Delay",temp:"75",icon:"16",windspeed:"0"},
{displayname:"Los Angeles Int'l",delay:"No Delay",temp:"75",icon:"16",windspeed:"0"},
{displayname:"Atlanta International",delay:"No Delay",temp:"75",icon:"16",windspeed:"0"},
{displayname:"Dallas / Ft. Worth Int'l",delay:"No Delay",temp:"75",icon:"16",windspeed:"0"},
{displayname:"Denver International",delay:"No Delay",temp:"75",icon:"16",windspeed:"0"},
{displayname:"Boston / Logan Int'l",delay:"No Delay",temp:"75",icon:"16",windspeed:"0"},
{displayname:"Salt Lake City Int'l",delay:"No Delay",temp:"75",icon:"16",windspeed:"0"},
{displayname:"Miami International",delay:"No Delay",temp:"75",icon:"16",windspeed:"0"},
{displayname:"Phoenix / Sky Harbor",delay:"No Delay",temp:"75",icon:"16",windspeed:"0"},
{displayname:"Minneapolis - St. Paul",delay:"No Delay",temp:"75",icon:"16",windspeed:"0"},
{displayname:"Washington Dulles Int'l",delay:"No Delay",temp:"75",icon:"16",windspeed:"0"},
{displayname:"San Francisco Int'l",delay:"No Delay",temp:"75",icon:"16",windspeed:"0"},
{displayname:"Philadelphia Int'l",delay:"No Delay",temp:"75",icon:"16",windspeed:"0"},
{displayname:"Seattle - Tacoma Int'l",delay:"No Delay",temp:"75",icon:"16",windspeed:"0"},
{displayname:"Lambert - St. Louis Int'l",delay:"No Delay",temp:"75",icon:"16",windspeed:"0"},
{displayname:"",iata:"MIA",arrivals:{delay:"No Delay",reason:""},departures:{delay:"No Delay",reason:""},temp:"",cond:"",icon:"",windspeed:""},
{displayname:"",iata:"MCO",arrivals:{delay:"No Delay",reason:""},departures:{delay:"No Delay",reason:""},temp:"",cond:"",icon:"",windspeed:""}
], delays: [],
//{iato:"",type:"",amount:"",amountmin:"",reason:""}
otherairports:[
{displayname:"New York / LaGaurdia",iata:"LGA",delay:"No Delay",temp:"",icon:"",windspeed:""},
{displayname:"Chicago O'hare Int'l",iata:"ORD",delay:"No Delay",temp:"",icon:"",windspeed:""},
{displayname:"Los Angeles Int'l",iata:"LAX",delay:"No Delay",temp:"",icon:"",windspeed:""},
{displayname:"Atlanta International",iata:"LAX",delay:"No Delay",temp:"",icon:"",windspeed:""},
{displayname:"Dallas / Ft. Worth Int'l",iata:"DFW",delay:"No Delay",temp:"",icon:"",windspeed:""},
{displayname:"Denver International",iata:"DEN",delay:"No Delay",temp:"",icon:"",windspeed:""},
{displayname:"Boston / Logan Int'l",iata:"BOS",delay:"No Delay",temp:"",icon:"",windspeed:""},
{displayname:"Salt Lake City Int'l",iata:"SLC",delay:"No Delay",temp:"",icon:"",windspeed:""},
{displayname:"Miami International",iata:"MIA",delay:"No Delay",temp:"",icon:"",windspeed:""},
{displayname:"Phoenix / Sky Harbor",iata:"PHX",delay:"No Delay",temp:"",icon:"",windspeed:""},
{displayname:"Minneapolis - St. Paul",iata:"MSP",delay:"No Delay",temp:"",icon:"",windspeed:""},
{displayname:"Washington Dulles Int'l",iata:"IAD",delay:"No Delay",temp:"",icon:"",windspeed:""},
{displayname:"San Francisco Int'l",iata:"SFO",delay:"No Delay",temp:"",icon:"",windspeed:""},
{displayname:"Philadelphia Int'l",iata:"PHL",delay:"No Delay",temp:"",icon:"",windspeed:""},
{displayname:"Seattle - Tacoma Int'l",iata:"SEA",delay:"No Delay",temp:"",icon:"",windspeed:""},
{displayname:"Lambert - St. Louis Int'l",iata:"STL",delay:"No Delay",temp:"",icon:"",windspeed:""},
]},
ccticker: {noReport:false,arrow:"",ccLocs:[]},
ccticker: {noReportCC:false,noReportFC:false,noReportAC:false,arrow:"",ccLocs:[],ccairportdelays:[]},
radarTempUnavialable: false,
radarWinterLegend: false,
reboot: false,
@ -354,7 +356,7 @@ function grabCity8SlidesData() {
var city8sldieslocs = {displayname:"",temp:"",icon:"",wind:"",windspeed:""}
city8sldieslocs.temp = ajaxedLoc["v3-wx-observations-current"].temperature
city8sldieslocs.icon = ajaxedLoc["v3-wx-observations-current"].iconCode
city8sldieslocs.wind = ((ajaxedLoc["v3-wx-observations-current"].windDirectionCardinal == "CALM" || ajaxedLoc["v3-wx-observations-current"].windSpeed == 0) ? 'calm' : ajaxedLoc["v3-wx-observations-current"].windDirectionCardinal) + ' ' + ((ajaxedLoc["v3-wx-observations-current"].windSpeed === 0) ? '' : ajaxedLoc["v3-wx-observations-current"].windSpeed)
city8sldieslocs.wind = ((ajaxedLoc["v3-wx-observations-current"].windDirectionCardinal == "CALM" || ajaxedLoc["v3-wx-observations-current"].windSpeed == 0) ? 'Calm' : ajaxedLoc["v3-wx-observations-current"].windDirectionCardinal) + ' ' + ((ajaxedLoc["v3-wx-observations-current"].windSpeed === 0) ? '' : ajaxedLoc["v3-wx-observations-current"].windSpeed)
city8sldieslocs.windspeed = ajaxedLoc["v3-wx-observations-current"].windSpeed
city8sldieslocs.displayname = (citySlideList[i].displayname)
weatherInfo.currentCond.city8slides.cities.push(city8sldieslocs)
@ -477,7 +479,7 @@ function grabCitySlidesData() {
weatherLocsDP.daytitle = buildHourlyHeaderTitle(ajaxedLoc["v3-wx-forecast-hourly-2day"].validTimeLocal[indexes[0]])
for (var hi = 0; hi < 4; hi++) {
weatherLocsDP.hour[hi].time = buildHourlyTimeTitle(ajaxedLoc["v3-wx-forecast-hourly-2day"].validTimeLocal[indexes[hi]])
weatherLocsDP.hour[hi].cond = ajaxedLoc["v3-wx-forecast-hourly-2day"].wxPhraseLong[indexes[hi]].replace('Scattered ', "Sct'd ").replace('Thunderstorms',"T'Storms").replace('/',', ');
weatherLocsDP.hour[hi].cond = ajaxedLoc["v3-wx-forecast-hourly-2day"].wxPhraseLong[indexes[hi]].replace('Scattered ', "Sct'd ").replace('Thunderstorms',"T'Storms").replace('Thundershowers',"T'Showers").replace('/',', ');
weatherLocsDP.hour[hi].icon = ajaxedLoc["v3-wx-forecast-hourly-2day"].iconCode[indexes[hi]]
weatherLocsDP.hour[hi].temp = ajaxedLoc["v3-wx-forecast-hourly-2day"].temperature[indexes[hi]]
weatherLocsDP.hour[hi].wind = ajaxedLoc["v3-wx-forecast-hourly-2day"].windDirectionCardinal[indexes[hi]] + ' ' + ajaxedLoc["v3-wx-forecast-hourly-2day"].windSpeed[indexes[hi]]
@ -502,7 +504,7 @@ function grabCitySlidesData() {
for (var hi = (ajaxedLoc["v3-wx-forecast-daily-5day"].daypart[0].daypartName[0] == null) ? 1 : 0, hidp = (ajaxedLoc["v3-wx-forecast-daily-5day"].daypart[0].daypartName[0] == null) ? 2 : 0; hi < 5 + daycorrection; hi++, hidp = hidp + 2) {
weatherLocsFD.day[hi - daycorrection].name = ajaxedLoc["v3-wx-forecast-daily-5day"].dayOfWeek[hi].substring(0,3)
weatherLocsFD.day[hi - daycorrection].icon = ajaxedLoc["v3-wx-forecast-daily-5day"].daypart[0].iconCode[hidp]
weatherLocsFD.day[hi - daycorrection].cond = ajaxedLoc["v3-wx-forecast-daily-5day"].daypart[0].wxPhraseLong[hidp].replace('Scattered ', "Sct'd ").replace('Thunderstorms',"T'Storms").replace('/',', ');
weatherLocsFD.day[hi - daycorrection].cond = ajaxedLoc["v3-wx-forecast-daily-5day"].daypart[0].wxPhraseLong[hidp].replace('Scattered ', "Sct'd ").replace('Thunderstorms',"T'Storms").replace('Thundershowers',"T'Showers").replace('/',', ');
weatherLocsFD.day[hi - daycorrection].high = ajaxedLoc["v3-wx-forecast-daily-5day"].temperatureMax[hi]
weatherLocsFD.day[hi - daycorrection].windspeed = ajaxedLoc["v3-wx-forecast-daily-5day"].daypart[0].windSpeed[hidp]
weatherLocsFD.day[hi - daycorrection].low = ajaxedLoc["v3-wx-forecast-daily-5day"].temperatureMin[hi]
@ -510,7 +512,7 @@ function grabCitySlidesData() {
weatherLocsFD.displayname = ((i ==0 ) ? maincitycoords.displayname : locList[i-1].displayname)
weatherInfo.fiveDay.weatherLocs.push(weatherLocsFD)
//bulletin
var weatherLocsWA = {displayname:"",pages:[]};
var weatherLocsWA = {displayname:"",pages:[],enabled: false};
weatherLocsWA.displayname = ((i ==0 ) ? maincitycoords.displayname : locList[i-1].displayname)
if (ajaxedLoc["v3alertsHeadlines"] != undefined){
var displayday;
@ -570,9 +572,10 @@ function grabCitySlidesData() {
});
}
splitLines()
weatherLocsWA.enabled = true
weatherInfo.bulletin.weatherLocs.push(weatherLocsWA)
}
}
} else {weatherInfo.bulletin.weatherLocs.push(weatherLocsWA)}
});
})
}
@ -687,7 +690,7 @@ function grabSideandLowerBarData() {
weatherInfo.dayPart.lowerbar.daytitle = buildHourlyHeaderTitle(ajaxedLoc["v3-wx-forecast-hourly-2day"].validTimeLocal[indexes[0]])
for (var hi = 0; hi < 4; hi++) {
weatherInfo.dayPart.lowerbar.hour[hi].time = buildHourlyTimeTitle(ajaxedLoc["v3-wx-forecast-hourly-2day"].validTimeLocal[indexes[hi]])
weatherInfo.dayPart.lowerbar.hour[hi].cond = ajaxedLoc["v3-wx-forecast-hourly-2day"].wxPhraseLong[indexes[hi]].replace('Scattered ', "Sct'd ").replace('Thunderstorms',"T'Storms").replace('/',', ')
weatherInfo.dayPart.lowerbar.hour[hi].cond = ajaxedLoc["v3-wx-forecast-hourly-2day"].wxPhraseLong[indexes[hi]].replace('Scattered ', "Sct'd ").replace('Thunderstorms',"T'Storms").replace('Thundershowers',"T'Showers").replace('/',', ')
weatherInfo.dayPart.lowerbar.hour[hi].icon = ajaxedLoc["v3-wx-forecast-hourly-2day"].iconCode[indexes[hi]]
weatherInfo.dayPart.lowerbar.hour[hi].temp = ajaxedLoc["v3-wx-forecast-hourly-2day"].temperature[indexes[hi]]
weatherInfo.dayPart.lowerbar.hour[hi].wind = ajaxedLoc["v3-wx-forecast-hourly-2day"].windDirectionCardinal[indexes[hi]] + ' ' + ajaxedLoc["v3-wx-forecast-hourly-2day"].windSpeed[indexes[hi]]
@ -710,7 +713,7 @@ function grabSideandLowerBarData() {
weatherInfo.fiveDay.lowerbar.day[hi - daycorrection].name = ajaxedLoc["v3-wx-forecast-daily-5day"].dayOfWeek[hi].substring(0,3)
weatherInfo.fiveDay.lowerbar.day[hi - daycorrection].windspeed = ajaxedLoc["v3-wx-forecast-daily-5day"].daypart[0].windSpeed[hidp]
weatherInfo.fiveDay.lowerbar.day[hi - daycorrection].icon = ajaxedLoc["v3-wx-forecast-daily-5day"].daypart[0].iconCode[hidp]
weatherInfo.fiveDay.lowerbar.day[hi - daycorrection].cond = ajaxedLoc["v3-wx-forecast-daily-5day"].daypart[0].wxPhraseLong[hidp].replace('Scattered ', "Sct'd ").replace('Thunderstorms',"T'Storms").replace('/',', ');
weatherInfo.fiveDay.lowerbar.day[hi - daycorrection].cond = ajaxedLoc["v3-wx-forecast-daily-5day"].daypart[0].wxPhraseLong[hidp].replace('Scattered ', "Sct'd ").replace('Thunderstorms',"T'Storms").replace('Thundershowers',"T'Showers").replace('/',', ');
weatherInfo.fiveDay.lowerbar.day[hi - daycorrection].high = ajaxedLoc["v3-wx-forecast-daily-5day"].temperatureMax[hi]
weatherInfo.fiveDay.lowerbar.day[hi - daycorrection].low = ajaxedLoc["v3-wx-forecast-daily-5day"].temperatureMin[hi]
weatherInfo.fiveDay.lowerbar.day[hi - daycorrection].weekend = ((dateFns.isWeekend(ajaxedLoc["v3-wx-forecast-daily-5day"].validTimeLocal[hi])) ? ' weekend' : '')
@ -911,6 +914,130 @@ function grabHealthData() {
}
})
}
function grabAirportDelayData() {
$.getJSON('http://127.0.0.1:8081/https://nasstatus.faa.gov/api/airport-events', function(eventdata) {
for (const airportevent of eventdata) {
var airportdelay = {iata:"",type:"",amount:"",reason:""}
if (airportevent.airportClosure) {
airportdelay.iata = airportevent.airportId
airportdelay.type = 'Closure'
airportdelay.amount = 'Closed'
airportdelay.amountmin = 99999999999999999999999999999999999999999999999999
airportdelay.reason = ''
weatherInfo.airport.delays.push(airportdelay)
}
if (airportevent.arrivalDelay) {
airportdelay.iata = airportevent.airportId
airportdelay.type = 'Arrival'
airportdelay.amount = formatMinutes(airportevent.arrivalDelay.averageDelay)
airportdelay.amountmin = airportevent.departureDelay.averageDelay
airportdelay.reason = airportevent.arrivalDelay.reason
weatherInfo.airport.delays.push(airportdelay)
}
if (airportevent.departureDelay) {
airportdelay.iata = airportevent.airportId
airportdelay.type = 'Departure'
airportdelay.amount = formatMinutes(airportevent.departureDelay.averageDelay)
airportdelay.amountmin = airportevent.departureDelay.averageDelay
airportdelay.reason = airportevent.departureDelay.reason
weatherInfo.airport.delays.push(airportdelay)
}
if (airportevent.groundDelay) {
airportdelay.iata = airportevent.airportId
airportdelay.type = 'Arrival'
airportdelay.amount = formatMinutes(airportevent.groundDelay.avgDelay)
airportdelay.amountmin = airportevent.groundDelay.avgDelay
airportdelay.reason = airportevent.groundDelay.impactingCondition
weatherInfo.airport.delays.push(airportdelay)
}
if (airportevent.groundStop) {
airportdelay.iata = airportevent.airportId
airportdelay.type = 'Arrival'
airportdelay.amount = 'until...'
airportdelay.reason = airportevent.groundStop.impactingCondition
weatherInfo.airport.delays.push(airportdelay)
}
};
grabAirportData()
})
}
grabAirportDelayData()
function grabAirportData() {
var mairporturl = 'https://api.weather.com/v3/aggcommon/v3-location-point;v3-wx-observations-current?iataCodes='
for (var i = 0; i < weatherInfo.airport.mainairports.length; i++) {
mairporturl += weatherInfo.airport.mainairports[i].iata + ';'
}
mairporturl += '&language=en-US&units=e&format=json&apiKey='+ api_key
//{displayname:"New York / LaGaurdia",iata:"LGA",delay:"No Delay",temp:""}
$.getJSON(mairporturl, function(data) {
data.forEach((airport, i) => {
var marqueedelay = {iato:"",type:"",amount:"",amountmin:0,reason:""};
var airportdepartdelay = {iato:"",type:"",amount:"",amountmin:0,reason:""};
var airportarrivaldelay = {iato:"",type:"",amount:"",amountmin:0,reason:""};
var marqueeairport = {displayname:"",iata:"LGA",delay:"No Delay",temp:"",cond:""}
weatherInfo.airport.mainairports[i].displayname = airport['v3-location-point'].location.airportName
weatherInfo.airport.mainairports[i].temp = airport['v3-wx-observations-current'].temperature
weatherInfo.airport.mainairports[i].cond = airport['v3-wx-observations-current'].wxPhraseLong
weatherInfo.airport.mainairports[i].icon = airport['v3-wx-observations-current'].iconCode
weatherInfo.airport.mainairports[i].windspeed = airport['v3-wx-observations-current'].windSpeed
marqueeairport.displayname = airport['v3-location-point'].location.airportName
marqueeairport.temp = airport['v3-wx-observations-current'].temperature
marqueeairport.cond = airport['v3-wx-observations-current'].wxPhraseLong.toLowerCase();
marqueeairport.iata = weatherInfo.airport.mainairports[i].iata
for (const delay of weatherInfo.airport.delays) {
if (delay.iata == weatherInfo.airport.mainairports[i].iata) {
if (delay.amountmin > marqueedelay.amountmin) {
marqueedelay = delay
marqueeairport.delay = (delay.amount).replace('<em>','').replace('</em>','')
}
if (delay.type == 'Arrival') {
if (delay.amountmin > airportarrivaldelay.amountmin) {
airportarrivaldelay = delay
weatherInfo.airport.mainairports[i].arrivals.delay = delay.amount
weatherInfo.airport.mainairports[i].arrivals.reason = delay.reason
}
} else if (delay.type == 'Departure') {
if (delay.amountmin > airportdepartdelay.amountmin) {
airportdepartdelay = delay
weatherInfo.airport.mainairports[i].departures.delay = delay.amount
weatherInfo.airport.mainairports[i].departures.reason = delay.reason
}
} else if (delay.type == 'Closure'){
airportdepartdelay = delay
airportarrivaldelay = delay
weatherInfo.airport.mainairports[i].arrivals.delay = 'Closed'
weatherInfo.airport.mainairports[i].departures.delay = 'Closed'
}
}
};
weatherInfo.ccticker.ccairportdelays.push(marqueeairport)
});
});
//otherairport
var oairporturl = 'https://api.weather.com/v3/aggcommon/v3-wx-observations-current?iataCodes='
for (var i = 0; i < weatherInfo.airport.otherairports.length; i++) {
oairporturl += weatherInfo.airport.otherairports[i].iata + ';'
}
oairporturl += '&language=en-US&units=e&format=json&apiKey='+ api_key
$.getJSON(oairporturl, function(data) {
data.forEach((airport, i) => {
var airportdelays = {iato:"",type:"",amount:"",amountmin:0,reason:""};
weatherInfo.airport.otherairports[i].temp = airport['v3-wx-observations-current'].temperature
weatherInfo.airport.otherairports[i].icon = airport['v3-wx-observations-current'].iconCode
weatherInfo.airport.otherairports[i].windspeed = airport['v3-wx-observations-current'].windSpeed
weatherInfo.airport.delays.forEach((delay, delayi) => {
if (delay.iata == weatherInfo.airport.otherairports[i].iata) {
if (delay.amountmin > airportdelays.amountmin) {
airportdelays = delay
weatherInfo.airport.otherairports[i].delay = delay.amount
}
}
});
});
});
}
function pullCCTickerData() {
var ccurl = 'https://api.weather.com/v3/aggcommon/v3-wx-forecast-daily-5day;v3-wx-observations-current;v3-location-point?geocodes=';
// ajax the latest observation

View File

@ -1,4 +1,4 @@
var mmap
var mmap,mmmap
function Radar(divIDin, intervalHoursIn, zoomIn, latitudeIn, longitudeIn, withSat) {
var map,
divID = divIDin,
@ -25,7 +25,8 @@ function Radar(divIDin, intervalHoursIn, zoomIn, latitudeIn, longitudeIn, withSa
var endDate = roundDate(new Date()),
player;
if (mmap !== undefined) { mmap.remove(); }
if (divID == 'radar-1') {if (mmap !== undefined) { mmap.remove(); }};
if (divID == 'minimap') {if (mmmap !== undefined) { mmmap.remove(); }};
map = L.map(divID, {
zoom: zoom,
fullscreenControl: false,
@ -35,7 +36,9 @@ function Radar(divIDin, intervalHoursIn, zoomIn, latitudeIn, longitudeIn, withSa
});
if (divID == "radar-1") {
mmap = map;
}
} else if (divID == "minimap") {
mmmap = map;
};
// basemap
// streets cj9fqw1e88aag2rs2al6m3ko2

View File

@ -72,7 +72,7 @@ var mainMap
var currentDisplay,
displays = {
showBulletin() {
if (weatherInfo.bulletin.weatherLocs[0]) {
if (weatherInfo.bulletin.weatherLocs[0].enabled == true) {
$('.bulletin .frost-pane .cityname').text(weatherInfo.bulletin.weatherLocs[0].displayname + " Area");
//fade in
$('.bulletin').fadeIn(0);
@ -504,7 +504,7 @@ var mainMap
var currentDisplay,
displays = {
bulletin() {
if (weatherInfo.bulletin.weatherLocs[0]) {
if (weatherInfo.bulletin.weatherLocs[0] == true) {
$('.bulletin .frost-pane .cityname').text(weatherInfo.bulletin.weatherLocs[0].displayname + " Area");
//fade in
$('.bulletin').fadeIn(0);
@ -604,6 +604,10 @@ var mainMap
function showRadar(lat, long, zoom, time, withsat) {
// fade out info, fade in radar
weatherAudio.playLocalRadar();
if (withsat == true) {
$('.radar-slide .infosubbheader .subheadtitle').text('Radar/Satellite')
$('.radar-slide .radar-legends .pastlegend').text('Past 5 Hours')
}
$('.radar-slide').fadeIn(0);
if (weatherInfo.radarTempUnavialable == true) {
$('.radar-slide .tempunavailable').fadeIn(500);
@ -617,6 +621,10 @@ var mainMap
$('.radar-slide .tempunavailable').fadeOut(500);
}
$('.radar-content').fadeOut(500, function() {
if (withsat == true) {
$('.radar-slide .infosubbheader .subheadtitle').text('Local Doppler Radar')
$('.radar-slide .radar-legends .pastlegend').text('Past 3 Hours')
}
$('.radar-slide').fadeOut(0);
});
}, time);
@ -658,9 +666,9 @@ var mainMap
function fillinfo() {
aidx = (aidx===undefined ? 0 : aidx);
$('.info-slide-content.airportpanel .leftpanel .thing').text(weatherInfo.airport.mainairports[aidx].displayname)
$('.info-slide-content.airportpanel .top .delayfill').text(weatherInfo.airport.mainairports[aidx].arrivals.delay)
$('.info-slide-content.airportpanel .top .delayfill').html(weatherInfo.airport.mainairports[aidx].arrivals.delay)
$('.info-slide-content.airportpanel .top .reasonfill').text(weatherInfo.airport.mainairports[aidx].arrivals.reason)
$('.info-slide-content.airportpanel .bottom .delayfill').text(weatherInfo.airport.mainairports[aidx].departures.delay)
$('.info-slide-content.airportpanel .bottom .delayfill').html(weatherInfo.airport.mainairports[aidx].departures.delay)
$('.info-slide-content.airportpanel .bottom .reasonfill').text(weatherInfo.airport.mainairports[aidx].departures.reason)
$('.info-slide-content.airportpanel .temp').text(weatherInfo.airport.mainairports[aidx].temp)
$('.info-slide-content.airportpanel .conditions').text(weatherInfo.airport.mainairports[aidx].cond)
@ -710,7 +718,7 @@ var mainMap
$('.info-slide-content.otherairports .airport.' + divnumbers[di] + ' .airportname').text(weatherInfo.airport.otherairports[i].displayname);
$('.info-slide-content.otherairports .airport.' + divnumbers[di] + ' .temp').text(weatherInfo.airport.otherairports[i].temp);
$('.info-slide-content.otherairports .airport.' + divnumbers[di] + ' .icon').css('background-image', 'url("' + getCCicon(+weatherInfo.airport.otherairports[i].icon, weatherInfo.airport.otherairports[i].windspeed) + '")');
$('.info-slide-content.otherairports .airport.' + divnumbers[di] + ' .delay').text(weatherInfo.airport.otherairports[i].delay);
$('.info-slide-content.otherairports .airport.' + divnumbers[di] + ' .delay').html(weatherInfo.airport.otherairports[i].delay);
} else {
$('.info-slide-content.otherairports .airport.' + divnumbers[di] + ' .airportname').text("");
$('.info-slide-content.otherairports .airport.' + divnumbers[di] + ' .temp').text("");
@ -1235,7 +1243,7 @@ var mainMap
} else {wait(0)}
}
,showBulletin() {
if (weatherInfo.bulletin.weatherLocs[location]) {
if (weatherInfo.bulletin.weatherLocs[location].enabled == true) {
$('.bulletin .frost-pane .cityname').text(weatherInfo.bulletin.weatherLocs[location].displayname + " Area");
//fade in
$('.bulletin').fadeIn(0);

View File

@ -30,7 +30,12 @@ function getUrlParameter(e) {
return decodeURI((new RegExp(e + "=(.+?)(&|$)").exec(location.search) || [, null])[1])
}
//convert minutes to hour and minutes
function formatMinutes(m){
var hours = Math.trunc(m/60);
var minutes = m % 60;
return (((hours != 0) ? ('<em>' + hours + '</em> hr <em>') : '<em>') + minutes +'</em> min');
}
// convert celsius to farenheight
function C2F(c){