From cc082bca0c1b98e695f96dbbf21675ed00b01974 Mon Sep 17 00:00:00 2001 From: dimden Date: Mon, 25 Sep 2023 21:58:48 +0300 Subject: [PATCH] make home button jump to top instead of reload --- layouts/home/script.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/layouts/home/script.js b/layouts/home/script.js index 5466d0a1..1b894cd2 100644 --- a/layouts/home/script.js +++ b/layouts/home/script.js @@ -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(() => {