mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-25 19:59:38 +00:00
Hide birb on fullscreen sites
This commit is contained in:
7
birb.js
7
birb.js
@@ -994,6 +994,13 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI
|
|||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
ticks++;
|
ticks++;
|
||||||
|
|
||||||
|
// Hide bird if the browser is fullscreen
|
||||||
|
if (document.fullscreenElement) {
|
||||||
|
hideBirb();
|
||||||
|
// Won't be restored on fullscreen exit
|
||||||
|
}
|
||||||
|
|
||||||
if (currentState === States.IDLE) {
|
if (currentState === States.IDLE) {
|
||||||
if (Math.random() < 1 / (60 * 3) && currentAnimation !== Animations.HEART && !isMenuOpen()) {
|
if (Math.random() < 1 / (60 * 3) && currentAnimation !== Animations.HEART && !isMenuOpen()) {
|
||||||
hop();
|
hop();
|
||||||
|
|||||||
2
build.js
2
build.js
@@ -24,7 +24,7 @@ const userScriptHeader =
|
|||||||
`// ==UserScript==
|
`// ==UserScript==
|
||||||
// @name Browser Bird
|
// @name Browser Bird
|
||||||
// @namespace https://idreesinc.com
|
// @namespace https://idreesinc.com
|
||||||
// @version 2025-09-09-01
|
// @version 2025-09-10-01
|
||||||
// @description birb
|
// @description birb
|
||||||
// @author Idrees
|
// @author Idrees
|
||||||
// @downloadURL https://github.com/IdreesInc/Browser-Bird/raw/refs/heads/main/dist/birb.user.js
|
// @downloadURL https://github.com/IdreesInc/Browser-Bird/raw/refs/heads/main/dist/birb.user.js
|
||||||
|
|||||||
7
dist/birb.js
vendored
7
dist/birb.js
vendored
@@ -1309,6 +1309,13 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI
|
|||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
ticks++;
|
ticks++;
|
||||||
|
|
||||||
|
// Hide bird if the browser is fullscreen
|
||||||
|
if (document.fullscreenElement) {
|
||||||
|
hideBirb();
|
||||||
|
// Won't be restored on fullscreen exit
|
||||||
|
}
|
||||||
|
|
||||||
if (currentState === States.IDLE) {
|
if (currentState === States.IDLE) {
|
||||||
if (Math.random() < 1 / (60 * 3) && currentAnimation !== Animations.HEART && !isMenuOpen()) {
|
if (Math.random() < 1 / (60 * 3) && currentAnimation !== Animations.HEART && !isMenuOpen()) {
|
||||||
hop();
|
hop();
|
||||||
|
|||||||
9
dist/birb.user.js
vendored
9
dist/birb.user.js
vendored
@@ -1,7 +1,7 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Browser Bird
|
// @name Browser Bird
|
||||||
// @namespace https://idreesinc.com
|
// @namespace https://idreesinc.com
|
||||||
// @version 2025-09-09-01
|
// @version 2025-09-10-01
|
||||||
// @description birb
|
// @description birb
|
||||||
// @author Idrees
|
// @author Idrees
|
||||||
// @downloadURL https://github.com/IdreesInc/Browser-Bird/raw/refs/heads/main/dist/birb.user.js
|
// @downloadURL https://github.com/IdreesInc/Browser-Bird/raw/refs/heads/main/dist/birb.user.js
|
||||||
@@ -1323,6 +1323,13 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI
|
|||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
ticks++;
|
ticks++;
|
||||||
|
|
||||||
|
// Hide bird if the browser is fullscreen
|
||||||
|
if (document.fullscreenElement) {
|
||||||
|
hideBirb();
|
||||||
|
// Won't be restored on fullscreen exit
|
||||||
|
}
|
||||||
|
|
||||||
if (currentState === States.IDLE) {
|
if (currentState === States.IDLE) {
|
||||||
if (Math.random() < 1 / (60 * 3) && currentAnimation !== Animations.HEART && !isMenuOpen()) {
|
if (Math.random() < 1 / (60 * 3) && currentAnimation !== Animations.HEART && !isMenuOpen()) {
|
||||||
hop();
|
hop();
|
||||||
|
|||||||
Reference in New Issue
Block a user