Skip to content

Commit a5375db

Browse files
committed
edited hamburger animation 3
1 parent 7ae2d36 commit a5375db

File tree

2 files changed

+25
-115
lines changed

2 files changed

+25
-115
lines changed

_includes/navbar.html

Lines changed: 25 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,48 @@
1-
2-
<div class="d-flex d-none d-sm-block d-md-block mx-auto">
1+
<nav class="navbar navbar-expand-lg navbar-dark">
2+
<div class="d-flex d-none d-sm-block d-md-block d-lg-none">
33
<div class="navbar-header">
44
<a class="navbar-brand" href="/"><img src="/assets/img/logo/logo.png" style="height: 70px; width: 70px; background-color: white;" class="mr-3">Py Contributors</a>
55
</div>
66
</div>
7-
<!-- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor03" aria-controls="navbarColor03" aria-expanded="false" aria-label="Toggle navigation"> -->
8-
<div class="hamburger">
9-
<div class="line1"></div>
10-
<div class="line2"></div>
11-
<div class="line3"></div>
12-
</div>
13-
<!-- </button> -->
7+
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor03" aria-controls="navbarColor03" aria-expanded="false" aria-label="Toggle navigation">
8+
<span class="navbar-toggler-icon"></span>
9+
</button>
1410

15-
<!-- <div class="collapse navbar-collapse" id="navbarColor03"> -->
16-
<!-- <div class="container"> -->
17-
<!-- <div class="ml-auto mr-4"> -->
18-
<ul >
11+
<div class="collapse navbar-collapse" id="navbarColor03">
12+
<div class="container">
13+
<div class="ml-auto mr-4">
14+
<ul class="navbar-nav">
1915
{% if page.active == "home" %}
20-
<li class=" active"><a class="" href="/">Home</a></li>
16+
<li class="nav-item active"><a class="nav-link" href="/">Home</a></li>
2117
{% else %}
22-
<li class=""><a class="" href="/">Home</a></li>
18+
<li class="nav-item"><a class="nav-link" href="/">Home</a></li>
2319
{% endif %}
2420

2521
{% if page.active == "join-us" %}
26-
<li class=" active"><a class="" href="/join-us/index.html">Join Us</a></li>
22+
<li class="nav-item active"><a class="nav-link" href="/join-us/index.html">Join Us</a></li>
2723
{% else %}
28-
<li class=""><a class="" href="/join-us/index.html">Join Us</a></li>
24+
<li class="nav-item"><a class="nav-link" href="/join-us/index.html">Join Us</a></li>
2925
{% endif %}
30-
<!-- </ul> -->
31-
<!-- </div> -->
32-
<!-- <div class="navbar-header brandShow">
26+
</ul>
27+
</div>
28+
<div class="navbar-header brandShow">
3329
<a class="navbar-brand" href="/"><img src="/assets/img/logo/logo.png" style="height: 70px; width: 70px; background-color: white;" class="mr-3">Py Contributors</a>
34-
</div> -->
30+
</div>
3531

36-
<!-- <ul class="navbar-nav mr-auto ml-4"> -->
32+
<ul class="navbar-nav mr-auto ml-4">
3733

3834
{% if page.active == "updates" %}
39-
<li class=" active"><a class="" href="/updates/index.html">Updates</a></li>
35+
<li class="nav-item active"><a class="nav-link" href="/updates/index.html">Updates</a></li>
4036
{% else %}
41-
<li class=""><a class="" href="/updates/index.html">Updates</a></li>
37+
<li class="nav-item"><a class="nav-link" href="/updates/index.html">Updates</a></li>
4238
{% endif %}
4339

4440
{% if page.active == "developers" %}
45-
<li class=" active"><a class="" href="/developers/index.html">Developers</a></li>
41+
<li class="nav-item active"><a class="nav-link" href="/developers/index.html">Developers</a></li>
4642
{% else %}
47-
<li class=""><a class="" href="/developers/index.html">Developers</a></li>
43+
<li class="nav-item"><a class="nav-link" href="/developers/index.html">Developers</a></li>
4844
{% endif %}
4945
</ul>
50-
<!-- </div>
51-
</div> -->
52-
53-
54-
<script>
55-
const menu = document.querySelector('.hamburger');
56-
const list = document.querySelectorAll('li');
57-
58-
menu.addEventListener('click', () => {
59-
list.forEach(item => {
60-
item.classList.toggle('on');
61-
})
62-
menu.classList.toggle('cross');
63-
})
64-
</script>
46+
</div>
47+
</div>
48+
</nav>

assets/css/main.css

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -159,77 +159,3 @@ background-attachment: fixed !important;
159159
margin-left: 50%;
160160
}
161161
}
162-
/* Hamburger */
163-
164-
.hamburger {
165-
z-index: 1;
166-
display: inline-block;
167-
cursor: pointer;
168-
position: absolute;
169-
right: 10px;
170-
top: 10px;
171-
}
172-
173-
.line1 ,.line2 ,.line3 {
174-
width: 35px;
175-
height: 5px;
176-
background-color: white;
177-
margin: 6px 0;
178-
transition: 0.4s;
179-
}
180-
181-
.cross .line1 {
182-
transform: rotate(-45deg) translate(-9px, 6px);
183-
}
184-
185-
.cross .line2 {
186-
opacity: 0;
187-
background-color: white;
188-
}
189-
190-
.cross .line3 {
191-
transform: rotate(45deg) translate(-8px, -8px);
192-
background-color: white;
193-
}
194-
195-
ul {
196-
height: 100%;
197-
}
198-
199-
ul li {
200-
display: flex;
201-
align-items: center;
202-
justify-content: center;
203-
height: 20%;
204-
color: white;
205-
background-color: black;
206-
text-transform: uppercase;
207-
letter-spacing: 2px;
208-
transition: all 0.4s ease-out;
209-
transform: translateX(-100%);
210-
}
211-
212-
ul li.on {
213-
transform: translateX(0);
214-
}
215-
216-
ul li:nth-child(1) {
217-
background-color: #355070;
218-
transition-delay: 0.08s;
219-
}
220-
ul li:nth-child(2) {
221-
background-color: #6D597A;
222-
transition-delay: 0.16s;
223-
}
224-
ul li:nth-child(3) {
225-
background-color: #B56576;
226-
transition-delay: 0.24s;
227-
}
228-
ul li:nth-child(4) {
229-
background-color: #E56B6F;
230-
transition-delay: 0.32s;
231-
}
232-
ul li:nth-child(5) {
233-
background-color: #EAAC8B;
234-
transition-delay: 0.40s;
235-
}

0 commit comments

Comments
 (0)