diff --git a/dist/birb.js b/dist/birb.js index 006e304..3c7b178 100644 --- a/dist/birb.js +++ b/dist/birb.js @@ -1397,8 +1397,9 @@ } .birb-field-guide-description { - width: calc(100% - 20px); + max-width: calc(100% - 20px); margin-left: 10px; + margin-right: 10px; margin-top: 5px; padding: 8px; padding-top: 4px; @@ -1605,7 +1606,7 @@ insertModal(`${birdBirb()} Mode`, message); }), 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"); @@ -2273,7 +2274,12 @@ if (largeElements.length === 0) { 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; log("Focusing on element: ", focusedElement); updateFocusedElementBounds(); diff --git a/dist/birb.user.js b/dist/birb.user.js index 3c83971..920c3ee 100644 --- a/dist/birb.user.js +++ b/dist/birb.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Pocket Bird // @namespace https://idreesinc.com -// @version 2025.10.26.538 +// @version 2025.10.26.552 // @description birb // @author Idrees // @downloadURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/birb.user.js @@ -1411,8 +1411,9 @@ } .birb-field-guide-description { - width: calc(100% - 20px); + max-width: calc(100% - 20px); margin-left: 10px; + margin-right: 10px; margin-top: 5px; padding: 8px; padding-top: 4px; @@ -1619,7 +1620,7 @@ insertModal(`${birdBirb()} Mode`, message); }), 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"); @@ -2287,7 +2288,12 @@ if (largeElements.length === 0) { 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; log("Focusing on element: ", focusedElement); updateFocusedElementBounds(); diff --git a/manifest.json b/manifest.json index a942156..a8609f7 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "Pocket Bird", "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", "content_scripts": [ { diff --git a/src/application.js b/src/application.js index bdad04f..552b7df 100644 --- a/src/application.js +++ b/src/application.js @@ -897,7 +897,12 @@ Promise.all([ if (largeElements.length === 0) { 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; log("Focusing on element: ", focusedElement); updateFocusedElementBounds(); diff --git a/src/stylesheet.css b/src/stylesheet.css index 024e415..0d4811a 100644 --- a/src/stylesheet.css +++ b/src/stylesheet.css @@ -288,8 +288,9 @@ } .birb-field-guide-description { - width: calc(100% - 20px); + max-width: calc(100% - 20px); margin-left: 10px; + margin-right: 10px; margin-top: 5px; padding: 8px; padding-top: 4px;