Skip to content
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
4 changes: 2 additions & 2 deletions _scss/header/_navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
.nav__items {
height: calc(100vh - 64px);
max-height: 700px;
overflow-y: scroll;
list-style: none;
.subscribe-button {
list-style: none;
padding: 14px 30px;
Expand Down Expand Up @@ -169,4 +169,4 @@
@extend .mobile-nav-trigger;
background-image: url('../img/closebutton-01.svg');
}
}
}
12 changes: 9 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<head>
<link target="_blank" href="https://fonts.googleapis.com/css?family=Advent+Pro:500,600,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Nunito:400,600,700" rel="stylesheet">
<link rel="stylesheet" href="css/index.css" charset="utf-8">
<meta charset="UTF-8">
<link rel="stylesheet" href="css/index.css" charset="utf-8">
<meta charset="UTF-8">
<title>Python Joinville</title>
<meta name="viewport" content="width=device-width">
</head>
Expand All @@ -16,7 +16,7 @@ <h1>Menu</h1>
<ul class="nav__items">
<li class="nav__item"><a class="nav__anchor scroll" href="#top">Comunidade</a></li>
<li class="nav__item"><a class="nav__anchor scroll" href="#meetings">Meetups</a></li>
<li class="nav__item"><a class="nav__anchor" disabled href="#locations">Locais Pr茅vios</a></li>
<li class="nav__item"><a class="nav__anchor scroll" href="#locations">Locais Pr茅vios</a></li>
</ul>
</nav>
<div class="content-wrapper" id="top">
Expand Down Expand Up @@ -290,5 +290,11 @@ <h4 class="footer__nav__menu__title">
</div>
</footer>
</div>

<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
<script type="text/javascript" src="js/index.js"></script>
</body>
</html>
19 changes: 8 additions & 11 deletions js/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import 'scss/index.scss';
import ScrollTo from 'storm-scroll-to';

class MobileNavManager {
constructor() {
this.mobileNav = document.querySelector('#mobile-nav');
Expand Down Expand Up @@ -51,9 +48,6 @@ class MobileNavManager {
}
this.mobileNav.classList.toggle('opened');
this.handleFocus();
if (e.currentTarget.classList.contains('scroll')) {
e.preventDefault();
}
}

get isOpened() {
Expand All @@ -63,8 +57,11 @@ class MobileNavManager {

document.addEventListener('DOMContentLoaded', () => {
new MobileNavManager();
ScrollTo.init('.scroll', {
offset: 120,
focus: false,
});
});

$('.nav__item .nav__anchor').click(function() {
var offset = $($(this).attr('href')).offset()
$('body').stop().animate({
'scrollTop': offset.top - $('.header__nav').height()
}, 900);
})
});