GithubHelp home page GithubHelp logo

corvus-cyber / weather_dashboard_assign6 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 361 KB

The purpose of this assignment was to create a weather forecast scheduler that would show the humidity, temperature, wind speed, and uv index of the location the user searches. It will also show a five day forecast of searched location, and save the location in a row with other searched cities.

Home Page: https://corvus-cyber.github.io/Weather_Dashboard_Assign6/

HTML 1.86% JavaScript 97.67% CSS 0.48%
forecast weather-app weather-api weather-forecast

weather_dashboard_assign6's Introduction

Weather_Dashboard_Assign6

Purpose:

The purpose of this assignment was to create a weather forecast scheduler that would show the humidity, temperature, wind speed, and uv index of the location the user searches. It will also show a five day forecast of searched location, and save the location in a row with other searched cities. Upon re-entering the site the user would be presented with a display of their last searched location. I built this project to apply my newfound knowledge in Javascript, Jquery, and server-side API's.

Process:

  • First I developed the html and css, trying to build a display similar to the example provided.
  • I then copied the code for the moment.js and pasted it into its own javascript file so that I could display the current day, as well as the dates for the next five days in the forecast.
  • I then used the ready function to make sure that the website would not display any part of thhe forecast until everything was ready.
  • I then built two click functions that will search from the user's typed answer in the form, or search from a previously searched location.
  • I then used localStorage with JSON stringify and parse to save the written location and display it in the favorite cities display.
  • Then I used two ajax pulls to take the api of openweathermap and manipulate it within the javascript (I needed to use a second pull in order to search by longitude and latitude because it is required to find the uv index)
  • I then used javascipt to display the temp, humidity, wind speed, weather icon, and uv index. With the uv index I did if, else if, and else commands to color-code the index.

Problems I Encountered:

  • A major issue I encountered was that if the user chose a location from their favorite list, it would replicate the box again, creating a series of clone boxes. In order to resolve this, with the help of an instructional assistant I created an event within the developWeather function that only responds when the user enters info in the search form.
  • Another issue was that in the forecast, the icons were just copies of the original icon. In order to fix this I needed to use response.daily[i].weather[0].icon.
  • When publishing the website, the functionality no longer worked because there was no location information saved within the localStorage. In order to fix this, I set up a default item in localStorage so that there always be something to display.

What I Learned:

  • How to use a server-side api
  • How to use events within a function in order to dictate when to run other functions
  • How to set up clauses so that localstorage will have a default

Link:

https://corvus-cyber.github.io/Weather_Dashboard_Assign6/

Screenshot:

screenshot of the application

weather_dashboard_assign6's People

Contributors

corvus-cyber avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.