Sha256: 9f410915ecfc9704aed6e810626818e3086c3945e13370c3f9acdc4df04b8152

Contents?: true

Size: 1.74 KB

Versions: 8

Compression:

Stored size: 1.74 KB

Contents

document.addEventListener('DOMContentLoaded', () => {

  // Get all "navbar-burger" elements
  const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);

  // Check if there are any navbar burgers
  if ($navbarBurgers.length > 0) {

    // Add a click event on each of them
    $navbarBurgers.forEach( el => {
      el.addEventListener('click', () => {

        // Get the target from the "data-target" attribute
        const target = el.dataset.target;
        const $target = document.getElementById(target);

        // Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu"
        el.classList.toggle('is-active');
        $target.classList.toggle('is-active');

      });
    });
  }

});

document.addEventListener('DOMContentLoaded', function() {
	let cardToggles = document.getElementsByClassName('card-toggle');
	for (let i = 0; i < cardToggles.length; i++) {
		cardToggles[i].addEventListener('click', e => {
			e.currentTarget.parentElement.parentElement.childNodes[3].classList.toggle('is-hidden');
		});
	}
});

document.addEventListener('DOMContentLoaded', function() {
	let cardToggles = document.getElementsByClassName('expertise-toggle');
	for (let i = 0; i < cardToggles.length; i++) {
		cardToggles[i].addEventListener('click', e => {
			e.currentTarget.parentElement.querySelector(".peoples").classList.toggle('is-hidden');
		});
	}
});

document.addEventListener('DOMContentLoaded', function() {
	let cardToggles = document.getElementsByClassName('expertise-detail-toggle');
	for (let i = 0; i < cardToggles.length; i++) {
		cardToggles[i].addEventListener('click', e => {
			e.currentTarget.parentElement.parentElement.querySelector(".expertise-detail").classList.toggle('is-hidden');
		});
	}
});

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ols-theme-0.8.0 assets/js/scripts.js
ols-theme-0.7.0 assets/js/scripts.js
ols-theme-0.6.0 assets/js/scripts.js
ols-theme-0.5.0 assets/js/scripts.js
ols-theme-0.4.0 assets/js/scripts.js
ols-theme-0.3.0 assets/js/scripts.js
ols-theme-0.2.0 assets/js/scripts.js
ols-theme-0.1.0 assets/js/scripts.js