AlmanacMoonphasesandmoreweathersafetytips

This commit is contained in:
BuildTools 2022-08-08 09:20:08 -04:00
parent 8c81ee11c4
commit 6943214927
6 changed files with 301 additions and 14 deletions

View File

@ -1727,19 +1727,19 @@ background-image: url(/images/moonphases/new.png);
}
.info-slide-content.almanac .frost-pane.purple .phase.i .icon{
background-image: url(/images/moonphases/new.png);
background-image: url(/images/moonphases/NEW.png);
}
.info-slide-content.almanac .frost-pane.purple .phase.ii .icon{
background-repeat: no-repeat;
background-size: contain;
background-position: center center;
background-image: url(/images/moonphases/half1.png);
background-image: url(/images/moonphases/FIRST.png);
}
.info-slide-content.almanac .frost-pane.purple .phase.iii .icon{
background-image: url(/images/moonphases/full.png);
background-image: url(/images/moonphases/FULL.png);
}
.info-slide-content.almanac .frost-pane.purple .phase.iv .icon{
background-image: url(/images/moonphases/half2.png);
background-image: url(/images/moonphases/LAST.png);
}
.info-slide-content.almanac .frost-pane.purple .phase .date {

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1464,15 +1464,237 @@
<div class='weathertext2'>eather</div>
<div class='readytext'>READY</div>
</div>
<div class='frost-pane tipcontent'><span>
Incase of Lightning -
<br>
An automobile provides better insulation against<br>
lightning than being in the open. <br>
<br>
Avoid contact with any metal conducting surfaces<br>
either inside your car or outside.
</span></div>
<div class='frost-pane tipcontent'>
<div class='wintertip3' style="display: none"><!--originally shown in November 2016--->
Know the difference in Winter Weather Warnings:
<br>
<br>
- Winter Weather Advisory - hazardous winter weather<br>is occuring, imminent, and is an inconvenience.
<br>
<br>
- Winter Weather Warning - hazardous winter weather is<br>occuring, imminent, and is a threat to life<br>and property.
</div>
<div class='pipetip' style="display: none">
To prevent Frozen Water Pipes insulate with:
<br>
<br>
- A "pipe sleeve", UL-Listed "heat tape", or<br>similar materials.
<br>
<br>
- Newspaper can provide some degree of<br>insulation and protection to exposed pipes -<br>even 1/4" of newspaper can help.
</div>
<div class='pipetip2' style="display: none">
To prevent Frozen Water Pipes insulate with:
<br>
<br>
- Let cold water frip from ffaucets served by<br>exposed pipes.
<br>
<br>
- While away during cold weather, leave the heat on,<br>set no lower than 55°F.
</div>
<div class='pipetip3' style="display: none"><!--originally shown in December 2008--->
To prevent Frozen Water Pipes:
<br>
<br>
- Open outside hose bibs to drain water and<br>
keep them open so remaining water can expand<br>
without breaking the pipe.
</div>
<div class='wintertip' style="display: none"><!--originally shown in December/January 2012--->
Be prepared if you get stranded, with:
<br>
<br>
- Compass and First Aid Kit
<br>
- Ice scraper and snow brush
<br>
- Wooden matches in a waterproof container
<br>
- Non-perishable high-energy foods
<br>
- Woolen mittens, socks, a cap and blankets
</div>
<div class='summertip2' style="display: none"><!--originally shown in June--->
Never leave infants, children, or pets in a parked car.
</div>
<div class='severeweathertip' style="display: none"><!--originally shown in June--->
In case of a severe thunderstorm:
<br><br>
Pull safely onto the shoulder of the road away<br>
from any trees that could fall on the vehicle.
<br><br>
Stay in the car and turn on the emergency<br>
flashers until the heavy rains subside.
</div>
<div class='severeweathertip2' style="display: none"><!--originally shown in July/August--->
In case of Lightning -
<br>
An automobile provides better insulation against
<br>
lightning than being in the open.
<br>
<br>
Avoid contact with any metal conducting surfaces
<br>
either inside your car or outside.
</div>
<div class='severeweathertip3' style="display: none"><!--originally shown in June--->
Tornado Safety -
<br><br>
Never try to out-drive a tornado
<br><br>
Tornadoes can change direction quickly and<br>
can lift a car ot truck and toss it through<br>
the air.
</div>
<div class='drivingtip' style="display: none"><!--originally shown in September 2010, October 2017--->
Driving Tips:
<br>
<br>
Do not pump anti-lock brakes.<br><br>
The right way is to "stomp and steer!"
</div>
<div class='drivingtip2' style="display: none"><!--originally shown in May 2012, November 2016--->
Driving Tips-
<br>
<br>
Change windshield wiper blades at least twice<br>
a year or every 6,000 miles.
<br>
<br>
Make sure your cruise control is turned off<br>
during wet weather driving.
</div>
<div class='winterdrivingtip' style="display: none"><!--originally shown in November 2016--->
Be prepared for winter driving emergencies with the following in your truck:<br>
- Spare tire, wheel wrench and tripod-type jack<br>
- Shovel<br>
- Jumper cables<br>
- Tow and tire chains<br>
- Bag of salt or cat litter<br>
- Tool kit<br>
</div>
<div class='winterdrivingtip2' style="display: none"><!--originally shown in November 2016--->
Don't use your cruise control in wintry conditions.
<br>
<br>
Even roads that appear clear can have sudden<br>
slippery spots, and the short touch of your brakes<br>
to deactivate the cruise control feature can cause<br>
you to lose control of your vehicle.
</div>
<div class='pettip' style="display: none"><!--originally shown in November 2016--->
Pet Safety Tips:
<br>
<br>
- Antifreeze is deadly to pets.
<br>
<br>
- Use "safe" non toxic antifreeze and clean spills<br>
immediately - especially if pets are housed in the<br>
garage.
</div>
<div class='pettip2' style="display: none"><!--originally shown in November 2016--->
Pet Safety Tips:
<br>
<br>
- Shout, beep the horn, or pound on the hood before<br>
starting the engine of and outdoor vehicle.
<br>
<br>
- Cats and other small animals may seek warmth by<br>
crawling into car engines, which can be dangerous<br>
or fatal.
</div>
<div class='pettip3' style="display: none"><!--originally shown in November 2016--->
Pet Safety Tips:
<br>
<br>
- After letting your pet out, be sure to wipe their<br>
paws when they come back inside. Tender pads can be<br>
injured from salts and other ice melting chemicals.
</div>
<div class='preparednessplantip' style="display: none"><!--originally shown in November 2016--->
<br>
Complete your Family Preparedness Plan at<br>
weather.com/READY
</div>
<div class='sunscreenwintertip' style="display: none"><!--originally shown in March/April 2016--->
Use sunscreen during the winter.
<br><br>
- Skiers are at higher risk of UV damage to eyes<br>
and skin due to stronger UV rays at higher altitudes.
<br><br>
- Snow reflects the sun's rays and UV radiation.
</div>
<div class='sunscreenwintertip2' style="display: none"><!--originally shown in March/April 2016--->
Use sunscreen during the winter.
<br><br>
Cloudy skies may make the air temperature cooler,<br>
but UV rays are still coming through.
</div>
<div class='flutip' style="display: none"><!--originally shown in Feb 2008, November 2016--->
To minimize colds and flu:
<br>
<br>
- Wash your hands frequently to protect from<br>
germs.
<br>
- Avoid using public pens & pencils (use you own<br>
at doctor's offices, stores, banks, etc.)
</div>
<div class='flutip2' style="display: none"><!--originally shown in January 2007--->
To minimize colds and flu:
<br>
<br>
- Disinfect and sanitize home surfaces including<br>
doorknobs, telephones, even the TV remote control.
</div>
<div class='firetip' style="display: none"><!--originally shown in January 2007--->
To prevent accidental fires:
<br>
<br>
- Use flashlights, not candles - if you lose<br>
electrical power.
<br>
<br>
- Keep space heaters at least three feet away from<br>
furnishings, drapes, and all flammable objects.
</div>
<div class='firetip2' style="display: none"><!--originally shown in January 2007--->
To prevent accidental fires:
<br>
<br>
- Turn off space heaters when you leave the room.<br>
<br>
<br>
Complete your Family Preparedness Plan at<br>
weather.com/READY
</div>
<div class='shovelingtip' style="display: none"><!--originally shown in January 2007--->
Take frequent breaks when shoveling snow.
<br>
<br>
Heart attacks due to over exertion are a leading<br>
cause of death during winter storms.
</div>
<div class='allergytip' style="display: none"><!--originally shown in August 2007, June 2008, October 2015--->
Allergies-
<br>
<br>
To reduce the severity of many allergy attacks on<br>
airplane flights, use decongestant nose drops or<br>
inhalers before a flight.
</div>
<div class='allergytip2' style="display: none"><!--originally shown in April 2014--->
Allergies-
<br>
<br>
To reduce the number and severity of many allergy<br>
attacks, attach Electrostatic filters to heating<br>
and a/c equipment to remove allergens from the air.
</div>
</div>
</div>
<div class='info-slide-content moreinfoimage' style="display: none">
<div class='frost-pane image'>

View File

@ -973,6 +973,33 @@ function grabAlamanacSlidesData() {
weatherInfo.alamanac.displayname = maincitycoords.displayname
weatherInfo.alamanac.noReport = true
});
var phasesfound = 0;
$.getJSON(`https://www.icalendar37.net/lunar/api/?lang=en&month=${dateFns.format(new Date(),"M")}&year=${dateFns.format(new Date(),"YYYY")}`, function(data) {
console.log('test')
for (phase in data.phase) {
console.log(phasesfound)
if (data.phase[phase].isPhaseLimit && phasesfound < 4 && phase > parseInt(dateFns.format(new Date(),"D"))) {
weatherInfo.alamanac.moonphases[phasesfound].name = {"new moon": "NEW", "first quarter": "FIRST", "full moon": "FULL", "last quarter": "LAST"}[(data.phase[phase].phaseName).toLowerCase()]
weatherInfo.alamanac.moonphases[phasesfound].date = String(data.monthName).slice(0,3) + " " + phase
phasesfound += 1;
}
}
if (phasesfound < 4) {
nextMonth()
}
})
function nextMonth() {
$.getJSON(`https://www.icalendar37.net/lunar/api/?lang=en&month=${dateFns.format((dateFns.addMonths(new Date(),1)),"M")}&year=${dateFns.format(dateFns.addMonths(new Date(),1),"YYYY")}`, function(data) {
for (phase in data.phase) {
if (data.phase[phase].isPhaseLimit && phasesfound < 4) {
console.log(phasesfound)
weatherInfo.alamanac.moonphases[phasesfound].name = {"new moon": "NEW", "first quarter": "FIRST", "full moon": "FULL", "last quarter": "LAST"}[(data.phase[phase].phaseName).toLowerCase()]
weatherInfo.alamanac.moonphases[phasesfound].date = String(data.monthName).slice(0,3) + " " + phase
phasesfound += 1;
}
}
})
}
}
function grabHealthData() {
$.getJSON('https://api.weather.com/v3/wx/forecast/daily/5day?geocode='+ maincitycoords.lat + ',' + maincitycoords.lon +"&format=json&language=en-US&units=e&apiKey=" + api_key, function(data) {
@ -1115,7 +1142,7 @@ function grabAirportDelayData() {
airportdelay.iata = airportevent.airportId
airportdelay.type = 'Arrival'
airportdelay.amount = formatMinutes(airportevent.arrivalDelay.averageDelay)
airportdelay.amountmin = airportevent.departureDelay.averageDelay
airportdelay.amountmin = airportevent.arrivalDelay.averageDelay
airportdelay.reason = airportevent.arrivalDelay.reason
weatherInfo.airport.delays.push(airportdelay)
}

View File

@ -1438,6 +1438,31 @@ var mainMap
}
,healthtip() {
$('.info-slide.health .subhead-title').text('Weather Safety Tips');
const d = new Date();
let month = d.getMonth();
if (month > 4 && month < 8) {
$('.summertip').show();
} else if (month == 0) {
$('.flutip').show();
} else if (month == 1) {
$('.pipetip2').show();
} else if (month == 2) {
$('.wintertip2').show();
} else if (month == 3) {
$('.allergytip2').show();
} else if (month == 4) {
$('.drivingtip2').show();
} else if (month == 8) {
$('.drivingtip').show();
} else if (month == 9) {
$('.allergytip').show();
} else if (month == 10) {
$('.drivingtip').show();
} else if (month == 11) {
$('.flutip2').show();
} else {
$('.wintertip').show();
}
$('.info-slide-content.healthtip').fadeIn(500);
setTimeout(function() {
$('.info-slide-content.healthtip').fadeOut(500).promise().done(function(){
@ -1903,6 +1928,19 @@ var mainMap
$('.info-slide-content.almanac .frost-pane.half .rlowyear').text(weatherInfo.alamanac.reclowyear);
$('.info-slide-content.almanac .frost-pane.purple .sunrisetext').text(weatherInfo.alamanac.sunrise);
$('.info-slide-content.almanac .frost-pane.purple .sunsettext').text(weatherInfo.alamanac.sunset);
$('.info-slide-content.almanac .frost-pane.purple .phase.i .phasetext').text(weatherInfo.alamanac.moonphases[0].name);
$('.info-slide-content.almanac .frost-pane.purple .phase.ii .phasetext').text(weatherInfo.alamanac.moonphases[1].name);
$('.info-slide-content.almanac .frost-pane.purple .phase.iii .phasetext').text(weatherInfo.alamanac.moonphases[2].name);
$('.info-slide-content.almanac .frost-pane.purple .phase.iv .phasetext').text(weatherInfo.alamanac.moonphases[3].name);
$('.info-slide-content.almanac .frost-pane.purple .phase.i .date').text(weatherInfo.alamanac.moonphases[0].date);
$('.info-slide-content.almanac .frost-pane.purple .phase.ii .date').text(weatherInfo.alamanac.moonphases[1].date);
$('.info-slide-content.almanac .frost-pane.purple .phase.iii .date').text(weatherInfo.alamanac.moonphases[2].date);
$('.info-slide-content.almanac .frost-pane.purple .phase.iv .date').text(weatherInfo.alamanac.moonphases[3].date);
$('.info-slide-content.almanac .frost-pane.purple .phase.i .icon').css('background-image', 'url("images/moonphases/' + weatherInfo.alamanac.moonphases[0].name + '.png")');
$('.info-slide-content.almanac .frost-pane.purple .phase.ii .icon').css('background-image', 'url("images/moonphases/' + weatherInfo.alamanac.moonphases[1].name + '.png")');
$('.info-slide-content.almanac .frost-pane.purple .phase.iii .icon').css('background-image', 'url("images/moonphases/' + weatherInfo.alamanac.moonphases[2].name + '.png")');
$('.info-slide-content.almanac .frost-pane.purple .phase.iv .icon').css('background-image', 'url("images/moonphases/' + weatherInfo.alamanac.moonphases[3].name + '.png")');
$('.city-info-slide').fadeIn(0);
$('.city-info-slide .subhead-title').text('Almanac');
$('.city-info-slide #subhead-city').text(weatherInfo.alamanac.displayname);