Git Product home page Git Product logo

weather-to-wear's People

Contributors

helenzhou6 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

weather-to-wear's Issues

Deal with response from Dark Sky API

Tailor clothing recommendations based on response.daily:

Summary

  • Display: response.daily.summary and based on icon:
{
clear-day:  "โ˜€๏ธ",
clear-night: "๐ŸŒ•",
rain: "โ˜”๏ธ",
snow: "โ„๏ธ",
sleet: "๐ŸŒจ", 
wind: "๐Ÿ’จ",
fog: "๐ŸŒซ",
cloudy:  "โ˜๏ธ",
partly-cloudy-day: "๐ŸŒค",
partly-cloudy-night: "๐ŸŒ™"
}[response.daily.data.icon]
  • ${response.daily.data.precipProbability * 100}% chance of ${response.daily.data.precipType}
  • Temperatures between ${response.daily.data.temperatureLow / 32} to ${response.daily.data.temperatureHigh / 32}

  • If low temperature < 5 && high temperature < 20 -> message: 'Wear a thick jumper', if low temperature > 20 && high temperature > 20 -> 'Wear shorts

  • If precipType > 50% -> ' and take your chances and don't bring a ${response.daily.data.precipType} jacket!' If precipType > 50% -> ' and bring a ${response.daily.data.precipType} jacket just in case (or take a chance on the wild side!)' -> If precipType > 80% -> ` and wear your ${response.daily.data.precipType} jacket!

Refactor: change to switch statement

if (lowestTemp < 5 && highestTemp < 10) {
return "a thick jumper";
} else if (lowestTemp > 20 && highestTemp > 20) {
return "shorts";
} else if (lowestTemp < 20 && highestTemp > 20) {
return "shorts and a jumper";
} else {
return "something not too thin and not too thick";
}

if (precipProbability < 20) {
return `take your chances and don't bring a ${precipType} jacket!`;
} else if (precipProbability > 70) {
return `put on your ${precipType} jacket!`;
} else {
return `carry your ${precipType} jacket (or get your chances - ${100 - precipProbability}% chance of being fine!`;
}

Add CSS styling

Have a photo background:

  • On landing, will have be automatically changing background every 5 seconds or so (with fading in and out effects)
  • On results page, the background will be according to the weather icon
  • Look into image lazy loading / web performance - and loading different sizes of images based on device
  • Font color look into mix blend mode
  • Add focus to input by default

To refactor

  • Consider index.js for all utility functions
  • Separate navigator.geolocation function from form.js - should be in utility folder
  • duplicate code in index.js of backend

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.