Welcome to mirror list, hosted at ThFree Co, Russian Federation.

index.js « js « assets - github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 03ab42757de31af823283df5ff06e59a5eb35887 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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 and .Site.Params.localTime .Page.IsHome }}
$(document).ready(function() {
    var time = moment().tz("{{ .Site.Params.timeZone }}").format("h:mm A");
    $('#time').html(time);
})
{{ end }}