Skip to content

Commit 7ae2d36

Browse files
committed
edited hamburger animation 2
1 parent 03fd8bf commit 7ae2d36

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

_includes/navbar.html

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
<nav class="navbar navbar-dark">
1+
32
<div class="d-flex d-none d-sm-block d-md-block mx-auto">
43
<div class="navbar-header">
54
<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>
@@ -18,15 +17,15 @@
1817
<!-- <div class="ml-auto mr-4"> -->
1918
<ul >
2019
{% if page.active == "home" %}
21-
<li class=" active"><a class="nav-link" href="/">Home</a></li>
20+
<li class=" active"><a class="" href="/">Home</a></li>
2221
{% else %}
23-
<li class=""><a class="nav-link" href="/">Home</a></li>
22+
<li class=""><a class="" href="/">Home</a></li>
2423
{% endif %}
2524

2625
{% if page.active == "join-us" %}
27-
<li class=" active"><a class="nav-link" href="/join-us/index.html">Join Us</a></li>
26+
<li class=" active"><a class="" href="/join-us/index.html">Join Us</a></li>
2827
{% else %}
29-
<li class=""><a class="nav-link" href="/join-us/index.html">Join Us</a></li>
28+
<li class=""><a class="" href="/join-us/index.html">Join Us</a></li>
3029
{% endif %}
3130
<!-- </ul> -->
3231
<!-- </div> -->
@@ -37,28 +36,28 @@
3736
<!-- <ul class="navbar-nav mr-auto ml-4"> -->
3837

3938
{% if page.active == "updates" %}
40-
<li class=" active"><a class="nav-link" href="/updates/index.html">Updates</a></li>
39+
<li class=" active"><a class="" href="/updates/index.html">Updates</a></li>
4140
{% else %}
42-
<li class=""><a class="nav-link" href="/updates/index.html">Updates</a></li>
41+
<li class=""><a class="" href="/updates/index.html">Updates</a></li>
4342
{% endif %}
4443

4544
{% if page.active == "developers" %}
46-
<li class=" active"><a class="nav-link" href="/developers/index.html">Developers</a></li>
45+
<li class=" active"><a class="" href="/developers/index.html">Developers</a></li>
4746
{% else %}
48-
<li class=""><a class="nav-link" href="/developers/index.html">Developers</a></li>
47+
<li class=""><a class="" href="/developers/index.html">Developers</a></li>
4948
{% endif %}
5049
</ul>
5150
<!-- </div>
5251
</div> -->
53-
</nav>
52+
5453

5554
<script>
5655
const menu = document.querySelector('.hamburger');
5756
const list = document.querySelectorAll('li');
5857

5958
menu.addEventListener('click', () => {
6059
list.forEach(item => {
61-
item.classList.toggle('active');
60+
item.classList.toggle('on');
6261
})
6362
menu.classList.toggle('cross');
6463
})

assets/css/main.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ background-attachment: fixed !important;
191191
transform: rotate(45deg) translate(-8px, -8px);
192192
background-color: white;
193193
}
194+
194195
ul {
195196
height: 100%;
196197
}
@@ -208,7 +209,7 @@ ul li {
208209
transform: translateX(-100%);
209210
}
210211

211-
ul li.active {
212+
ul li.on {
212213
transform: translateX(0);
213214
}
214215

0 commit comments

Comments
 (0)