mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-25 04:07:23 +00:00
Allow bird to land on sticky notes
This commit is contained in:
9
dist/birb.js
vendored
9
dist/birb.js
vendored
@@ -1606,7 +1606,7 @@
|
||||
insertModal(`${birdBirb()} Mode`, message);
|
||||
}),
|
||||
new Separator(),
|
||||
new MenuItem("2025.10.26.552", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.10.26.552"); }, false),
|
||||
new MenuItem("2025.10.26.568", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.10.26.568"); }, false),
|
||||
];
|
||||
|
||||
const styleElement = document.createElement("style");
|
||||
@@ -2263,7 +2263,7 @@
|
||||
if (frozen) {
|
||||
return;
|
||||
}
|
||||
const elements = document.querySelectorAll("img, video");
|
||||
const elements = document.querySelectorAll("img, video, .birb-sticky-note");
|
||||
const inWindow = Array.from(elements).filter((img) => {
|
||||
const rect = img.getBoundingClientRect();
|
||||
return rect.left >= 0 && rect.top >= MIN_FOCUS_ELEMENT_TOP && rect.right <= window.innerWidth && rect.top <= window.innerHeight;
|
||||
@@ -2292,7 +2292,10 @@
|
||||
focusedBounds = { left: 0, right: window.innerWidth, top: getFullWindowHeight() };
|
||||
return;
|
||||
}
|
||||
const { left, right, top } = focusedElement.getBoundingClientRect();
|
||||
let { left, right, top } = focusedElement.getBoundingClientRect();
|
||||
if (focusedElement.classList.contains("birb-sticky-note")) {
|
||||
top -= 4 * UI_CSS_SCALE;
|
||||
}
|
||||
focusedBounds = { left, right, top };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user