Skip to content

Commit

Permalink
make home button jump to top instead of reload
Browse files Browse the repository at this point in the history
  • Loading branch information
dimdenGD committed Sep 25, 2023
1 parent 3f9d0ce commit cc082bc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions layouts/home/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,12 @@ setTimeout(async () => {
appendTweet(tweet, document.getElementById('timeline'), { prepend: true, bigFont: tweet.full_text.length < 75 });
setTimeout(fixTweetThreadLine, 100);
});
document.getElementById('home').addEventListener('click', e => {
if(document.documentElement.scrollTop > 500) {
e.preventDefault();
window.scrollTo(0, 0);
}
});

if(location.hash === "#dm") {
setTimeout(() => {
Expand Down

0 comments on commit cc082bc

Please sign in to comment.