mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-09 21:51:29 +08:00
converted to ts
This commit is contained in:
parent
2ab2c3530c
commit
116551de16
1 changed files with 4 additions and 4 deletions
|
|
@ -2,15 +2,15 @@ import * as ActivePage from "../states/active-page";
|
|||
|
||||
let visible = false;
|
||||
|
||||
$(".scrollToTopButton").click((event) => {
|
||||
$(".scrollToTopButton").click(() => {
|
||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||
});
|
||||
|
||||
$(window).scroll((e) => {
|
||||
let page = ActivePage.get();
|
||||
$(window).scroll(() => {
|
||||
const page = ActivePage.get();
|
||||
if (page == "test") return;
|
||||
if (page == "about" || page == "settings" || page == "account") {
|
||||
let scroll = window.scrollY;
|
||||
const scroll = window.scrollY;
|
||||
if (!visible && scroll > 100) {
|
||||
$(".scrollToTopButton").removeClass("invisible");
|
||||
visible = true;
|
||||
Loading…
Add table
Reference in a new issue