Skip to content

Commit 64dac76

Browse files
committed
fix: feed url
1 parent e2fcad1 commit 64dac76

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

048-random image generator/script.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
const container = document.querySelector(".container");
2-
const unsplashURL = "https://source.unsplash.com/random/";
2+
const randomfoxURL = "https://randomfox.ca/images/";
33
const rows = 5;
44

5-
const getRandomNumber = () => Math.floor(Math.random() * 10) + 300;
6-
const getRandomSize = () => `${getRandomNumber()}x${getRandomNumber()}`;
5+
const getRandomNumber = () => Math.floor(Math.random() * 123);
76

87
for (let i = 0; i < rows * 3; i++) {
98
const image = document.createElement("img");
10-
image.src = `${unsplashURL}${getRandomSize()}`;
9+
image.src = `${randomfoxURL}${getRandomNumber()}.jpg`;
1110
container.appendChild(image);
1211
}

0 commit comments

Comments
 (0)