mirror of
https://git.adityakumar.xyz/hugo-theme-introduction.git
synced 2024-12-23 15:12:53 +00:00
2 lines
971 B
JavaScript
2 lines
971 B
JavaScript
|
document.addEventListener("DOMContentLoaded",function(){var $navbarBurgers=Array.prototype.slice.call(document.querySelectorAll(".navbar-burger"),0);if($navbarBurgers.length>0){$navbarBurgers.forEach(function($el){$el.addEventListener("click",function(){var target=$el.dataset.target;var $target=document.getElementById(target);$el.classList.toggle("is-active");$target.classList.toggle("is-active");});});}});$("a[href^=\"#\"]").click(function(e){e.preventDefault();$("html, body").animate({scrollTop:$(this.hash).offset().top},500);$("#nav-menu").removeClass("is-active");return true;})
|
||
|
$(".card").click(function(){$($(this).attr("data-target")).addClass("is-active");$("html").addClass("modal-open");});$(".modal-close").click(function(){$($(this).attr("data-target")).removeClass("is-active");$("html").removeClass("modal-open");});$(document).keypress(function(e){if(e.which==0){$(".modal.is-active").removeClass("is-active");$("html").removeClass("modal-open");}});
|