Adding Skeleventy-based site sources.
This commit is contained in:
parent
ac7f2e6002
commit
28a89401ff
79 changed files with 2183 additions and 0 deletions
27
sources/resources/js/modules/mobile-nav/index.js
Normal file
27
sources/resources/js/modules/mobile-nav/index.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import $$ from '@utilities/selectors'
|
||||
|
||||
const MobileNav = function MobileNav()
|
||||
{
|
||||
|
||||
$$.mobileNavToggle.addEventListener('click', function() {
|
||||
|
||||
this.classList.toggle('expanded')
|
||||
$$.mobileNav.classList.toggle('menu-visible')
|
||||
|
||||
// set aria-expanded attribute on menu toggle button
|
||||
if ( this.getAttribute('aria-expanded') === 'false' )
|
||||
{
|
||||
|
||||
this.setAttribute('aria-expanded', 'true')
|
||||
|
||||
} else {
|
||||
|
||||
this.setAttribute('aria-expanded', 'false')
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}()
|
||||
|
||||
export default MobileNav
|
||||
Loading…
Reference in a new issue