mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-25 12:17:22 +00:00
Don't let the bird land on sticky things
This commit is contained in:
12
dist/birb.js
vendored
12
dist/birb.js
vendored
@@ -1397,8 +1397,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.birb-field-guide-description {
|
.birb-field-guide-description {
|
||||||
width: calc(100% - 20px);
|
max-width: calc(100% - 20px);
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
padding-top: 4px;
|
padding-top: 4px;
|
||||||
@@ -1605,7 +1606,7 @@
|
|||||||
insertModal(`${birdBirb()} Mode`, message);
|
insertModal(`${birdBirb()} Mode`, message);
|
||||||
}),
|
}),
|
||||||
new Separator(),
|
new Separator(),
|
||||||
new MenuItem("2025.10.26.538", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.10.26.538"); }, false),
|
new MenuItem("2025.10.26.552", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.10.26.552"); }, false),
|
||||||
];
|
];
|
||||||
|
|
||||||
const styleElement = document.createElement("style");
|
const styleElement = document.createElement("style");
|
||||||
@@ -2273,7 +2274,12 @@
|
|||||||
if (largeElements.length === 0) {
|
if (largeElements.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const randomElement = largeElements[Math.floor(Math.random() * largeElements.length)];
|
// Ensure the bird doesn't land on fixed or sticky elements
|
||||||
|
const nonFixedElements = largeElements.filter((el) => {
|
||||||
|
const style = window.getComputedStyle(el);
|
||||||
|
return style.position !== "fixed" && style.position !== "sticky";
|
||||||
|
});
|
||||||
|
const randomElement = nonFixedElements[Math.floor(Math.random() * nonFixedElements.length)];
|
||||||
focusedElement = randomElement;
|
focusedElement = randomElement;
|
||||||
log("Focusing on element: ", focusedElement);
|
log("Focusing on element: ", focusedElement);
|
||||||
updateFocusedElementBounds();
|
updateFocusedElementBounds();
|
||||||
|
|||||||
14
dist/birb.user.js
vendored
14
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.538
|
// @version 2025.10.26.552
|
||||||
// @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
|
||||||
@@ -1411,8 +1411,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.birb-field-guide-description {
|
.birb-field-guide-description {
|
||||||
width: calc(100% - 20px);
|
max-width: calc(100% - 20px);
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
padding-top: 4px;
|
padding-top: 4px;
|
||||||
@@ -1619,7 +1620,7 @@
|
|||||||
insertModal(`${birdBirb()} Mode`, message);
|
insertModal(`${birdBirb()} Mode`, message);
|
||||||
}),
|
}),
|
||||||
new Separator(),
|
new Separator(),
|
||||||
new MenuItem("2025.10.26.538", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.10.26.538"); }, false),
|
new MenuItem("2025.10.26.552", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.10.26.552"); }, false),
|
||||||
];
|
];
|
||||||
|
|
||||||
const styleElement = document.createElement("style");
|
const styleElement = document.createElement("style");
|
||||||
@@ -2287,7 +2288,12 @@
|
|||||||
if (largeElements.length === 0) {
|
if (largeElements.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const randomElement = largeElements[Math.floor(Math.random() * largeElements.length)];
|
// Ensure the bird doesn't land on fixed or sticky elements
|
||||||
|
const nonFixedElements = largeElements.filter((el) => {
|
||||||
|
const style = window.getComputedStyle(el);
|
||||||
|
return style.position !== "fixed" && style.position !== "sticky";
|
||||||
|
});
|
||||||
|
const randomElement = nonFixedElements[Math.floor(Math.random() * nonFixedElements.length)];
|
||||||
focusedElement = randomElement;
|
focusedElement = randomElement;
|
||||||
log("Focusing on element: ", focusedElement);
|
log("Focusing on element: ", focusedElement);
|
||||||
updateFocusedElementBounds();
|
updateFocusedElementBounds();
|
||||||
|
|||||||
@@ -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.538",
|
"version": "2025.10.26.552",
|
||||||
"homepage_url": "https://idreesinc.com",
|
"homepage_url": "https://idreesinc.com",
|
||||||
"content_scripts": [
|
"content_scripts": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -897,7 +897,12 @@ Promise.all([
|
|||||||
if (largeElements.length === 0) {
|
if (largeElements.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const randomElement = largeElements[Math.floor(Math.random() * largeElements.length)];
|
// Ensure the bird doesn't land on fixed or sticky elements
|
||||||
|
const nonFixedElements = largeElements.filter((el) => {
|
||||||
|
const style = window.getComputedStyle(el);
|
||||||
|
return style.position !== "fixed" && style.position !== "sticky";
|
||||||
|
});
|
||||||
|
const randomElement = nonFixedElements[Math.floor(Math.random() * nonFixedElements.length)];
|
||||||
focusedElement = randomElement;
|
focusedElement = randomElement;
|
||||||
log("Focusing on element: ", focusedElement);
|
log("Focusing on element: ", focusedElement);
|
||||||
updateFocusedElementBounds();
|
updateFocusedElementBounds();
|
||||||
|
|||||||
@@ -288,8 +288,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.birb-field-guide-description {
|
.birb-field-guide-description {
|
||||||
width: calc(100% - 20px);
|
max-width: calc(100% - 20px);
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
padding-top: 4px;
|
padding-top: 4px;
|
||||||
|
|||||||
Reference in New Issue
Block a user