diff --git a/.DS_Store b/.DS_Store index bbc165f..02587fa 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Flask/.DS_Store b/Flask/.DS_Store index ea5cd6d..831d373 100644 Binary files a/Flask/.DS_Store and b/Flask/.DS_Store differ diff --git a/Flask/static/css/global.css b/Flask/static/css/global.css index 804f816..0b621f7 100644 --- a/Flask/static/css/global.css +++ b/Flask/static/css/global.css @@ -21,6 +21,25 @@ html { scroll-behavior: smooth; } +.search-container { + width: 200px; +} +#searchResults { + margin-top: 10px; + width: 200px; + padding: 10px; + border: 1px solid #ccc; + background-color: #f9f9f9; + display: none; + position: absolute; +} + +#searchResults .close-button { + position: absolute; + top: 5px; + right: 5px; + cursor: pointer; +} * { margin: 0; padding: 0; @@ -337,6 +356,16 @@ input#search { .socials { justify-content: center; } + .search-container { + width: 130px; + } + .navbar { + justify-content: space-around; + padding: 20px 0px; + } + .navleft { + justify-content: center; + } } @media screen and (min-width: 1000px) { #mobileview { diff --git a/Flask/static/js/script.js b/Flask/static/js/script.js index f9a4252..1453b43 100644 --- a/Flask/static/js/script.js +++ b/Flask/static/js/script.js @@ -36,3 +36,34 @@ function changemenumentors() { menteesbutton.style.backgroundColor = "#fff"; menteesbutton.style.color = "#1B204A"; } + +function search() { + var searchTerm = document.getElementById("search").value.toLowerCase(); + var resultsContainer = document.getElementById("searchResults"); + resultsContainer.innerHTML = ""; + + var searchableElements = document.querySelectorAll(".searchable"); + var hasResults = false; + + searchableElements.forEach(function (element) { + var content = element.textContent.toLowerCase(); + + if (content.includes(searchTerm)) { + var resultItem = document.createElement("div"); + resultItem.textContent = content; + resultsContainer.appendChild(resultItem); + hasResults = true; + } + }); + resultsContainer.style.display = hasResults ? "block" : "none"; + resultsContainer.innerHTML += searchTerm.split(" ").join("
"); + resultsContainer.innerHTML += + '
'; +} + +function closeSearchResults() { + var resultsContainer = document.getElementById("searchResults"); + resultsContainer.style.display = "none"; +} + +document.getElementById("search").addEventListener("input", search); diff --git a/Flask/templates/activites.html b/Flask/templates/activites.html index ee231cf..241f3ac 100644 --- a/Flask/templates/activites.html +++ b/Flask/templates/activites.html @@ -17,7 +17,10 @@