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 @@ + + + + + + + + + Siddhesh Random image generator + + +
+

Generate images

+
+
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + + + + + \ No newline at end of file