Skip to content

Panthers Nicole Mejia#84

Open
n1colemejia wants to merge 16 commits intoAda-C18:mainfrom
n1colemejia:main
Open

Panthers Nicole Mejia#84
n1colemejia wants to merge 16 commits intoAda-C18:mainfrom
n1colemejia:main

Conversation

@n1colemejia
Copy link
Copy Markdown

enhancements:

  • display 5 day forecast for default city on load and for searched cities
  • update weather icons for each day according to forecast

i added another endpoint to the proxy server to request the five day forecast data. to refactor, instead of calling '/weather' for the default city's current weather, then calling '/forecast' for the five day forecast, i would only call '/forecast' and use the first date's data to update the default city's current weather. i kept it for the project requirement's sake.

Comment thread index.html
Comment on lines +74 to +103
<div id="temp-increase-button" class="increase-button buttons"></div>
<div id="temp-decrease-button"class="decrease-button buttons"></div>
</div>
</div>
</div>
<div id="dream-sky" class="dream-panels">
<h3>Dream Sky</h3>
<div class="dream-panel-content">
<select name="skies" id="sky-select">
<option value="">
Pick One
</option>
<option id="sunshine-sky" value="sunshine">
Sunshine
</option>
<option id="cloudy-sky" value="clouds">
Cloudy
</option>
<option id="rain-sky" value="rain">
Rain
</option>
<option id="snow-sky" value="snow">
Snow
</option>
</select>
</div>
</div>
<div id="dream-humidity" class="dream-panels">
<h3>Dream Humidity</h3>
<div class="dream-panel-content">
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Markup looks awesome! Great work 🏁

Comment thread src/index.js
Comment on lines +3 to +8
const state = {
temp: 0, // starting temp
humidity: 0, // starting humidity
city: "Chattanooga", // default city
clicked: false, // whether the temp increase button is in clicked state
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work with this initial set up!

Comment thread src/index.js
Comment on lines +82 to +84
if (document.getElementById("search-bar").value) {
cityInput = document.getElementById("search-bar").value;
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice approach using this guard clause 👍🏾

Comment thread src/index.js
Comment on lines +119 to +132
const getFiveDayForecast = () => {
let cityInput = state.city;

if (document.getElementById("search-bar").value) {
cityInput = document.getElementById("search-bar").value;
};

return axios.get('http://127.0.0.1:5000/location', {params: {q: cityInput}
})
.then(location => {
return {
lat: location.data[0].lat,
lon: location.data[0].lon
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Nice work getting this second call to work and extending your project 🥳

Comment thread src/index.js
Comment on lines +250 to +253
// RESET CITY TO DEFAULT
const resetToDefault = () => {
window.location.reload();
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart approach!

Copy link
Copy Markdown

@ameerrah9 ameerrah9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, Nicole! 🎉

Thank you for your patience as we catch up on grading. Your JavaScript looks really clean, your commit message are excellent, and your closing semi-colons are consistent! This project is a Green. 🟢

Keep it up! 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants