Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
Added extra values for weather-dashboard
Browse files Browse the repository at this point in the history
V1.2.4 (1-22-2024):
Added Snow Depth
Added Solar Radiation
Added Rain Rate
  • Loading branch information
JesseWx2011 authored Jan 22, 2024
1 parent 1586f9e commit 7ee3af4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scriptcc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const api_url = `https://api.aerisapi.com/conditions/${city}?format=json&plimit=
const {response} = data;
console.log(response);


document.getElementById('cityname').innerHTML = `Weather for <div class="cityn" style="display: flex;"> ${response[0].place.name}</div>, <div class="state" style="flex;">${response[0].place.state}</div>, <div class="country" style="display: flex;">${response[0].place.country}</div>`;
document.getElementById('temp').innerHTML = `${response[0].periods[0].tempF}°F (${response[0].periods[0].tempC}°C)`;
document.getElementById('title').innerHTML = `Weather for ${response[0].place.name}, ${response[0].place.state}`
Expand All @@ -22,6 +21,9 @@ const api_url = `https://api.aerisapi.com/conditions/${city}?format=json&plimit=
document.getElementById('pressurevalue').innerHTML = `${response[0].periods[0].pressureIN} inHg`;
document.getElementById('dewvalue').innerHTML = `${response[0].periods[0].dewpointF}°F`;
document.getElementById('visibilityvalue').innerHTML = `${response[0].periods[0].visibilityMI} mi`;
document.getElementById('snowdepthvalue').innerHTML = `${response[0].periods[0].snowDepthIN} in.`;
document.getElementById('rainrvalue').innerHTML = `${response[0].periods[0].precipRateIN} in./hr`;
document.getElementById('solarvalue').innerHTML = `${response[0].periods[0].solradWM2} watts/m²`;

// Function to get the UV Value
if (response[0].periods[0].uvi <=1) {
Expand Down

0 comments on commit 7ee3af4

Please sign in to comment.