/* headings: RADAR < MAIN CITY < CITY 1 < CITY 2 */ var buildHeaderGlobal; var showsevercityslides = false; var mainMap // load slide data function Slides() { severemode = false; var radarSlideDuration = 60000, slideDelay = 10000; // for later var selectval = 0; buildHeader(); setTimeout(function() { if (weatherInfo.radarWinterLegend == true) {$('.radar-color-legend-winter').fadeOut(500)} else {$('.radar-color-legend').fadeOut(500)} $('.radar-content').fadeOut(500, function() { $('.radar-slide').fadeOut(0); nextCity() }); }, 800); // loop cities function nextCity(){ //severe weather mode if (weatherInfo.bulletin.severeweathermode == true) { $('.city-slide-intro .segment').text(location.city); $('#info-slides-header .hscroller').empty(); $('#info-slides-header .hscroller').append("SEVERE WEATHER UPDATE"); $('#current-info').fadeOut(0) $('#current-info-severe').fadeIn(0) $('#current-info-details').fadeIn(0) loopssevereweathermode = true $('#minimap').fadeOut(0) $('#minimap-title').fadeOut(0) $('.radar-slide .info-subheader').css('background', 'linear-gradient(to top, #868686 0, #868686 100%)') displaySevereAtmospheric(0) showSevereSlides(0); } else { //non severe advanceHeader(); var city = $('#info-slides-header .city.current'); // is radar or city? if (city[0].dataset.dname) { // show slide deck for the current city showCitySlides(city[0].dataset.dname, 0 ); } else { if (city[0].classList.contains("radar")) { showRadar(maincitycoords.lat, maincitycoords.lon, 8, 60000, false); setTimeout(nextCity, 60500); } else if (city[0].classList.contains("airport")) { showAirport(0); } else if (city[0].classList.contains("healthh")) { showHealth(0); } else if (city[0].classList.contains("beach")) { showMarine(0); } } } } function showSevereSlides(idx) { if (showsevercityslides == true) { var currentDisplay, displays = { showBulletin() { if (weatherInfo.bulletin.weatherLocs[0]) { $('.bulletin .frost-pane .cityname').text(weatherInfo.bulletin.weatherLocs[0].displayname + " Area"); //fade in $('.bulletin').fadeIn(0); $('.bulletin .frost-pane').fadeIn(500); $('#subhead-noaa').fadeIn(500); pages = weatherInfo.bulletin.weatherLocs[0].pages makewarningPage(0) function makewarningPage(warningpagenum) { if (warningpagenum > 0) { $('.bulletin .frost-pane').fadeOut(500, function() { $('.bulletin .frost-pane .warnings').html(pages[warningpagenum]) $('.bulletin .frost-pane').fadeIn(500); }); } else { $('.bulletin .frost-pane .warnings').html(pages[warningpagenum]) $('.bulletin .frost-pane').fadeIn(500); } setTimeout(function() { if (warningpagenum < (pages.length - 1)) { makewarningPage(warningpagenum + 1) } else { $('.bulletin').fadeIn(0); $('.bulletin .frost-pane').fadeOut(500); $('#subhead-noaa').fadeOut(500, function() { $('.bulletin').fadeOut(0); wait(0) }); } }, slideDelay); } } else {wait(0)}; } // Currently (10 sec) ,currentConditions() { $('.severe-city-info-slide .subhead-title').text('Currently'); $('.severe-city-info-slide #subhead-city').text(weatherInfo.currentCond.weatherLocs[0].displayname); if (weatherInfo.currentCond.weatherLocs[0].noReport == true) { $('.severe-city-info-slide .noreport').fadeIn(500) $('.severe-city-info-slide').fadeIn(0); setTimeout(function() { $('.severe-city-info-slide .noreport').fadeOut(500, function(){ $('.severe-city-info-slide').fadeOut(0); wait(0); }); }, slideDelay); } else { var strLabels = 'Humidity
Dew Point
Pressure
Wind
', strData = weatherInfo.currentCond.weatherLocs[0].humid + '%
' + weatherInfo.currentCond.weatherLocs[0].dewpt + '
' + weatherInfo.currentCond.weatherLocs[0].pressure + " " + weatherInfo.currentCond.weatherLocs[0].pressureTrend + '
' + weatherInfo.currentCond.weatherLocs[0].wind + '
'; strLabels+='Gusts
'; strData+=weatherInfo.currentCond.weatherLocs[0].gust + '
'; if (weatherInfo.currentCond.weatherLocs[0].feelslike.type != "dontdisplay") { strLabels+=weatherInfo.currentCond.weatherLocs[0].feelslike.type strData+=weatherInfo.currentCond.weatherLocs[0].feelslike.val } $('.severe-city-info .frost-pane .labels').html(strLabels); $('.severe-city-info .frost-pane .data').html(strData); // right pane $('.severe-city-info .icon').css('background-image', 'url("' + getCCicon(+weatherInfo.currentCond.weatherLocs[0].icon, weatherInfo.currentCond.weatherLocs[0].windspeed) + '")'); //$('.info-slide-content.airport .frost-pane.right .icon').css('background-image', 'url("' + getCCicon(+obsData(0).iconCode, obsData(0).current.wind_speed) + '")'); $('.severe-city-info .conditions').text(weatherInfo.currentCond.weatherLocs[0].cond); $('.severe-city-info .temp').text(weatherInfo.currentCond.weatherLocs[0].temp); weatherAudio.playCurrentConditions(); //fadein $('.severe-city-info-slide').fadeIn(0); $('.severe-city-info').fadeIn(500); //fadeout and switch setTimeout(function() { $('.severe-city-info').fadeOut(500, function(){ wait(0); }); }, slideDelay); } } ,city8slides(pidx){ var pages = Math.ceil(citySlideList.length/4); if (weatherInfo.currentCond.city8slides == true) { $('.severe-city-info-slide #subhead-city').fadeOut(500); $('.severe-city-info-slide .subhead-title').text('Currently'); $('.severe-city-info-slide .tempunavailable').fadeIn(500) setTimeout(function() { $('.info-slide-content.severe-aroundcityinfo').fadeOut(500); $('.severe-city-info-slide .tempunavailable').fadeOut(500, function(){ $('.severe-city-info-slide').fadeOut(0) $('.severe-city-info-slide #subhead-city').fadeIn(0); wait(0); }); }, slideDelay); } else { $('.severe-city-info-slide #subhead-city').fadeOut(0); function fillinfo() { pidx = (pidx===undefined ? 1 : pidx); //replace tomorrow var di = 0; for (var i = (pidx == 1) ? 0 : 4; i < 4*pidx || i < citySlideList.length; i++) { if (weatherInfo.currentCond.city8slides.cities[i]) { var divnumbers = ['i','ii','iii','iv'] $('.info-slide-content.severe-aroundcityinfo .city.' + divnumbers[di] + ' .cityname').text(weatherInfo.currentCond.city8slides.cities[i].displayname); $('.info-slide-content.severe-aroundcityinfo .city.' + divnumbers[di] + ' .temp').text(weatherInfo.currentCond.city8slides.cities[i].temp); $('.info-slide-content.severe-aroundcityinfo .city.' + divnumbers[di] + ' .icon').css('background-image', 'url("' + getCCicon(+weatherInfo.currentCond.city8slides.cities[i].icon, weatherInfo.currentCond.city8slides.cities[i].windspeed) + '")'); $('.info-slide-content.severe-aroundcityinfo .city.' + divnumbers[di] + ' .wind').text(weatherInfo.currentCond.city8slides.cities[i].wind); } else { $('.info-slide-content.severe-aroundcityinfo .city.' + divnumbers[di] + ' .cityname').text(""); $('.info-slide-content.severe-aroundcityinfo .city.' + divnumbers[di] + ' .temp').text(""); $('.info-slide-content.severe-aroundcityinfo .city.' + divnumbers[di] + ' .icon').css('background-image', 'url("' + "" + '")'); $('.info-slide-content.severe-aroundcityinfo .city.' + divnumbers[di] + ' .wind').text("") } di = di + 1 } } fillinfo(); $('.info-slide-content.severe-aroundcityinfo').fadeIn(500); setTimeout( function() { if (pidx') .appendTo($container) .css('font-size', s + 'px') .css('line-height', '125%') .html(text); // have to display parent so we can get measurements $container.closest('.info-slide-content').show(); $test.width($container.width() ); while ($test.outerHeight(true) >= (400) ) { s -= 1; $test.css('font-size', s + 'px'); } $container.closest('.info-slide-content').hide(); $container .text(text) .css('font-size', s + 'px'); $test.remove(); }; } else { var currentDisplay, displays = { bulletin() { if (weatherInfo.bulletin.weatherLocs[0]) { $('.bulletin .frost-pane .cityname').text(weatherInfo.bulletin.weatherLocs[0].displayname + " Area"); //fade in $('.bulletin').fadeIn(0); $('.bulletin .frost-pane').fadeIn(500); $('#subhead-noaa').fadeIn(500); pages = weatherInfo.bulletin.weatherLocs[0].pages makewarningPage(0) function makewarningPage(warningpagenum) { if (warningpagenum > 0) { $('.bulletin .frost-pane').fadeOut(500, function() { $('.bulletin .frost-pane .warnings').html(pages[warningpagenum]) $('.bulletin .frost-pane').fadeIn(500); }); } else { $('.bulletin .frost-pane .warnings').html(pages[warningpagenum]) $('.bulletin .frost-pane').fadeIn(500); } setTimeout(function() { if (warningpagenum < (pages.length - 1)) { makewarningPage(warningpagenum + 1) } else { $('.bulletin').fadeIn(0); $('.bulletin .frost-pane').fadeOut(500); $('#subhead-noaa').fadeOut(500, function() { $('.bulletin').fadeOut(0); wait(0) }); } }, slideDelay); } } else {wait(0)} } ,radar() { weatherAudio.playLocalRadar(); $('.radar-slide').fadeIn(0); if (weatherInfo.radarTempUnavialable == true) { $('.radar-slide .tempunavailable').fadeIn(500); } $('.radar-content').fadeIn(500); mainMap = new Radar("radar-1", 3, 8, maincitycoords.lat, maincitycoords.lon, false); if (weatherInfo.radarWinterLegend == true) {$('.radar-color-legend-winter').fadeIn(500)} else {$('.radar-color-legend').fadeIn(500)} wait(60500) } } }; keys = Object.keys(displays); if (weatherInfo.reboot == true) { $('#info-slide-container').hide() return; } if (idx { if (warningline != "") { if (warninglineidx == 0) { pages[warningpageidx] = "" } console.log(warningline) pages[warningpageidx] += (warningline + '
') warninglineidx += 1; if (warninglineidx == 7) { warningpageidx += 1 warninglineidx = 0 } } }); //$('.bulletin .frost-pane .warnings').text($('.bulletin .frost-pane .warnings').text().replace(/(?![^\n]{1,40}$)([^\n]{1,40})\s/g, '$1\n')) //console.log($('.bulletin .frost-pane .warnings').html()) makewarningPage(0) } splitLines() $('.bulletin').fadeIn(0); $('.bulletin .frost-pane').fadeIn(500); $('#subhead-noaa').fadeIn(500); function makeMarinePage(marinepagenum) { if (warningpagenum > 0) { $('.bulletin .frost-pane').fadeOut(500, function() { $('.bulletin .frost-pane .warnings').html(pages[warningpagenum]) $('.bulletin .frost-pane').fadeIn(500); }); } else { $('.bulletin .frost-pane .warnings').html(pages[warningpagenum]) $('.bulletin .frost-pane').fadeIn(500); } setTimeout(function() { if (warningpagenum < (pages.length - 1)) { makewarningPage(warningpagenum + 1) } else { $('.bulletin').fadeIn(0); $('.bulletin .frost-pane').fadeOut(500); $('#subhead-noaa').fadeOut(500, function() { $('.bulletin').fadeOut(0); if (severemode == true) { showRadarS(dataMan.locations[0].lat, dataMan.locations[0].long, 8, 60000) } else { $('#minimap-cover').fadeOut(0) $('#info-slides-header .hscroller').empty(); $('#marqueeSevere').fadeOut(0) $('.marqueeheadersevere').fadeOut(0) $('#arrow-img').fadeIn(0) $('.radar-slide .infosubheader').css('background','linear-gradient(to top, #fffe21 0, #db5a14 100%);') buildHeader(); nextCity(); } }); }*/ //https://tgftp.nws.noaa.gov/data/forecasts/marine/coastal/am/amz450.txt $('.coastalwaters.forecasts').fadeIn(500); setTimeout(function() { $('.coastalwaters.forecasts').fadeOut(500, function(){ $('.beach-slide').fadeOut(0); wait(0); }); }, slideDelay); } }, keys = Object.keys(displays); if (weatherInfo.reboot == true) { $('#info-slide-container').hide() return; } var daypart; if (idx= 4) { $('.info-slide-content.health-forecast .mainforecast .hightext').css("right","85px"); $('.info-slide-content.health-forecast .mainforecast .hightext').css("top","226.5"); $('.info-slide-content.health-forecast .mainforecast .high').css("left","95px"); $('.info-slide-content.health-forecast .mainforecast .high').css("top","239px"); $('.info-slide-content.health-forecast .mainforecast .lowtext').fadeOut(0) $('.info-slide-content.health-forecast .mainforecast .low').fadeOut(0) } $('.info-slide-content.health-forecast .thing').text("Forecast for " + weatherInfo.healthforecast.day) $('.info-slide-content.health-forecast .mainforecast .hightext').text(weatherInfo.healthforecast.high) $('.info-slide-content.health-forecast .mainforecast .lowtext').text(weatherInfo.healthforecast.low) $('.info-slide-content.health-forecast .forecastdetails .chancepreciptext').text(weatherInfo.healthforecast.precipChance) $('.info-slide-content.health-forecast .forecastdetails .humidtext').text(weatherInfo.healthforecast.humid) $('.info-slide-content.health-forecast .forecastdetails .windtext').text(weatherInfo.healthforecast.wind) $('.info-slide-content.health-forecast .mainforecast .icon').css('background-image', 'url("' + getCCicon(weatherInfo.healthforecast.icon, weatherInfo.healthforecast.windspeed) + '")'); $('.info-slide.health').fadeIn(0); $('.info-slide-content.health-forecast').fadeIn(500); setTimeout(function() { $('.info-slide-content.health-forecast').fadeOut(500, function(){ wait(0); }); }, slideDelay); } } ,pollen() { if (weatherInfo.healthPollen.totalcat && weatherInfo.healthforecast.noReport == false) { $('.info-slide-content.allergy .totalpollen .desc').text(weatherInfo.healthPollen.totalcat) $('.info-slide-content.allergy .pollen .pollenbar.tree .type').html(weatherInfo.healthPollen.types[0].treetype) $('.info-slide-content.allergy .pollen .thing').text("As of " + weatherInfo.healthPollen.date) $('.info-slide-content.allergy .totalpollen .cat').text(weatherInfo.healthPollen.total) $('.info-slide.health .subhead-title').text('Allergy Report'); $('.info-slide-content.allergy').fadeIn(500); setTimeout(function () { i = 0 var pollentypes = ['tree', 'grass', 'weed', 'mold']; pollentypes.forEach(pollentype => { var plength = {"0":"-10", "1":"55", "2":"115", "3":"175", "4":"235", "5":"295", "9":"-10"}[weatherInfo.healthPollen.types[i].pollenidx] var ptime = {"0":0, "1":500, "2":1000, "3":1500, "4":2000, "5":2500, "9":0}[weatherInfo.healthPollen.types[i].pollenidx] $('.info-slide-content.allergy .pollen .pollenbar.' + pollentype + ' .bar .bararrow').animate({left: plength + "px"}, ptime) }); }, 500) setTimeout(function() { $('.info-slide-content.allergy').fadeOut(500, function(){ wait(0); }); }, slideDelay); } else {wait(0)} } ,achesbreath() { $('.info-slide.health .subhead-title').text('Health Forecast'); if (weatherInfo.healthAcheBreath.noReport == true) { $('.info-slide.health .tempunavailable').fadeIn(500); setTimeout(function() { $('.info-slide.health .tempunavailable').fadeOut(500, function(){ wait(0); }); }, slideDelay); } else { var alength = {"0":"-10", "1":"22", "2":"55", "3":"88", "4":"121", "5":"154", "6":"187", "7":"220", "8":"253", "9":"286", "10":"300"}[weatherInfo.healthAcheBreath.achesindex] var atime = {"0":0, "1":250, "2":500, "3":750, "4":1000, "5":1250, "6":1500, "7":1750, "8":2000, "9":2250, "10":2500}[weatherInfo.healthAcheBreath.achesindex] var blength = {"10":"-10", "9":"22", "8":"55", "7":"88", "6":"121", "5":"154", "5":"187", "4":"220", "3":"253", "2":"286", "1":"300"}[weatherInfo.healthAcheBreath.breathindex] var btime = {"10":0, "9":250, "8":500, "7":750, "6":1000, "5":1250, "4":1500, "3":1750, "2":2000, "1":2250, "0":2500}[weatherInfo.healthAcheBreath.breathindex] $('.info-slide-content.Aches-Breath .thing').text(weatherInfo.healthAcheBreath.breathindex.date) $('.info-slide-content.Aches-Breath .aches .bar .bararrow').css('left','-10px') $('.info-slide-content.Aches-Breath .breath .bar .bararrow').css('left','-10px') $('.info-slide-content.Aches-Breath .aches .bar .bararrow .bararrowtext').fadeOut(0); $('.info-slide-content.Aches-Breath .breath .bar .bararrow .bararrowtext').fadeOut(0); $('.info-slide-content.Aches-Breath').fadeIn(500); setTimeout(function () { $('.info-slide-content.Aches-Breath .aches .bar .bararrow').animate({left: alength + "px"}, atime, 'linear', function() { $('.info-slide-content.Aches-Breath .aches .bar .bararrow .bararrowtext').text(weatherInfo.healthAcheBreath.achescat); $('.info-slide-content.Aches-Breath .aches .bar .bararrow .bararrowtext').fadeIn(500); }) $('.info-slide-content.Aches-Breath .breath .bar .bararrow').animate({left: blength + "px"}, btime, 'linear' ,function() { $('.info-slide-content.Aches-Breath .breath .bar .bararrow .bararrowtext').text(weatherInfo.healthAcheBreath.breathcat); $('.info-slide-content.Aches-Breath .breath .bar .bararrow .bararrowtext').fadeIn(500); }) }, 500); setTimeout(function() { $('.info-slide-content.Aches-Breath').fadeOut(500, function(){ wait(0); }); }, slideDelay); } } ,airquality() { $('.info-slide.health .subhead-title').text('Air Quality Forecast'); if (weatherInfo.airquality.noReport == true) { $('.info-slide.health .tempunavailable').fadeIn(500); setTimeout(function() { $('.info-slide.health .tempunavailable').fadeOut(500, function(){ wait(0); }); }, slideDelay); } else { var ozone = false; /*if (foreDataAlert !== undefined){ for (var i=0; i 0) { $('.bulletin .frost-pane').fadeOut(500, function() { $('.bulletin .frost-pane .warnings').html(pages[warningpagenum]) $('.bulletin .frost-pane').fadeIn(500); }); } else { $('.bulletin .frost-pane .warnings').html(pages[warningpagenum]) $('.bulletin .frost-pane').fadeIn(500); } setTimeout(function() { if (warningpagenum < (pages.length - 1)) { makewarningPage(warningpagenum + 1) } else { $('.bulletin').fadeIn(0); $('.bulletin .frost-pane').fadeOut(500); $('#subhead-noaa').fadeOut(500, function() { $('.bulletin').fadeOut(0); wait(0) }); } }, slideDelay); } } else {wait(0)}; } // Currently (10 sec) ,currentConditions() { $('.city-info-slide .subhead-title').text('Currently'); $('.city-info-slide #subhead-city').text(weatherInfo.currentCond.weatherLocs[location].displayname); if (weatherInfo.currentCond.weatherLocs[location].noReport == true) { $('.city-info-slide .noreport').fadeIn(500) $('.city-info-slide').fadeIn(0); setTimeout(function() { $('.city-info-slide .noreport').fadeOut(500, function(){ $('.city-info-slide').fadeOut(0); wait(0); }); }, slideDelay); } else { var strLabels = 'Humidity
Dew Point
Pressure
Wind
', strData = weatherInfo.currentCond.weatherLocs[location].humid + '%
' + weatherInfo.currentCond.weatherLocs[location].dewpt + '
' + weatherInfo.currentCond.weatherLocs[location].pressure + " " + weatherInfo.currentCond.weatherLocs[location].pressureTrend + '
' + weatherInfo.currentCond.weatherLocs[location].wind + '
'; strLabels+='Gusts
'; strData+=weatherInfo.currentCond.weatherLocs[location].gust + '
'; if (weatherInfo.currentCond.weatherLocs[location].feelslike.type != "dontdisplay") { strLabels+=weatherInfo.currentCond.weatherLocs[location].feelslike.type strData+=weatherInfo.currentCond.weatherLocs[location].feelslike.val } $('.city-info .frost-pane .labels').html(strLabels); $('.city-info .frost-pane .data').html(strData); // right pane $('.city-info .icon').css('background-image', 'url("' + getCCicon(+weatherInfo.currentCond.weatherLocs[location].icon, weatherInfo.currentCond.weatherLocs[location].windspeed) + '")'); //$('.info-slide-content.airport .frost-pane.right .icon').css('background-image', 'url("' + getCCicon(+obsData(0).iconCode, obsData(0).current.wind_speed) + '")'); $('.city-info .conditions').text(weatherInfo.currentCond.weatherLocs[location].cond); $('.city-info .temp').text(weatherInfo.currentCond.weatherLocs[location].temp); weatherAudio.playCurrentConditions(); //fadein $('.city-info-slide').fadeIn(0); $('.city-info').fadeIn(500); //fadeout and switch setTimeout(function() { $('.city-info').fadeOut(500, function(){ wait(0); }); }, slideDelay); } } ,city8Slides(pidx){ if (location == 0) { var pages = Math.ceil(citySlideList.length/4); if (weatherInfo.currentCond.city8slides.noReport == true) { $('.city-info-slide #subhead-city').fadeOut(0); $('.city-info-slide .subhead-title').text('Currently'); $('.city-info-slide .tempunavailable').fadeIn(500) setTimeout(function() { $('.info-slide-content.aroundcityinfo').fadeOut(500); $('.city-info-slide .tempunavailable').fadeOut(500, function(){ $('.city-info-slide').fadeOut(0) $('.city-info-slide #subhead-city').fadeIn(0); wait(0); }); }, slideDelay); } else { $('.city-info-slide #subhead-city').fadeOut(0); function fillinfo() { pidx = (pidx===undefined ? 1 : pidx); //replace tomorrow var di = 0; for (var i = (pidx == 1) ? 0 : 4; i < 4*pidx || i < citySlideList.length; i++) { if (weatherInfo.currentCond.city8slides.cities[i]) { var divnumbers = ['i','ii','iii','iv'] $('.info-slide-content.aroundcityinfo .city.' + divnumbers[di] + ' .cityname').text(weatherInfo.currentCond.city8slides.cities[i].displayname); $('.info-slide-content.aroundcityinfo .city.' + divnumbers[di] + ' .temp').text(weatherInfo.currentCond.city8slides.cities[i].temp); $('.info-slide-content.aroundcityinfo .city.' + divnumbers[di] + ' .icon').css('background-image', 'url("' + getCCicon(+weatherInfo.currentCond.city8slides.cities[i].icon, weatherInfo.currentCond.city8slides.cities[i].windspeed) + '")'); $('.info-slide-content.aroundcityinfo .city.' + divnumbers[di] + ' .wind').text(weatherInfo.currentCond.city8slides.cities[i].wind); } else { $('.info-slide-content.aroundcityinfo .city.' + divnumbers[di] + ' .cityname').text(""); $('.info-slide-content.aroundcityinfo .city.' + divnumbers[di] + ' .temp').text(""); $('.info-slide-content.aroundcityinfo .city.' + divnumbers[di] + ' .icon').css('background-image', 'url("' + "" + '")'); $('.info-slide-content.aroundcityinfo .city.' + divnumbers[di] + ' .wind').text("") } di = di + 1 } } fillinfo(); $('.info-slide-content.aroundcityinfo').fadeIn(500); setTimeout( function() { if (pidx') .appendTo($container) .css('font-size', s + 'px') .css('line-height', '125%') .html(text); // have to display parent so we can get measurements $container.closest('.info-slide-content').show(); $test.width($container.width() ); while ($test.outerHeight(true) >= (400) ) { s -= 1; $test.css('font-size', s + 'px'); } $container.closest('.info-slide-content').hide(); $container .text(text) .css('font-size', s + 'px'); $test.remove(); } //doDisplay = displays[ keys[idx] ](); // increment the pointer //idx = (++idx===keys.length ? 0 : idx); //if (text) { // $('#current-info').html(text); // setTimeout(function(){ displayAtmospheric(idx) }, 6000); // 6 second increment loop //} else { // nothing to display - skip to the next one // setTimeout(function(){ displayAtmospheric(idx) }, 0); //} /* (Main City) Currently (10 sec) Local Doppler Radar or Radar/Satellite (15 sec, zoomed out with cloud cover) Local Forecast -Today (10 sec) -Tonight (10 sec) -Tomorrow (name day) (10 sec) -Tomorrow (name day) Night (10 sec) or Daypart Extended Forecast(5 day columns) Almanac (to be made) (Per City) Local Doppler Radar (center on city) Currently Local Doppler Radar Today's Forecast Extended Forecast(5 day columns) */ //idx++; //if (idx<=0){ setTimeout(cityLoop, 3000); // change to 60000 for production //} else { //} } function advanceHeader() { // swap current var $cities = $('#info-slides-header .city'), $scroller = $('#info-slides-header .hscroller'), left; //reload cityslide data from newweathermanager on loop complete if ($cities[1].classList.contains('loopcomplete')) { grabCitySlidesData() grabHealthData() grabCity8SlidesData() grabAlamanacSlidesData() } $($cities[0]).removeClass('current'); $($cities[1]).addClass('current'); // animate move left left = $scroller.position().left - $($cities[1]).position().left; $scroller.animate({ 'left': left+'px' }, 700, function(){ // on completion, move the old one to the end $scroller.css('left',''); $($cities[0]).appendTo($scroller); $('#info-slides-header span').first().appendTo($scroller); }) } function buildHeader(){ $('#info-slides-header .hscroller').empty(); var city, first, dname, cities='', arrow='<', radar='LOCAL RADAR', firstradar='LOCAL RADAR', golf='GOLF', beach='BOAT & BEACH', health='HEALTH', airport='AIRPORTS'; cities += arrow + '' + maincitycoords.displayname + ''; var li = 1 for (var location of locList) { if (location.displayname !== undefined) { city = location.displayname; cities += arrow+'' + city + ''; } li = li + 1 } $('#info-slides-header .hscroller').append(firstradar + arrow + airport + cities + arrow + (radar + arrow + airport + arrow + health + cities + arrow).repeat(4)); } buildHeaderGlobal = buildHeader } // end function