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

github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/assets/js
diff options
context:
space:
mode:
authorHanzei <hanzei@mailbox.org>2018-07-13 11:55:02 +0300
committerHanzei <hanzei@mailbox.org>2018-07-13 11:55:02 +0300
commit986d2493916ea31b492f220e743361bca6c3d737 (patch)
tree6d4d76dcb673905825443b003bea783cf6a07b45 /assets/js
parentf5c0d492d3f7c7e4c1139cda12128ab9deae8eeb (diff)
Bundle assets
Update dependencies
Diffstat (limited to 'assets/js')
-rw-r--r--assets/js/index.js31
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 }}