Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function swupInit() {
// currently these are run by css only. Must add js-plugin for more advanced transitions
const swup = new Swup({
plugins: [new SwupPreloadPlugin(), new SwupGaPlugin()],
});
swup.on('contentReplaced', () => {
// insert any scripts here that break after page transitions or use the Head plugin from Swup
init();
});
}
}
)
if (!navActivated) {
const button = event.currentTarget
toggleMenuIcon(button)
navActivated = true;
setTimeout(() => { toggleMenuIcon(button); navActivated = false }, 6000)
}
})
} else {
mainEl = "#swup"
containers = [mainEl, "#topnav"]
}
if(!window.matchMedia('(prefers-reduced-motion)').matches) {
const swup = new Swup({
containers: containers,
plugins: [
new SwupSlideTheme({mainElement: mainEl}),
new SwupBodyClassPlugin(),
new SwupScrollPlugin({animateScroll: false})
],
})
swup.on('contentReplaced', function() {
addHeadingAnchors()
})
}
addHeadingAnchors()
})