mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-24 19:59:36 +00:00
Don't let the bird land on sticky things
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user