Adding scroll bar

This commit is contained in:
2020-06-08 15:24:21 +01:00
parent 3bc840e3c2
commit bb38781731
6 changed files with 28 additions and 4 deletions

View File

@@ -104,4 +104,15 @@ export default {
var AOS = require("aos");
AOS.init({ duration: 1000, once: false, useClassNames: true });
},
scrollBar: () => {
$(window).on("load scroll resize", function () {
let top = $(window).scrollTop();
let height = $(document).height();
let windowheight = $(window).height();
let width = (top / (height - windowheight)) * 100;
$("#line-scroll").css({
width: width + "%",
});
});
},
};

View File

@@ -8,6 +8,7 @@ window.addEventListener("DOMContentLoaded", async (event) => {
App.bootstrapify();
App.lazyload();
App.loadFontAwesome();
App.navbarFade();
// App.navbarFade();
App.aos();
App.scrollBar();
});

9
src/scss/scroll-bar.scss Normal file
View File

@@ -0,0 +1,9 @@
.line-scroll {
background-image: linear-gradient(90deg, rgba(238,136,5,1) 0%, rgba(191,48,48,1) 41%, rgba(209,28,28,1) 100%);
height: 5px;
left: 0;
top: 63px;
position: fixed;
width: 0;
z-index: 10;
}

View File

@@ -6,4 +6,5 @@
@import "search";
@import "search-bar";
@import "toc";
@import "scroll-bar";
@import "fonts";