Skip to content

Commit

Permalink
Hamburger Navbar and UI changes (#67)
Browse files Browse the repository at this point in the history
very nice pr
  • Loading branch information
bhoopesh369 authored Oct 21, 2022
1 parent 6fd65e3 commit dd075b5
Show file tree
Hide file tree
Showing 6 changed files with 281 additions and 150 deletions.
176 changes: 173 additions & 3 deletions assets/css/style.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.main-container{
background-color: white;
color: black;
width: 100vw;
width: 100%;
height: calc( 100vh - 42px);
display: grid;
place-items: center;
Expand All @@ -28,14 +28,15 @@ span{
}
@media (max-width: 800px) {
.main-container{
margin-top: 3rem;
margin-top: 100px;
flex-direction: column;
}
.titles{
margin-bottom: 2rem;
margin-bottom: 1.8rem;
}
}


.footer {
position: fixed;
left: 0;
Expand All @@ -44,4 +45,173 @@ span{
background-color: rgb(78, 77, 77);
color: white;
text-align: center;
overflow-x: hidden;
z-index: 2;
}

#navi{
padding-left: 50px;
}

@media (max-width: 450px) {
#navi{
padding-left: 30px;
margin-top: 0;
}
.titles{
margin-bottom: 1.7rem;
}
}

#menuToggle
{
display: block;
position: relative;
top: 50px;
/* left: 50px; */

z-index: 1;

-webkit-user-select: none;
user-select: none;
}

#menuToggle a
{
text-decoration: none;
color: #232323;

transition: color 0.3s ease;
}

#menuToggle a:hover
{
color: tomato;
}

#menuToggle .active{
color: tomato;
}

#menuToggle .disabled{
color: #707070;
}

#menuToggle .disabled:hover{
color: #707070;
}

#menuToggle input
{
display: block;
width: 40px;
height: 32px;
position: absolute;
top: -7px;
left: -5px;

cursor: pointer;

opacity: 0; /* hide this */
z-index: 2; /* and place it over the hamburger */

-webkit-touch-callout: none;
}

#menuToggle span
{
display: block;
width: 33px;
height: 4px;
margin-bottom: 5px;
position: relative;

background: #aeaeae;
border-radius: 3px;

z-index: 1;

transform-origin: 4px 0px;

transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
background 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
opacity 0.55s ease;
}

#menuToggle span:first-child
{
transform-origin: 0% 0%;
}

#menuToggle span:nth-last-child(2)
{
transform-origin: 0% 100%;
}

/*
* Transform all the slices of hamburger
* into a crossmark.
*/
#menuToggle input:checked ~ span
{
opacity: 1;
transform: rotate(45deg) translate(-2px, -1px);
background: #232323;
}

/*
* But let's hide the middle one.
*/
#menuToggle input:checked ~ span:nth-last-child(3)
{
opacity: 0;
transform: rotate(0deg) scale(0.2, 0.2);
}

/*
* Ohyeah and the last one should go the other direction
*/
#menuToggle input:checked ~ span:nth-last-child(2)
{
transform: rotate(-45deg) translate(0, -1px);
}

/*
* Make this absolute positioned
* at the top left of the screen
*/
#menu
{
position: absolute;
width: 300px;
height: 100vmax;
margin: -100px 0 0 -50px;
padding: 50px;
padding-top: 125px;

background: #ededed;
list-style-type: none;
-webkit-font-smoothing: antialiased;
/* to stop flickering of text in safari */

transform-origin: 0% 0%;
transform: translate(-100%, 0);

transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0);

}

#menu li
{
padding: 10px 0;
font-size: 22px;
}

/*
* And let's slide it in from the left
*/
#menuToggle input:checked ~ ul
{
transform: none;
}

36 changes: 17 additions & 19 deletions blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,23 @@
<link rel="stylesheet" href="./assets/css/style.css" />
</head>
<body>
<nav>
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="navId">
<li class="nav-item">
<a href="./index.html" class="nav-link">Home</a>
</li>
<li class="nav-item">
<a href="#tab2Id" class="nav-link">Contributors</a>
</li>
<li class="nav-item">
<a href="./project.html" class="nav-link">Projects</a>
</li>
<li class="nav-item">
<a href="./blog.html" class="nav-link active">Blog</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link disabled">Open-Source</a>
</li>
</ul>
<nav id="navi">
<div id="menuToggle">
<!-- Nav tabs -->
<input type="checkbox" />

<span></span>
<span></span>
<span></span>

<ul id="menu">
<a href="index.html" ><li>Home</li></a>
<a href="./contributor.html" ><li>Contributors</li></a>
<a href="./project.html" ><li>Projects</li></a>
<a href="./blog.html" class="active"><li>Blog</li></a>
<a href="#" class="disabled"><li>Open-Source</li></a>
</ul>
</div>
</nav>

<section>
Expand Down
82 changes: 17 additions & 65 deletions contributor.html
Original file line number Diff line number Diff line change
@@ -1,51 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hacktoberfest React Projects</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css"
integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I" crossorigin="anonymous" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/js/bootstrap.min.js"
integrity="sha384-oesi62hOLfzrys4LxRF63OJCXdXDipiYWBnvTl9Y9/TRlw5xlKIEHpNyvvDShgf/"
crossorigin="anonymous"></script>
<link rel="stylesheet" href="assets/css/style.css" />
<link rel="stylesheet" href="assets/css/contributor.css" />
</head>

<body>
<nav>
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="navId">
<li class="nav-item">
<a href="index.html" class="nav-link active">Home</a>
</li>
<li class="nav-item">
<a href="#tab2Id" class="nav-link">Contributors</a>
</li>
<li class="nav-item">
<a href="/PROJECTS" class="nav-link">Projects</a>
</li>
<li class="nav-item">
<a href="./blog.html" class="nav-link">Blog</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link disabled">Open-Source</a>
</li>
</ul>
</nav>

<div class="container">
<div class="details" >
<h1 class="title"> Our Contributors </h1>
<p class="sub-title"> Thanks To All Contributors. Join Us </p>
</div>

<div>
<ul class="contributors-list" id="contributors" >
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
Expand All @@ -70,25 +24,23 @@ <h1 class="title"> Our Contributors </h1>
</head>

<body>
<nav>
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="navId">
<li class="nav-item">
<a href="index.html" class="nav-link active">Home</a>
</li>
<li class="nav-item">
<a href="./contributor.html" class="nav-link">Contributors</a>
</li>
<li class="nav-item">
<a href="./project.html" class="nav-link">Projects</a>
</li>
<li class="nav-item">
<a href="./blog.html" class="nav-link">Blog</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link disabled">Open-Source</a>
</li>
</ul>
<nav id="navi">
<div id="menuToggle">
<!-- Nav tabs -->
<input type="checkbox" />

<span></span>
<span></span>
<span></span>

<ul id="menu">
<a href="index.html" ><li>Home</li></a>
<a href="./contributor.html" class="active"><li>Contributors</li></a>
<a href="./project.html" ><li>Projects</li></a>
<a href="./blog.html" ><li>Blog</li></a>
<a href="#" class="disabled"><li>Open-Source</li></a>
</ul>
</div>
</div>

</div>
Expand Down
Loading

1 comment on commit dd075b5

@vercel
Copy link

@vercel vercel bot commented on dd075b5 Oct 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.