Skip to content

Commit

Permalink
Update static.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KAKXER committed Apr 28, 2024
1 parent e66484e commit 98c5a0a
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion scripts/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ function fetchData(url) {
});
}

function checkWindowSize() {
if ($(window).height() > 446) {
$(".loading-page").css("opacity", 0);
$(".container").css("opacity", 1);
} else {
$(".loading-page").css("opacity", 1);
$(".container").css("opacity", 0);
}
}

let AppendData = 0
function RequestLoadPage() {
fetchData('https://api.lanyard.rest/v1/users/543465365057961986').then(user => {
Expand Down Expand Up @@ -61,6 +71,15 @@ function RequestLoadPage() {
$(".container").css("opacity", 0);
}, 250);
});

$(window).on('offline', function () {
setTimeout(() => {
$(".loading-page").css("opacity", 1);
$(".container").css("opacity", 0);
}, 250);
});

window.onresize = checkWindowSize;
}

$(".loading-page").css("opacity", 0);
Expand All @@ -72,5 +91,6 @@ function RequestLoadPage() {
}

$(document).ready(function() {
RequestLoadPage()
RequestLoadPage();

});

0 comments on commit 98c5a0a

Please sign in to comment.