We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e2fcad1 commit 64dac76Copy full SHA for 64dac76
048-random image generator/script.js
@@ -1,12 +1,11 @@
1
const container = document.querySelector(".container");
2
-const unsplashURL = "https://source.unsplash.com/random/";
+const randomfoxURL = "https://randomfox.ca/images/";
3
const rows = 5;
4
5
-const getRandomNumber = () => Math.floor(Math.random() * 10) + 300;
6
-const getRandomSize = () => `${getRandomNumber()}x${getRandomNumber()}`;
+const getRandomNumber = () => Math.floor(Math.random() * 123);
7
8
for (let i = 0; i < rows * 3; i++) {
9
const image = document.createElement("img");
10
- image.src = `${unsplashURL}${getRandomSize()}`;
+ image.src = `${randomfoxURL}${getRandomNumber()}.jpg`;
11
container.appendChild(image);
12
}
0 commit comments