From 25ad5c87d175cf7b3899e104059f0da0d6068151 Mon Sep 17 00:00:00 2001 From: Idrees Hassan Date: Wed, 10 Sep 2025 18:01:14 -0400 Subject: [PATCH] Hide birb on fullscreen sites --- birb.js | 7 +++++++ build.js | 2 +- dist/birb.js | 7 +++++++ dist/birb.user.js | 9 ++++++++- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/birb.js b/birb.js index a44e937..62de2b3 100644 --- a/birb.js +++ b/birb.js @@ -994,6 +994,13 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI function update() { ticks++; + + // Hide bird if the browser is fullscreen + if (document.fullscreenElement) { + hideBirb(); + // Won't be restored on fullscreen exit + } + if (currentState === States.IDLE) { if (Math.random() < 1 / (60 * 3) && currentAnimation !== Animations.HEART && !isMenuOpen()) { hop(); diff --git a/build.js b/build.js index 283cf94..4164664 100644 --- a/build.js +++ b/build.js @@ -24,7 +24,7 @@ const userScriptHeader = `// ==UserScript== // @name Browser Bird // @namespace https://idreesinc.com -// @version 2025-09-09-01 +// @version 2025-09-10-01 // @description birb // @author Idrees // @downloadURL https://github.com/IdreesInc/Browser-Bird/raw/refs/heads/main/dist/birb.user.js diff --git a/dist/birb.js b/dist/birb.js index 894a7e5..009ec15 100644 --- a/dist/birb.js +++ b/dist/birb.js @@ -1309,6 +1309,13 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI function update() { ticks++; + + // Hide bird if the browser is fullscreen + if (document.fullscreenElement) { + hideBirb(); + // Won't be restored on fullscreen exit + } + if (currentState === States.IDLE) { if (Math.random() < 1 / (60 * 3) && currentAnimation !== Animations.HEART && !isMenuOpen()) { hop(); diff --git a/dist/birb.user.js b/dist/birb.user.js index 0f508cc..591ad94 100644 --- a/dist/birb.user.js +++ b/dist/birb.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Browser Bird // @namespace https://idreesinc.com -// @version 2025-09-09-01 +// @version 2025-09-10-01 // @description birb // @author Idrees // @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() { ticks++; + + // Hide bird if the browser is fullscreen + if (document.fullscreenElement) { + hideBirb(); + // Won't be restored on fullscreen exit + } + if (currentState === States.IDLE) { if (Math.random() < 1 / (60 * 3) && currentAnimation !== Animations.HEART && !isMenuOpen()) { hop();