diff --git a/background.jpg b/background.jpg new file mode 100644 index 0000000..f3e9490 Binary files /dev/null and b/background.jpg differ diff --git a/shreya.html b/shreya.html new file mode 100644 index 0000000..0ca78ad --- /dev/null +++ b/shreya.html @@ -0,0 +1,61 @@ + + + + + + + + + + + + + Github User Finder + + + +
+
+
+ +

+ GITHUB USER FINDER +

+
+
+ +
+
+ +
+
+
+ +
+


+
+ Click on the picture below +
+
+










+

+ +
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/shreya.js b/shreya.js new file mode 100644 index 0000000..e9d5988 --- /dev/null +++ b/shreya.js @@ -0,0 +1,32 @@ +function functionName() { + document.querySelector(".box").classList.toggle("b1") + } + + //fetch data from form! + var form = document.getElementById("myForm"); + + + form.addEventListener('submit', function (e) { + + //prevent the auto submission of form + e.preventDefault(); + + var search = document.getElementById("search").value; + + //to remove space in b/w firstName & lastName + var originalName = search.split(' ').join(''); + + document.getElementById("result").innerHTML = ''; + + fetch("https://api.github.com/users/" + originalName) + .then((result) => result.json()) + .then((data) => { + console.log(data) + + document.getElementById("result").classList.add("discription"); + + document.getElementById("result").innerHTML = ` + + ` + }) + }) \ No newline at end of file