Make sure your system meets the following requirements:
- node >= 8.9.3
- npm >= 5.5.1
Install required packages:
$ npm install
Use the following command to run the app:
$ npm run serve
To run the tests
$ npm run test:unit
The requirements of this widget are:
Spec
- It should display a button with the text "Get the Weather".
- When prompting for permission, hide the button and display the text "Locating..." instead.
- When permission is given, it should display the current weather.
- If something went wrong (i.e. permission is not given) then display the text "Unable to retrieve the information at this moment".
- Please notice the "C" and "F" buttons at the bottom right corner. 👀
Spec
- Get your current location using the geolocation API available in your browser.
- Please use https://openweathermap.org/api to get the current weather at your location.
- Do not forget to add the icon matching with the current weather! The payload includes the icon name to use .�🌤
Give functionality to the temperature unit buttons! 🌡
On click, change temperature of given unit. Furthermore, See in the mock when "C" is selected.
OpenWeatherAPI
returns the temperature in Kevin degrees, you need to convert
between units. Here are the formulas (thanks Wikipedia
):
To convert from Kelvin to F:
To convert from Kelvin to C:
The layout is pretty simple. You don't need any css library, right? 😉
Remember that we should not be able to distinguish between the mock and your final result.
Spec
- Weather icon and temperature text should be centered both horizontally and vertically.
- min/max temperatures should start at the same level than the temperature text.
- Forecast should have five squares with following days (might be hardcoded).
- Forecast odd-numbered items should have dark background color.
- Forecast even-numbered items should have light background color.
The font used is Open Sans
Here the vars we recommend you to use, this is not required though
:
$font-family: "Open Sans", sans-serif;
$display-background-color: #000;
$forecast-background-color: #FF8143;
$forecast-background-color-secondary: #E0E4E8;
- Test the computation method to convert from K to C.
- Test the computation method to convert from K to F.
- Bonus: Test button actions.
Cat tax: