From 1f4926723a6dedc8a54449cafbe35d31ea0635fb Mon Sep 17 00:00:00 2001 From: Akshat Singh Date: Fri, 30 Jan 2026 23:00:00 +0530 Subject: [PATCH 1/3] Create Akshat Singh --- Akshat Singh | 1 + 1 file changed, 1 insertion(+) create mode 100644 Akshat Singh diff --git a/Akshat Singh b/Akshat Singh new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/Akshat Singh @@ -0,0 +1 @@ + From 9ab29ee96a9b8d6cd609bfb3ed68d517c8d51e69 Mon Sep 17 00:00:00 2001 From: Akshat Singh Date: Fri, 30 Jan 2026 23:00:35 +0530 Subject: [PATCH 2/3] Delete Akshat Singh --- Akshat Singh | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Akshat Singh diff --git a/Akshat Singh b/Akshat Singh deleted file mode 100644 index 8b137891..00000000 --- a/Akshat Singh +++ /dev/null @@ -1 +0,0 @@ - From 023874b0b85dfba5adcbf0f68cc22dcfa0656d8e Mon Sep 17 00:00:00 2001 From: Akshat Singh Date: Sat, 31 Jan 2026 00:29:20 +0530 Subject: [PATCH 3/3] Added Global University Finder project --- Akshat Singh/README.md | 21 +++++++ Akshat Singh/app.js | 96 ++++++++++++++++++++++++++++++++ Akshat Singh/index.html | 40 ++++++++++++++ Akshat Singh/style.css | 120 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 277 insertions(+) create mode 100644 Akshat Singh/README.md create mode 100644 Akshat Singh/app.js create mode 100644 Akshat Singh/index.html create mode 100644 Akshat Singh/style.css diff --git a/Akshat Singh/README.md b/Akshat Singh/README.md new file mode 100644 index 00000000..4a425bb8 --- /dev/null +++ b/Akshat Singh/README.md @@ -0,0 +1,21 @@ +# 🌍 Global University Finder + +A web application to search universities worldwide by country and Indian states. + +## 👨‍💻 Author +Akshat Singh + +## 🚀 Features +- Search universities by country +- Search Indian universities by state +- Uses Hipolabs Universities API +- Clean UI with responsive design + +## 🛠 Tech Stack +- HTML +- CSS +- JavaScript +- Axios + +## API used + University finder API - "http://universities.hipolabs.com/search" diff --git a/Akshat Singh/app.js b/Akshat Singh/app.js new file mode 100644 index 00000000..dd27270d --- /dev/null +++ b/Akshat Singh/app.js @@ -0,0 +1,96 @@ +const BASE_URL = "http://universities.hipolabs.com/search"; + +// ---------------- COUNTRY SEARCH ---------------- +const countryInput = document.querySelector("#countryInput"); +const countryBtn = document.querySelector("#country"); + +countryBtn.addEventListener("click", searchByCountry); +countryInput.addEventListener("keydown", (e) => { + if (e.key === "Enter") { + searchByCountry(); + } +}); + +//function to search universities in required country using api + +async function searchByCountry() { + let country = countryInput.value.trim(); + if (!country) return; + + let res = await axios.get(`${BASE_URL}?country=${country}`); + + console.log(`Universities in ${country.toUpperCase()}:`); + res.data.forEach((col, index) => { + console.log(`${index + 1}. ${col.name}`); + }); + + showCountry(res.data); +} + +//function to display universities in the form of unordered list + +function showCountry(colleges) { + let list = document.querySelector("#clist"); + list.innerHTML = ""; + + if (colleges.length === 0) { + list.innerText = "No universities found"; + return; + } + + colleges.forEach(col => { + let li = document.createElement("li"); + li.innerText = col.name; + list.appendChild(li); + }); +} + +// ---------------- STATE SEARCH ---------------- +const stateInput = document.querySelector("#stateInput"); +const stateBtn = document.querySelector("#state"); + +stateBtn.addEventListener("click", searchByState); +stateInput.addEventListener("keydown", (e) => { + if (e.key === "Enter") { + searchByState(); + } +}); + +//function to search universities in required state of India using api + +async function searchByState() { + let state = stateInput.value.trim().toLowerCase(); + if (!state) return; + + let res = await axios.get(`${BASE_URL}?country=India`); + + let filtered = res.data.filter(col => + col["state-province"] && + col["state-province"].toLowerCase().includes(state) + ); + + console.log(`Universities in ${state.toUpperCase()}:`); + filtered.forEach((col, index) => { + console.log(`${index + 1}. ${col.name}`); + }); + + showState(filtered); +} + +//function to display universities in the form of unordered list + +function showState(colleges) { + let list = document.querySelector("#slist"); + list.innerHTML = ""; + + if (colleges.length === 0) { + list.innerText = "No colleges found for this state"; + return; + } + + colleges.forEach(col => { + let li = document.createElement("li"); + li.innerText = col.name; + list.appendChild(li); + }); +} diff --git a/Akshat Singh/index.html b/Akshat Singh/index.html new file mode 100644 index 00000000..d95a2afd --- /dev/null +++ b/Akshat Singh/index.html @@ -0,0 +1,40 @@ + + + + + + Global University Finder + + + + + +
+

🌍 Global University Finder

+ + + + + + +
+ + + + \ No newline at end of file diff --git a/Akshat Singh/style.css b/Akshat Singh/style.css new file mode 100644 index 00000000..17b8bd85 --- /dev/null +++ b/Akshat Singh/style.css @@ -0,0 +1,120 @@ +/* Google Font */ +@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap'); + +* { + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Poppins', sans-serif; +} + +body { + min-height: 100vh; + background: linear-gradient(135deg, #667eea, #764ba2); + display: flex; + justify-content: center; + align-items: center; + padding: 20px; +} + +/* Main Container */ +.container { + background: #ffffff; + width: 100%; + max-width: 700px; + padding: 30px; + border-radius: 12px; + box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2); +} + +/* Title */ +h1 { + text-align: center; + margin-bottom: 25px; + color: #333; +} + +/* Search Section */ +.search-box { + margin-bottom: 30px; +} + +.search-box h3 { + margin-bottom: 10px; + color: #555; +} + +/* Input + Button */ +.search-area { + display: flex; + gap: 10px; +} + +input { + flex: 1; + padding: 12px 15px; + border: 1px solid #ccc; + border-radius: 6px; + outline: none; + font-size: 15px; +} + +input:focus { + border-color: #667eea; +} + +/* Buttons */ +button { + padding: 12px 20px; + background: #667eea; + color: #fff; + border: none; + border-radius: 6px; + cursor: pointer; + font-size: 15px; + transition: background 0.3s ease, transform 0.2s ease; +} + +button:hover { + background: #5a67d8; + transform: translateY(-2px); +} + +/* Result List */ +ul { + margin-top: 15px; + max-height: 200px; + overflow-y: auto; + padding-left: 20px; +} + +ul li { + margin-bottom: 8px; + color: #333; + line-height: 1.5; +} + +/* Empty message */ +ul:empty::before { + content: "Results will appear here..."; + color: #888; + font-style: italic; +} + +/* Scrollbar */ +ul::-webkit-scrollbar { + width: 6px; +} + +ul::-webkit-scrollbar-thumb { + background: #667eea; + border-radius: 10px; +} + +/* Footer (optional) */ +.footer { + text-align: center; + margin-top: 20px; + font-size: 14px; + color: #777; +}