hugo-theme-introduction/assets/js/index.js

32 lines
860 B
JavaScript
Raw Normal View History

2018-07-01 08:09:29 +00:00
// 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 () {
2018-07-01 11:08:26 +00:00
$($(this).attr('data-target')).addClass('is-active');
$("html").addClass("modal-open");
2018-07-01 08:09:29 +00:00
});
$('.modal-close').click(function () {
2018-07-01 11:08:26 +00:00
$($(this).attr('data-target')).removeClass('is-active');
$("html").removeClass("modal-open");
2018-07-01 08:09:29 +00:00
});
$(document).keypress(function(e) {
if(e.which == 0) {
$('.modal.is-active').removeClass('is-active');
}
});
2018-07-13 08:55:02 +00:00
2018-07-13 09:19:48 +00:00
{{ if and .Site.Params.localTime .Page.IsHome }}
2018-07-13 08:55:02 +00:00
$(document).ready(function() {
var time = moment().tz("{{ .Site.Params.timeZone }}").format("h:mm A");
$('#time').html(time);
})
{{ end }}