diff --git a/src/app.js b/src/app.js index 0f53159..a61d1b1 100644 --- a/src/app.js +++ b/src/app.js @@ -1,15 +1,3 @@ import './app.scss' -import $ from 'jquery/dist/jquery' -import 'bootstrap/js/dist/util' -import 'bootstrap/js/dist/scrollspy' import './clipboard' - -$(() => { - $('#nav-anchors').find('a.nav-link').click(function () { - const $dest = $($(this).attr('href')) - $('html, body').animate({ - scrollTop: $dest.offset().top - 72 - }, 500) - return false - }) -}) +import './navbar' diff --git a/src/navbar.js b/src/navbar.js new file mode 100644 index 0000000..d53b3fd --- /dev/null +++ b/src/navbar.js @@ -0,0 +1,13 @@ +import $ from 'jquery/dist/jquery' +import 'bootstrap/js/dist/util' +import 'bootstrap/js/dist/scrollspy' + +$(() => { + $('#nav-anchors').find('a.nav-link').click(function () { + const $dest = $($(this).attr('href')) + $('html, body').animate({ + scrollTop: $dest.offset().top - 72 + }, 500) + return false + }) +})