Giter Club home page Giter Club logo

weather-app's Introduction

weather-app

Weather App project from TOP

This project was intended to be a lesson that solidifies the concepts of asynchronous Javascript. I used Weather API (https://www.weatherapi.com/) to retrieve the necessary weather data and GeoDB Cities Find places API (http://geodb-cities-api.wirefreethought.com/docs/api/find-places) to retrieve a list of cities for the search bar.

Some extra features:

  • Bookmark city: Bookmarked cities can be accessed from the bookmark manu in the header, data is saved in localstorage

  • Searchbar autocomplete: I tried to make one of those search bars that will display a list of cities matching what the user is typing. It sort of worked but it has some issues, for instance, since the GeoDB API has different, much larger database of cities that the weather API, some of these cities do not have weather data and therefore it will not find it or go to a different city. This can be fixed by adding another async function that checks if the weather api has that info or not before displaying it in the search bar suggestions.. This will make the suggestions slower though, the ideal solution is to find a weather api that returns a list of cities to ensure it has weather info in that specific database. Also, since an async function is triggered on user input, if a user types fast the suggestions will lag. I guess this can be solved by adding a setTimeout that will only trigger the async function if the user stops typing for a few ms, if the user is a keyboard 1337 wizard, the function doesn't run on every input but rather waits for him/her to stop typing.

  • background theme changes depending on chosen city time: I had this idea early on the project but left it until the end which explains why it's a sloppy. Essentially I wanted the background of the page to change based on the current displayed city. Basically darker theme later on the day and lighter on the early hours. Some guy made 24 CSS gradients that represent the colors of the sky during different times of the day (https://gist.github.com/mikedugan/7355415) so I used that to dynamically find out which gradient to use. User can also manually change the theme and keep it that way

  • local storage is used to save all user actions The page stays as the user left it. If user chooses fahrenheit as the weather unit, hides the hourly weather tab and changes the theme, all those things will be stored to localstorage so when user opens the web app again it will be exactly as it was left.

Thank you.

weather-app's People

Contributors

frqd92 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.