Render a list of pets from Yummypets API
- We’ll check your work on the latest Chrome browser
- Use ES5 or ES6 (no need to transpile ES6 to ES5)
- Try to use immutable approaches to avoid side-effects (map, filter, slice methods)
- If you prefer you can use any JS framework or library, but be sure not to waste too much time on its installation (there’s no extra points for framework using)
- While working commit each step to your git repository
- Don’t forget to comment on tricky parts of your code
Your task is to fetch a list of pets from Yummypets API, display it and provide a set of actions that manipulate this list.
We’re convinced that ‘less is more’ so try to write your code as simple as possible. If you feel that you’re stuck on one of the features, don’t get discouraged and move on to other steps. Your goal is to complete as many steps as possible, it’s ok if you don’t finish them all.
We wish you good luck!
- Init git project and work on ‘master’ branch.
- Fetch a list of 10 pets from Yummypets API with AJAX or Fetch API. Use the following request: https://api.yummypets.com/pets and the parameter called “limit” to determine the number of pets (10).
- Render the list in your view: display each entry index (that is not present in the object received from API), pet avatars, pseudos, breeds and delete buttons.
- For each list entry provide a way to remove it from the list (from both the JS array and the screen).
- Add a pet at the end of your list by using the form with two fields (‘pseudo’ and ‘breed’):
- Add CSS to style your list. Inspire yourself by the screenshot we provide you with.
- Using CSS variables is a plus.
- No need to use browser prefixes.
- Use basic sans-serif font-family such as Arial or Helvetica.
- Colors:
- Green: #A8B32C
- Second list item: rgba(168, 179, 44, 0.25)
- Third list item: rgba(168, 179, 44, 0.1)
- Light grey: #EFEEED
- Delete button: #c86a6a
- Create new git branch ‘dev’ from ‘master’ (if you can’t, continue on the master branch).
- On ‘dev’ branch sort pseudos alphabetically from A to Z.
- Git knowledge: creating a repository, pushing code to the repository, working with branches
- JS knowledge:
- Retrieving data from RESTful API by means of HTTP calls with parameters
- Selecting elements from within the DOM
- Creating elements dynamically
- Working with JS events such as ‘click’ and ‘submit’
- Working with different data structures: object, array
- Using functions and passing parameters
- Using JS and browser native methods: Math.random, loops, sort
- Using condition and combine condition expressions
- CSS:
- Constructing basic CSS layout
- Centering items horizontally
- Using CSS variables
- Using pseudo selectors
- HTML
- Using semantic markup
- Inserting external style and script sheets