Allow bird to land on sticky notes

This commit is contained in:
Idrees Hassan
2025-10-26 23:42:50 -04:00
parent 0d1e63888d
commit d36e90dfc7
4 changed files with 19 additions and 10 deletions

View File

@@ -886,7 +886,7 @@ Promise.all([
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;
@@ -915,7 +915,10 @@ Promise.all([
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 };
}