diff options
author | Hanzei <hanzei@mailbox.org> | 2018-07-13 11:55:02 +0300 |
---|---|---|
committer | Hanzei <hanzei@mailbox.org> | 2018-07-13 11:55:02 +0300 |
commit | 986d2493916ea31b492f220e743361bca6c3d737 (patch) | |
tree | 6d4d76dcb673905825443b003bea783cf6a07b45 /assets/js | |
parent | f5c0d492d3f7c7e4c1139cda12128ab9deae8eeb (diff) |
Bundle assets
Update dependencies
Diffstat (limited to 'assets/js')
-rw-r--r-- | assets/js/index.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/assets/js/index.js b/assets/js/index.js new file mode 100644 index 0000000..d73b3a3 --- /dev/null +++ b/assets/js/index.js @@ -0,0 +1,31 @@ +// Bitty scrolling links script +$('a[href^="#"]').click(function(e) { + e.preventDefault(); + $('html, body').animate({ + scrollTop: $(this.hash).offset().top + }, 500); + $("#nav-menu").removeClass("is-active"); + return true; +}) + +// Modal closer +$('.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'); + } +}); + +{{ if .Site.Params.localTime }} +$(document).ready(function() { + var time = moment().tz("{{ .Site.Params.timeZone }}").format("h:mm A"); + $('#time').html(time); +}) +{{ end }} |