Skip to content

Commit

Permalink
Update searchJumper.user.js
Browse files Browse the repository at this point in the history
  • Loading branch information
hoothin committed Jul 21, 2024
1 parent 14898a0 commit f12551c
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions searchJumper.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3481,7 +3481,7 @@
position: absolute;
min-height: 10px;
min-width: 10px;
animation-duration: 3s;
animation-duration: 2s;
z-index: 2147483647;
margin: 0;
opacity: 0;
Expand All @@ -3498,8 +3498,9 @@
position: fixed;
}
@keyframes fadeit {
from {opacity: 1;}
to {opacity: 0;}
0% {opacity: 1;}
50% {opacity: 0.8;}
100% {opacity: 0;}
}
#rightSizeChange {
top: 0;
Expand Down Expand Up @@ -5232,11 +5233,18 @@
setTimeout(async () => {
ele.scrollIntoView({behavior: "smooth", block: "center", inline: "nearest"});
ele.dataset.current = true;
this.wPosBar.style.animationName = "fadeit";
this.hPosBar.style.animationName = "fadeit";
let fixTimes = 0;
self.wPosBar.style.animationName = "fadeit";
self.hPosBar.style.animationName = "fadeit";
self.fixTimes = 0;
function fixPosBar() {
if (self.focusMark != ele || ++fixTimes > 10) return;
if (self.focusMark != ele) return;
if (++self.fixTimes == 5) {
ele.scrollIntoView({behavior: "smooth", block: "center", inline: "nearest"});
} else if (self.fixTimes > 10) {
self.wPosBar.style.animationName = "";
self.hPosBar.style.animationName = "";
return;
}
let rect = ele.getBoundingClientRect();
self.wPosBar.style.top = rect.top + document.documentElement.scrollTop + getBody(document).scrollTop + "px";
self.hPosBar.style.left = rect.left + "px";
Expand Down Expand Up @@ -16707,6 +16715,7 @@

var waiting = false;
function visibilitychangeHandler() {
if (!document.head || !getBody(document)) return;
if (searchData.prefConfig.globalSearchNow) {
clearInterval(checkGlobalIntv);
clearInterval(flashTitleIntv);
Expand Down

0 comments on commit f12551c

Please sign in to comment.