scrimba
Frontend Career Path
Working with APIs
Promise Rejection
Get photo from Unsplash
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

AboutCommentsNotes
Get photo from Unsplash
Expand for more info
index.js
run
preview
console
/**
* Challenge: get a random image from Unsplash and set it as the background
*
* Part 1:
*
* URL: https://apis.scrimba.com/unsplash/photos/random?orientation=landscape&query=nature
* (You can change the "query" at the end to whatever theme you want)
*
* Change the body's backgroundImage to:
* `url(<insert the URL of the iamge from the API here>)`
*
* (You may need to dig around the response body a bit to find this URL)
*
* (Note I've already added some CSS to resize the image within the window.
* Instructions for this were found on CSS Tricks:
* https://css-tricks.com/perfect-full-page-background-image/#awesome-easy-progressive-css3-way)
*/

Console
/index.html
-4:13