You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can construct a URL like https://source.unsplash.com/random/1000/800 to get a random picture of those dimensions. It even supports search terms by adding search params like ?skateboard,banana to the end.
This would allow you to simply use that URL as a CSS background-image for the page:
html {
background-image:url('https://source.unsplash.com/random/1000/800');
background-size: cover;
}
The text was updated successfully, but these errors were encountered:
week6-app-jcnr/templates.js
Lines 33 to 44 in 2da645a
This code is cool, and it's great to practice client-side stuff like fetching (since we're spending so much time on the server).
However there is a much simpler way to achieve this: https://source.unsplash.com/
You can construct a URL like
https://source.unsplash.com/random/1000/800
to get a random picture of those dimensions. It even supports search terms by adding search params like?skateboard,banana
to the end.This would allow you to simply use that URL as a CSS background-image for the page:
The text was updated successfully, but these errors were encountered: