This web-app provides the user with local weather conditions based on their browser’s geolocation data.
I designed and coded this app as part of freeCodeCamp’s Intermediate Front End Development Projects. All in all, it took me a bit less than 9 hours to design and code.
navigator.geolocation to find the device’s latitude and longitude and then uses these coordinates to
GET weather data from openweathermap.org’s API with jQuery.
Edit: Since completing this project, it has been moved to the Coding Interview Take Home Projects section of the freeCodeCamp curriculum.
The brief for the Show the Local Weather project was as follows:
- Objective: Build a CodePen.io app that is functionally similar to this: http://codepen.io/freeCodeCamp/full/bELRjV.
- Rule #1: Don’t look at the example project’s code. Figure it out for yourself.
- Rule #2: Fulfill the below user stories. Use whichever libraries or APIs you need. Give it your own personal style.
- User Story: I can see the weather in my current location.
- User Story: I can see a different icon or background image (e.g. snowy mountain, hot desert) depending on the weather.
- User Story: I can push a button to toggle between Fahrenheit and Celsius.
- Note: Many internet browsers now require an HTTP Secure (https://) connection to obtain a user’s locale via HTML5 Geolocation. For this reason, we recommend using HTML5 Geolocation to get user location and then use the freeCodeCamp Weather API https://fcc-weather-api.glitch.me which uses an HTTP Secure connection for the weather. Also, be sure to connect to CodePen.io via https://.
- Remember to use Read-Search-Ask if you get stuck.
- When you are finished, click the “I’ve completed this challenge” button and include a link to your CodePen.
- You can get feedback on your project by sharing it with your friends on Facebook.