Add scripts to build and watch files

This commit is contained in:
Lucas Larroche 2021-09-12 10:58:05 +07:00
parent 2986278b15
commit 8e028956e9
23 changed files with 13439 additions and 1660 deletions

View file

@ -11,7 +11,6 @@
export const scrollspy = {
// Config
mostVisible: null,
minWidth: '992px',
interval: 75,
targets: {
@ -22,10 +21,7 @@ export const scrollspy = {
// Init
init(mostVisible) {
if (this.mostVisible == null) {
this.mostVisible = mostVisible;
}
init() {
if (window.matchMedia('(min-width: ' + this.minWidth + ')').matches) {
this.setActiveNav();
this.scrollStop();
@ -37,7 +33,7 @@ export const scrollspy = {
setActiveNav() {
// Get active section
let currentSection = this.mostVisible(this.targets.sections).getAttribute('id');
let currentSection = mostVisible(this.targets.sections).getAttribute('id');
// Remove all active states
let links = document.querySelectorAll(this.targets.nav + ' a.' + this.targets.active);