From bd6f0f37955b89be68445d199e495028bc9cc387 Mon Sep 17 00:00:00 2001 From: Siddhesh Jondhale <84581657+Siddhesh172004@users.noreply.github.com> Date: Mon, 19 Jun 2023 03:37:57 +0530 Subject: [PATCH] Random Image Generator --- .../README.md | 5 +++ .../api.js | 19 ++++++++++ .../index.html | 35 +++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 Picsum-api-for-random-image-generator-main/README.md create mode 100644 Picsum-api-for-random-image-generator-main/api.js create mode 100644 Picsum-api-for-random-image-generator-main/index.html diff --git a/Picsum-api-for-random-image-generator-main/README.md b/Picsum-api-for-random-image-generator-main/README.md new file mode 100644 index 0000000..d2b4ca7 --- /dev/null +++ b/Picsum-api-for-random-image-generator-main/README.md @@ -0,0 +1,5 @@ +Random image generator using picsum api + +Output :- + +https://siddhesh172004.github.io/Picsum-api-for-random-image-generator/ diff --git a/Picsum-api-for-random-image-generator-main/api.js b/Picsum-api-for-random-image-generator-main/api.js new file mode 100644 index 0000000..7dfcb62 --- /dev/null +++ b/Picsum-api-for-random-image-generator-main/api.js @@ -0,0 +1,19 @@ + +let formss=document.getElementById("formsss") +let width=document.getElementById("width") +let height=document.getElementById("height") + +height.addEventListener('keyup', (e)=>{ + (e.keyCode === 13 ? formss(e) : null); +}) + + + formss.addEventListener('submit',function(e){ +e.preventDefault() + + let image=document.getElementById("img") + + let links="https://picsum.photos/"+width.value+"/"+height.value + image.src=links +// alert("https://source.unsplash.com/random/"+width.value+"*"+height.value) +}) \ No newline at end of file diff --git a/Picsum-api-for-random-image-generator-main/index.html b/Picsum-api-for-random-image-generator-main/index.html new file mode 100644 index 0000000..bd98ea6 --- /dev/null +++ b/Picsum-api-for-random-image-generator-main/index.html @@ -0,0 +1,35 @@ + + +
+ + + + + +