Skip to content

Commit

Permalink
Merge pull request #11 from TartejBrothers/Changes
Browse files Browse the repository at this point in the history
Added Dropdown
  • Loading branch information
TartejBrothers authored Dec 8, 2023
2 parents bdbc838 + 34548bc commit 05d7935
Show file tree
Hide file tree
Showing 5 changed files with 263 additions and 16 deletions.
45 changes: 44 additions & 1 deletion activites.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,49 @@

<a href="contact.html" class="navitems">Contact Us</a>
<a href="volunteer.html" class="navitems">Volunteer</a>
<img src="images/assests/gripblack.png" alt="menu" />
<img
src="images/assests/gripblack.png"
alt="menu"
id="menu-button"
onclick="toggleMenu()"
/>
</div>
</div>
<div id="dropdown-menu">
<div id="close-button">
<img
src="images/assests/close.png"
alt="close"
onclick="toggleMenu()"
/>
</div>
<div class="dropdownbody">
<a href="activites.html" class="menu-item"><h5>Activities</h5></a>
<ul>
<li>Education</li>
<li>Health</li>
<li>Livelihoods</li>
<li>Research and documentation</li>
</ul>
</div>
<div class="dropdownbody">
<a href="#" class="menu-item"><h5>Information</h5></a>
<ul>
<li>Registration</li>
<li>Trustees Profile</li>
<li>Advisors Profile</li>
</ul>
</div>
<div class="dropdownbody">
<a href="#" class="menu-item"><h5>Contribute</h5></a>
<ul>
<li>Volunteering with us</li>
<li>Donation</li>
<li>Contact Us</li>
</ul>
</div>
<div class="dropdownbody">
<a href="#" class="menu-item"><h5>Mentorship Program</h5></a>
</div>
</div>
<hr class="splitter" />
Expand Down Expand Up @@ -68,5 +110,6 @@ <h1>We <font color="#E6222B">Need</font> Your Help</h1>
</div>
</div>
</div>
<script src="js/script.js"></script>
</body>
</html>
127 changes: 127 additions & 0 deletions css/activites.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,112 @@ input#search {
margin: 20px auto 20px auto;
width: 80%;
}
#menu-container {
position: relative;
}

#menu-button {
cursor: pointer;
padding: 15px;

color: #fff;
text-align: center;
}

#dropdown-menu {
display: none;
position: absolute;
top: 60px;
right: 40px;
width: 25%;
background-color: #000;
color: #fff;
font-family: abhayalibre;
z-index: 1;
overflow: hidden;
padding: 30px;
flex-direction: column;
animation: slideIn 0.6s ease-out;
-webkit-box-shadow: 0px 0px 25px -2px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 0px 0px 25px -2px rgba(0, 0, 0, 0.75);
box-shadow: 0px 0px 25px -2px rgba(0, 0, 0, 0.75);
}

@keyframes slideIn {
from {
height: 0;
}
to {
height: 750px;
}
}
@keyframes slideOut {
from {
height: 750px;
}
to {
height: 0;
}
}

.menu-item {
padding: 12px;
text-decoration: none;
color: #333;
display: block;
transition: background-color 0.3s;
}
.menu-item a {
color: #fff;
display: flex;
height: 100%;
align-items: center;
}
.dropdownbody h5 {
display: flex;
align-items: center;
font-family: abhayalibre;
font-size: 20px;
margin-bottom: 10px;
color: #e6222b;
vertical-align: middle;
}
.dropdownbody ul {
list-style-type: none;
}
.dropdownbody ul li {
margin-bottom: 10px;
text-align: left;
margin-bottom: 20px;
font-size: 15px;
margin-left: 40px;
margin-right: 20px;
}
.menu-item:hover {
background-color: #f1f1f1;
}
#close-button {
display: flex;
width: 100%;
justify-content: flex-end;
color: #fff;
padding: 10px;
text-align: center;
cursor: pointer;
padding: 20px;
}
#close-button img {
height: 25px;
}
.headerbody {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding-top: 100px;
padding-bottom: 100px;
}

