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);
|
insertModal(`${birdBirb()} Mode`, message);
|
||||||
}),
|
}),
|
||||||
new Separator(),
|
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");
|
const styleElement = document.createElement("style");
|
||||||
@@ -2263,7 +2263,7 @@
|
|||||||
if (frozen) {
|
if (frozen) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const elements = document.querySelectorAll("img, video");
|
const elements = document.querySelectorAll("img, video, .birb-sticky-note");
|
||||||
const inWindow = Array.from(elements).filter((img) => {
|
const inWindow = Array.from(elements).filter((img) => {
|
||||||
const rect = img.getBoundingClientRect();
|
const rect = img.getBoundingClientRect();
|
||||||
return rect.left >= 0 && rect.top >= MIN_FOCUS_ELEMENT_TOP && rect.right <= window.innerWidth && rect.top <= window.innerHeight;
|
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() };
|
focusedBounds = { left: 0, right: window.innerWidth, top: getFullWindowHeight() };
|
||||||
return;
|
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 };
|
focusedBounds = { left, right, top };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
11
dist/birb.user.js
vendored
11
dist/birb.user.js
vendored
@@ -1,7 +1,7 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Pocket Bird
|
// @name Pocket Bird
|
||||||
// @namespace https://idreesinc.com
|
// @namespace https://idreesinc.com
|
||||||
// @version 2025.10.26.552
|
// @version 2025.10.26.568
|
||||||
// @description birb
|
// @description birb
|
||||||
// @author Idrees
|
// @author Idrees
|
||||||
// @downloadURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/birb.user.js
|
// @downloadURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/birb.user.js
|
||||||
@@ -1620,7 +1620,7 @@
|
|||||||
insertModal(`${birdBirb()} Mode`, message);
|
insertModal(`${birdBirb()} Mode`, message);
|
||||||
}),
|
}),
|
||||||
new Separator(),
|
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");
|
const styleElement = document.createElement("style");
|
||||||
@@ -2277,7 +2277,7 @@
|
|||||||
if (frozen) {
|
if (frozen) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const elements = document.querySelectorAll("img, video");
|
const elements = document.querySelectorAll("img, video, .birb-sticky-note");
|
||||||
const inWindow = Array.from(elements).filter((img) => {
|
const inWindow = Array.from(elements).filter((img) => {
|
||||||
const rect = img.getBoundingClientRect();
|
const rect = img.getBoundingClientRect();
|
||||||
return rect.left >= 0 && rect.top >= MIN_FOCUS_ELEMENT_TOP && rect.right <= window.innerWidth && rect.top <= window.innerHeight;
|
return rect.left >= 0 && rect.top >= MIN_FOCUS_ELEMENT_TOP && rect.right <= window.innerWidth && rect.top <= window.innerHeight;
|
||||||
@@ -2306,7 +2306,10 @@
|
|||||||
focusedBounds = { left: 0, right: window.innerWidth, top: getFullWindowHeight() };
|
focusedBounds = { left: 0, right: window.innerWidth, top: getFullWindowHeight() };
|
||||||
return;
|
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 };
|
focusedBounds = { left, right, top };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "Pocket Bird",
|
"name": "Pocket Bird",
|
||||||
"description": "It's a bird, in your browser. What more could you want?",
|
"description": "It's a bird, in your browser. What more could you want?",
|
||||||
"version": "2025.10.26.552",
|
"version": "2025.10.26.568",
|
||||||
"homepage_url": "https://idreesinc.com",
|
"homepage_url": "https://idreesinc.com",
|
||||||
"content_scripts": [
|
"content_scripts": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -886,7 +886,7 @@ Promise.all([
|
|||||||
if (frozen) {
|
if (frozen) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const elements = document.querySelectorAll("img, video");
|
const elements = document.querySelectorAll("img, video, .birb-sticky-note");
|
||||||
const inWindow = Array.from(elements).filter((img) => {
|
const inWindow = Array.from(elements).filter((img) => {
|
||||||
const rect = img.getBoundingClientRect();
|
const rect = img.getBoundingClientRect();
|
||||||
return rect.left >= 0 && rect.top >= MIN_FOCUS_ELEMENT_TOP && rect.right <= window.innerWidth && rect.top <= window.innerHeight;
|
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() };
|
focusedBounds = { left: 0, right: window.innerWidth, top: getFullWindowHeight() };
|
||||||
return;
|
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 };
|
focusedBounds = { left, right, top };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user