mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-25 12:17:22 +00:00
Ensure bird doesn't fly up too far
This commit is contained in:
8
dist/birb.js
vendored
8
dist/birb.js
vendored
@@ -1675,7 +1675,7 @@
|
|||||||
insertModal(`${birdBirb()} Mode`, message);
|
insertModal(`${birdBirb()} Mode`, message);
|
||||||
}),
|
}),
|
||||||
new Separator(),
|
new Separator(),
|
||||||
new MenuItem("2025.10.28.165", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.10.28.165"); }, false),
|
new MenuItem("2025.10.29.2", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.10.29.2"); }, false),
|
||||||
];
|
];
|
||||||
|
|
||||||
const styleElement = document.createElement("style");
|
const styleElement = document.createElement("style");
|
||||||
@@ -2000,6 +2000,12 @@
|
|||||||
birb.setAnimation(Animations.STILL);
|
birb.setAnimation(Animations.STILL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clamp startY, birdY, targetY to a bit above the top of the window
|
||||||
|
const maxY = getWindowHeight() * 1.5;
|
||||||
|
startY = Math.min(startY, maxY);
|
||||||
|
birdY = Math.min(birdY, maxY);
|
||||||
|
targetY = Math.min(targetY, maxY);
|
||||||
|
|
||||||
// Update HTML element position
|
// Update HTML element position
|
||||||
birb.setX(birdX);
|
birb.setX(birdX);
|
||||||
birb.setY(birdY);
|
birb.setY(birdY);
|
||||||
|
|||||||
10
dist/birb.user.js
vendored
10
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.28.165
|
// @version 2025.10.29.2
|
||||||
// @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
|
||||||
@@ -1689,7 +1689,7 @@
|
|||||||
insertModal(`${birdBirb()} Mode`, message);
|
insertModal(`${birdBirb()} Mode`, message);
|
||||||
}),
|
}),
|
||||||
new Separator(),
|
new Separator(),
|
||||||
new MenuItem("2025.10.28.165", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.10.28.165"); }, false),
|
new MenuItem("2025.10.29.2", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.10.29.2"); }, false),
|
||||||
];
|
];
|
||||||
|
|
||||||
const styleElement = document.createElement("style");
|
const styleElement = document.createElement("style");
|
||||||
@@ -2014,6 +2014,12 @@
|
|||||||
birb.setAnimation(Animations.STILL);
|
birb.setAnimation(Animations.STILL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clamp startY, birdY, targetY to a bit above the top of the window
|
||||||
|
const maxY = getWindowHeight() * 1.5;
|
||||||
|
startY = Math.min(startY, maxY);
|
||||||
|
birdY = Math.min(birdY, maxY);
|
||||||
|
targetY = Math.min(targetY, maxY);
|
||||||
|
|
||||||
// Update HTML element position
|
// Update HTML element position
|
||||||
birb.setX(birdX);
|
birb.setX(birdX);
|
||||||
birb.setY(birdY);
|
birb.setY(birdY);
|
||||||
|
|||||||
@@ -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.28.165",
|
"version": "2025.10.29.2",
|
||||||
"homepage_url": "https://idreesinc.com",
|
"homepage_url": "https://idreesinc.com",
|
||||||
"icons": {
|
"icons": {
|
||||||
"48": "images/icons/transparent/48x48x1.png",
|
"48": "images/icons/transparent/48x48x1.png",
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#spacer {
|
#spacer {
|
||||||
height: 100vh;
|
height: 300vh;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -552,6 +552,12 @@ Promise.all([
|
|||||||
birb.setAnimation(Animations.STILL);
|
birb.setAnimation(Animations.STILL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clamp startY, birdY, targetY to a bit above the top of the window
|
||||||
|
const maxY = getWindowHeight() * 1.5;
|
||||||
|
startY = Math.min(startY, maxY);
|
||||||
|
birdY = Math.min(birdY, maxY);
|
||||||
|
targetY = Math.min(targetY, maxY);
|
||||||
|
|
||||||
// Update HTML element position
|
// Update HTML element position
|
||||||
birb.setX(birdX);
|
birb.setX(birdX);
|
||||||
birb.setY(birdY);
|
birb.setY(birdY);
|
||||||
|
|||||||
Reference in New Issue
Block a user