.activities {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -178,6 +284,27 @@ input#search {
.navleft img {
margin-right: 10px;
}
#dropdown-menu {
width: 100%;
right: 0;
top: 0;
}
@keyframes slideIn {
from {
height: 0;
}
to {
height: 732px;
}
}
@keyframes slideOut {
from {
height: 732px;
}
to {
height: 0;
}
}
.activities h1 {
font-size: 60px;
}
Expand Down
61 changes: 56 additions & 5 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,27 +104,32 @@ input#search {
display: none;
position: absolute;
top: 60px;
right: 0;
right: 40px;
width: 25%;
background-color: #000;
color: #fff;
font-family: abhayalibre;
z-index: 1;
overflow: hidden;
animation: slideIn 0.3s ease-out;
padding: 30px;
flex-direction: column;
animation: slideIn 0.6s ease-out;
-webkit-box-shadow: 0px 0px 25px -2px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 0px 0px 25px -2px rgba(0, 0, 0, 0.75);
box-shadow: 0px 0px 25px -2px rgba(0, 0, 0, 0.75);
}

@keyframes slideIn {
from {
height: 0;
}
to {
height: 200px;
height: 750px;
}
}
@keyframes slideOut {
from {
height: 200px;
height: 750px;
}
to {
height: 0;
Expand All @@ -138,7 +143,32 @@ input#search {
display: block;
transition: background-color 0.3s;
}

.menu-item a {
color: #fff;
display: flex;
height: 100%;
align-items: center;
}
.dropdownbody h5 {
display: flex;
align-items: center;
font-family: abhayalibre;
font-size: 20px;
margin-bottom: 10px;
color: #e6222b;
vertical-align: middle;
}
.dropdownbody ul {
list-style-type: none;
}
.dropdownbody ul li {
margin-bottom: 10px;
text-align: left;
margin-bottom: 20px;
font-size: 15px;
margin-left: 40px;
margin-right: 20px;
}
.menu-item:hover {
background-color: #f1f1f1;
}
Expand Down Expand Up @@ -567,6 +597,11 @@ input[type="radio"]:checked {
.navleft img {
margin-right: 10px;
}
#dropdown-menu {
width: 100%;
right: 0;
top: 0;
}
.headerbody p {
width: 80%;
}
Expand Down Expand Up @@ -624,6 +659,22 @@ input[type="radio"]:checked {
.socials {
justify-content: center;
}
@keyframes slideIn {
from {
height: 0;
}
to {
height: 732px;
}
}
@keyframes slideOut {
from {
height: 732px;
}
to {
height: 0;
}
}
}
@media screen and (min-width: 1400px) {
.bodymissiontext ul li {
Expand Down
36 changes: 31 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,41 @@
</div>
</div>
<div id="dropdown-menu">
<div id="close-button" onclick="toggleMenu()">
<img src="images/assests/close.png" alt="close" />
<div id="close-button">
<img
src="images/assests/close.png"
alt="close"
onclick="toggleMenu()"
/>
</div>
<div class="dropdownbody">
<a href="activites.html" class="menu-item"><h5>Activities</h5></a>
<ul>
<li>Education</li>
<li>Health</li>
<li>Livelihoods</li>
<li>Research and documentation</li>
</ul>
</div>
<div class="dropdownbody">
<a href="#" class="menu-item"><h5>Information</h5></a>
<ul>
<li>Registration</li>
<li>Trustees Profile</li>
<li>Advisors Profile</li>
</ul>
</div>
<div class="dropdownbody">
<a href="#" class="menu-item"><h5>Contribute</h5></a>
<ul>
<li>Volunteering with us</li>
<li>Donation</li>
<li>Contact Us</li>
</ul>
</div>
<div class="dropdownbody">
<a href="#" class="menu-item"><h5>Mentorship Program</h5></a>
</div>
<a href="#" class="menu-item">Item 1</a>
<a href="#" class="menu-item">Item 2</a>
<a href="#" class="menu-item">Item 3</a>
</div>
<hr class="splitter" />
<div class="headerbody">
Expand Down
10 changes: 5 additions & 5 deletions js/script.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
function toggleMenu() {
var dropdownMenu = document.getElementById("dropdown-menu");

if (dropdownMenu.style.display === "block") {
dropdownMenu.style.animation = "slideOut 0.3s ease-in-out";
if (dropdownMenu.style.display === "flex") {
dropdownMenu.style.animation = "slideOut 0.6s ease-out";
setTimeout(function () {
dropdownMenu.style.display = "none";
dropdownMenu.style.animation = "";
}, 300);
}, 600);
} else {
dropdownMenu.style.display = "block";
dropdownMenu.style.animation = "slideIn 0.3s ease-out";
dropdownMenu.style.display = "flex";
dropdownMenu.style.animation = "slideIn 0.6s ease-out";
}
}

0 comments on commit 05d7935

Please sign in to comment.