diff --git a/_assets/css/main.css.scss b/_assets/css/main.css.scss index fada8b7..947b679 100644 --- a/_assets/css/main.css.scss +++ b/_assets/css/main.css.scss @@ -10,6 +10,14 @@ border-bottom: 2px solid $light; } +#back-to-top { + cursor: pointer; + position: fixed; + bottom: 20px; + right: 20px; + display:none; +} + $navbarHeight: 58px; .large { diff --git a/_assets/js/main.js b/_assets/js/main.js index 1026b98..f52890b 100644 --- a/_assets/js/main.js +++ b/_assets/js/main.js @@ -11,4 +11,22 @@ $(function() { mainMenu.on('hidden.bs.collapse', function (e) { $('#submenuNavbar').removeClass('invisible'); }); + + let backToTop = $('#back-to-top'); + $(window).scroll(function () { + if ($(this).scrollTop() > 50) { + backToTop.fadeIn(); + } else { + backToTop.fadeOut(); + } + }); + backToTop.click(function() { + backToTop.tooltip('hide'); + $('body,html').animate({ + scrollTop: 0 + }, 800); + return false; + }); + + backToTop.tooltip(); }); \ No newline at end of file diff --git a/_layouts/default.html b/_layouts/default.html index 8137dc3..2fbd948 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -33,6 +33,11 @@ + {% include footer.html %} diff --git a/pages/about.html b/pages/about.html index dc6d5a7..68a3adf 100644 --- a/pages/about.html +++ b/pages/about.html @@ -24,7 +24,8 @@ description: Here you can find meta information about this website.
  • (Almost) no javascript: This site uses almost no javascript. Javascript is only used to make the menus responsive, to replace the - Font Awesome span elements with svg elements and to load images on demand to make site loading faster. + Font Awesome span elements with svg elements, to offer a "back-to-top" button and to load images on demand to + make site loading faster.
  • (Almost) no external requests: To protect your privacy as good as possible, the amount of external requests is as low as possible. External