Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the animated hamburger/menu icon #187

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 44 additions & 1 deletion public/css/ngo_dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,51 @@ body.dark {
}

.menu-icon {
cursor: pointer;
z-index: 2;
padding: 6px;
border-radius: 6px;
border:1px solid #F07070;
}

#checkbox {
display: none;
}

.bars-toggle {
position: relative;
width: 25px;
height: 25px;
display: flex;
cursor: pointer;
flex-direction: column;
align-items: center;
justify-content: center;
margin-bottom: 0;
gap: 6px;
}

.bars {
width: 25px;
height: 3.5px;
background-color: black;
border-radius: 5px;
transition: transform 0.6s, opacity 0.3s, background-color 0.3s;
}

body.dark .bars {
background-color: white;
}

#checkbox:checked + .bars-toggle #bar1 {
transform: rotate(45deg) translate(6.8px, 6.8px);
}

#checkbox:checked + .bars-toggle #bar2 {
opacity: 0;
}

#checkbox:checked + .bars-toggle #bar3 {
transform: rotate(-45deg) translate(6.8px, -6.8px);
}

.dash {
Expand Down
54 changes: 51 additions & 3 deletions views/Admin_Dashboard.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,51 @@
}

.menu-icon {
cursor: pointer;
z-index: 2;
padding: 6px;
border-radius: 6px;
border:1px solid #F07070;
}

#checkbox {
display: none;
}

.bars-toggle {
position: relative;
width: 25px;
height: 25px;
display: flex;
cursor: pointer;
flex-direction: column;
align-items: center;
justify-content: center;
margin-bottom: 0;
gap: 6px;
}

.bars {
width: 25px;
height: 3.5px;
background-color: black;
border-radius: 5px;
transition: transform 0.6s, opacity 0.3s, background-color 0.3s;
}

body.dark .bars {
background-color: white;
}

#checkbox:checked + .bars-toggle #bar1 {
transform: rotate(45deg) translate(6.8px, 6.8px);
}

#checkbox:checked + .bars-toggle #bar2 {
opacity: 0;
}

#checkbox:checked + .bars-toggle #bar3 {
transform: rotate(-45deg) translate(6.8px, -6.8px);
}

.dash {
Expand Down Expand Up @@ -483,8 +526,13 @@

<section class="dashboard">
<div class="top">
<div class="menu-icon" onclick="toggleMenu()">
<i class="uil uil-bars"></i>
<div class="menu-icon">
<input id="checkbox" type="checkbox" onclick="toggleMenu()">
<label class="bars-toggle" for="checkbox">
<div id="bar1" class="bars"></div>
<div id="bar2" class="bars"></div>
<div id="bar3" class="bars"></div>
</label>
</div>
<div class="dash">DashBoard</div>
<div class="Left-name">Welcome, <%= email %>!</div>
Expand Down
9 changes: 7 additions & 2 deletions views/NGO-Dashboard.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,13 @@

<section class="dashboard">
<div class="top">
<div class="menu-icon" onclick="toggleMenu()">
<i class="uil uil-bars"></i>
<div class="menu-icon">
<input id="checkbox" type="checkbox" onclick="toggleMenu()">
<label class="bars-toggle" for="checkbox">
<div id="bar1" class="bars"></div>
<div id="bar2" class="bars"></div>
<div id="bar3" class="bars"></div>
</label>
</div>
<div class="dash">DashBoard</div>
<div class="Left-name">Welcome, <%= fullName %>!</div>
Expand Down
55 changes: 52 additions & 3 deletions views/UserDashBoard.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,57 @@
}

.menu-icon {
cursor: pointer;
z-index: 2;
padding: 6px;
border-radius: 6px;
border:1px solid #F07070;
}

#checkbox {
display: none;
}

.bars-toggle {
position: relative;
width: 25px;
height: 25px;
display: flex;
cursor: pointer;
flex-direction: column;
align-items: center;
justify-content: center;
margin-bottom: 0;
gap: 6px;
}

.bars {
width: 25px;
height: 3.5px;
background-color: black;
border-radius: 5px;
transition: transform 0.6s, opacity 0.3s, background-color 0.3s;
}

body.dark .bars {
background-color: white;
}

#checkbox:checked + .bars-toggle #bar1 {
transform: rotate(45deg) translate(6.8px, 6.8px);
}

#checkbox:checked + .bars-toggle #bar2 {
opacity: 0;
}

#checkbox:checked + .bars-toggle #bar3 {
transform: rotate(-45deg) translate(6.8px, -6.8px);
}

.dash {
position: absolute;
left: 35px;
margin-left: 25px;
}

body.dark .top {
Expand Down Expand Up @@ -609,8 +653,13 @@

<section class="dashboard">
<div class="top">
<div class="menu-icon" onclick="toggleMenu()">
<i class="uil uil-bars"></i>
<div class="menu-icon">
<input id="checkbox" type="checkbox" onclick="toggleMenu()">
<label class="bars-toggle" for="checkbox">
<div id="bar1" class="bars"></div>
<div id="bar2" class="bars"></div>
<div id="bar3" class="bars"></div>
</label>
</div>
<div class="dash">DashBoard</div>
<div class="Left-name">Welcome, <%= fullName %>!</div>
Expand Down