Skip to content

Commit

Permalink
Merge pull request #39 from TartejBrothers/Changes
Browse files Browse the repository at this point in the history
Changes
  • Loading branch information
TartejBrothers authored Jan 30, 2024
2 parents 68c5307 + 537da73 commit a5a5156
Show file tree
Hide file tree
Showing 15 changed files with 160 additions and 12 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified Flask/.DS_Store
Binary file not shown.
29 changes: 29 additions & 0 deletions Flask/static/css/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
31 changes: 31 additions & 0 deletions Flask/static/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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("<br>");
resultsContainer.innerHTML +=
'<div class="close-button" onclick="closeSearchResults()">✖</div>';
}

function closeSearchResults() {
var resultsContainer = document.getElementById("searchResults");
resultsContainer.style.display = "none";
}

document.getElementById("search").addEventListener("input", search);
5 changes: 4 additions & 1 deletion Flask/templates/activites.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
<div class="navbar">
<div class="navleft">
<img src="../static/images/assests/logo.png" alt="logo" />
<input type="text" id="search" />
<div class="search-container">
<input type="text" id="search" />
<div id="searchResults"></div>
</div>
</div>
<div class="navright">
<a href="index.html" class="navitems">Home</a>
Expand Down
5 changes: 4 additions & 1 deletion Flask/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
<div class="navbar">
<div class="navleft">
<img src="../static/images/assests/logo.png" alt="logo" />
<input type="text" id="search" />
<div class="search-container">
<input type="text" id="search" />
<div id="searchResults"></div>
</div>
</div>
<div class="navright">
<a href="index.html" class="navitems">Home</a>
Expand Down
5 changes: 4 additions & 1 deletion Flask/templates/information.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
<div class="navbar">
<div class="navleft">
<img src="../static/images/assests/logo.png" alt="logo" />
<input type="text" id="search" />
<div class="search-container">
<input type="text" id="search" />
<div id="searchResults"></div>
</div>
</div>
<div class="navright">
<a href="index.html" class="navitems">Home</a>
Expand Down
5 changes: 4 additions & 1 deletion Flask/templates/mentees.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
<div class="navbar">
<div class="navleft">
<img src="../static/images/assests/logo.png" alt="logo" />
<input type="text" id="search" />
<div class="search-container">
<input type="text" id="search" />
<div id="searchResults"></div>
</div>
</div>
<div class="navright">
<a href="index.html" class="navitems">Home</a>
Expand Down
5 changes: 4 additions & 1 deletion activites.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
<div class="navbar">
<div class="navleft">
<img src="images/assests/logo.png" alt="logo" />
<input type="text" id="search" />
<div class="search-container">
<input type="text" id="search" />
<div id="searchResults"></div>
</div>
</div>
<div class="navright">
<a href="index.html" class="navitems">Home</a>
Expand Down
30 changes: 30 additions & 0 deletions css/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@
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;
Expand Down Expand Up @@ -337,6 +357,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 {
Expand Down
2 changes: 1 addition & 1 deletion css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ input[type="radio"]:checked {
}

.bodymission img {
height: 120px;
height: 100px;
}
.volunteer {
flex-direction: column;
Expand Down
14 changes: 10 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@
<div class="navbar">
<div class="navleft">
<img src="images/assests/logo.png" alt="logo" />
<input type="text" id="search" />

<div class="search-container">
<input type="text" id="search" />
<div id="searchResults"></div>
</div>
<!-- <input type="text" id="search" /> -->
</div>

<div class="navright">
<a href="index.html" class="navitems">Home</a>

Expand Down Expand Up @@ -74,7 +80,7 @@
</div>
</div>
<hr class="splitter" />
<div class="headerbody">
<div class="headerbody searchable">
<h1>Changing Lives, One Act of Kindness at a Time.</h1>
<p>
Our activities aim to provide better outcomes for marginalized and
Expand Down Expand Up @@ -228,7 +234,6 @@ <h1>Volunteer Now</h1>
<div class="donation" id="donation">
<div class="donationleft">
<h1>Donation</h1>

<p class="donationbody">
AD Life Trust has 12A registration under Income Tax Act, exempting it
from paying taxes on income, we also an eligible institution under 80G
Expand All @@ -242,7 +247,7 @@ <h1>Donation</h1>
<font color="#E6222b">adlife.trust@addlifegroup.com</font>
</p>
</div>
<div class="donationright">
<div class="donationright searchablea">
<form>
<input type="text" placeholder="E-Mail" class="inputfull" />
<input
Expand Down Expand Up @@ -281,6 +286,7 @@ <h1>Donation</h1>
</form>
</div>
</div>

<div class="footer" id="contact">
<div class="footerleft">
<div class="footerlefthead">
Expand Down
5 changes: 4 additions & 1 deletion information.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
<div class="navbar">
<div class="navleft">
<img src="images/assests/logo.png" alt="logo" />
<input type="text" id="search" />
<div class="search-container">
<input type="text" id="search" />
<div id="searchResults"></div>
</div>
</div>
<div class="navright">
<a href="index.html" class="navitems">Home</a>
Expand Down
31 changes: 31 additions & 0 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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("<br>");
resultsContainer.innerHTML +=
'<div class="close-button" onclick="closeSearchResults()">✖</div>';
}

function closeSearchResults() {
var resultsContainer = document.getElementById("searchResults");
resultsContainer.style.display = "none";
}

document.getElementById("search").addEventListener("input", search);
5 changes: 4 additions & 1 deletion mentees.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
<div class="navbar">
<div class="navleft">
<img src="images/assests/logo.png" alt="logo" />
<input type="text" id="search" />
<div class="search-container">
<input type="text" id="search" />
<div id="searchResults"></div>
</div>
</div>
<div class="navright">
<a href="index.html" class="navitems">Home</a>
Expand Down

0 comments on commit a5a5156

Please sign in to comment.