From 1bd63ee4accb680f0268796f04af635be1ce72ea Mon Sep 17 00:00:00 2001 From: tin33392js Date: Mon, 28 Nov 2022 00:27:49 +0700 Subject: [PATCH] Fix Unsplash's random server down with alternative - picsum --- random-image-generator/script.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/random-image-generator/script.js b/random-image-generator/script.js index 0f9b658..b84e8df 100644 --- a/random-image-generator/script.js +++ b/random-image-generator/script.js @@ -1,10 +1,16 @@ const container = document.querySelector('.container') const unsplashURL = 'https://source.unsplash.com/random/' +const picsumURL = 'https://picsum.photos' const rows = 5 for(let i = 0; i < rows * 3; i++) { const img = document.createElement('img') - img.src = `${unsplashURL}${getRandomSize()}` + /* + Unplash's random-server is down at the moment. Use 'picsum' instead + Picsum URL: https://picsum.photos///? + */ + // img.src = `${unsplashURL}${getRandomSize()}`; + img.src = `${picsumURL}/${getRandomNr()}/${getRandomNr()}/?${i}`; container.appendChild(img) }