diff --git a/index.js b/index.js new file mode 100644 index 0000000..090ac5e --- /dev/null +++ b/index.js @@ -0,0 +1,28 @@ +//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 diff --git a/searchbar.html b/searchbar.html new file mode 100644 index 0000000..a4e5144 --- /dev/null +++ b/searchbar.html @@ -0,0 +1,39 @@ + + + + + + + Bootstrap demo + + + + + +
+

+

GIT USER FINDER

+ +


+
+
+ +
+
+
+ +
+
+ +
+ +
+ +
+ + + \ No newline at end of file diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..6f1ad49 --- /dev/null +++ b/styles.css @@ -0,0 +1,15 @@ +*{ + justify-content: center; + align-items: center; + text-align: center; +} + +body{ + + background-image: linear-gradient(to right, #eea2a2 0%, #bbc1bf 19%, #57c6e1 42%, #b49fda 79%, #7ac5d8 100%); + +} + +h1{ + font-size: 80px; +} \ No newline at end of file