added scroll to top buttons

This commit is contained in:
Jack 2020-08-30 03:55:23 +01:00
parent 4ebd60b25b
commit 918567f348
3 changed files with 30 additions and 0 deletions

View file

@ -2438,6 +2438,26 @@ key {
}
}
.scrollToTopButton {
bottom: 2rem;
right: 2rem;
position: fixed;
font-size: 2rem;
width: 4rem;
height: 4rem;
text-align: center;
line-height: 4rem;
background: var(--bg-color);
border-radius: 99rem;
z-index: 99;
cursor: pointer;
color: var(--sub-color);
transition: 0.25s;
&:hover {
color: var(--main-color);
}
}
@media only screen and (max-width: 1000px) {
#centerContent {
.pageSettings .section.themes .buttons,

View file

@ -1343,6 +1343,9 @@
</div>
</div>
<div class="page pageSettings hidden">
<div class="scrollToTopButton">
<i class="fas fa-angle-double-up"></i>
</div>
<div class="tip">
tip: You can also change all these settings quickly using the
command line (
@ -2272,6 +2275,9 @@
</div>
<div class="page pageAccount hidden">
<div class="scrollToTopButton">
<i class="fas fa-angle-double-up"></i>
</div>
<div class="preloader">
<i class="fas fa-fw fa-spin fa-circle-notch"></i>
</div>

View file

@ -4017,6 +4017,10 @@ $(document).ready(() => {
});
});
$(".scrollToTopButton").click((event) => {
window.scrollTo(0, 0);
});
let ctx = $("#wpmChart");
let wpmOverTimeChart = new Chart(ctx, {
type: "line",