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();