apisproject's People
apisproject's Issues
Write a function which 'gets' the article JSON for an article ID
This is to get access to the photograph link and other details like cost
Declare your variables at the top of functions
It's a good idea to declare your variables at the top of functions. In many of your functions, you define them part-way down or throughout the function.
For example, here: https://github.com/The-Hip-Hip-Arrays/apisproject/blob/master/js/app.js#L75
Consider moving the variable declarations to the top. Even if the value is not immediately available at the start of the function, just define an empty variable (var randomHatsNumber;
), and then reassign the value further down.
Interested to hear if you have a different perspective on this. You can read more about this in Maintainable JavaScript (page 39).
Michelle (FAC5)
Remove other index.HTML and main.CSS files
We have 2 of each of these, we need to delete the older versions
Make front-end responsive
Choose a font
Add second API to project
We really should at least attempt to add in a second API seen as that's the main point of the project!
Write out the data schema for each of the images
Put it in the readme.
How many images, what should they be called, what requests are going into each image.
refactor app.js
basic API call can be refactored into a function that then is reused.
Change fairy image be the button that does everything
Lack of meaningful tests
I understand that testing may have been difficult to wrap your heads around.
One of the reasons for this is that the way you have written your code makes it inherently difficult to test.
For example, see here. In these lines you are:
- Parsing your response data
- Mutating a global variable
- Choosing a random element of an array
- Some DOM manipulation
That is quite a lot of different things going on. Ideally there would be a separation of concerns in your code.
This process is also repeated later on in your code. Repeated operations can be abstracted out to functions that can be tested by themselves. Similarly, instead of passing an anonymous function as your event handler, define a function separately that you can subsequently test.
How can I run this project?
Always a good idea to include run instructions in your README. Just a quick guide to cloning the repo, getting an API key (if you need one) and viewing the project will do.
Michelle (FAC5)
Create the image divs in the DOM and name them well
Global variables
You have quite a lot of global variables in app.js: https://github.com/The-Hip-Hip-Arrays/apisproject/blob/master/js/app.js. You are defining 9 variables at the top of the file.
Global variables are usually a bad idea, because they pollute the global namespace of your project. Relying too much on global variables can result in conflicts between various scripts on the same page. Read more about it here: http://stackoverflow.com/questions/2613310/ive-heard-global-variables-are-bad-what-alternative-solution-should-i-use.
Consider declaring them inside your functions and returning the values from there.
Michelle
API call for every picture change
You could separate the update image change function from the API call. API pulls 200 results. You could use all 200 results before making another call (and avoid annoying Zalando).
Good readme!
๐
sub-directories should not be capitalised
Create the Fairy Godmother front end
Make front-end responsive on mobile
No second api
Pick up your game guys
Write a function which puts the image for a piece of clothing into that div in the DOM
Write a function which retrieves the image link from that article
Be aware of what size it is...
index.html needs to be in the root
I love have .DS_Stores in our project
But... Can we add them to the .gitignore? ๐
Create assets folder to store images locally and put Fairy images into folder
Write a function which picks a random article from an array of articles
We will reuse this code, so write a function called getRandomArticle
Set an image as the background
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.