diff --git a/dist/extension.zip b/dist/extension.zip index 54b9ebf..6f15efd 100644 Binary files a/dist/extension.zip and b/dist/extension.zip differ diff --git a/dist/extension/birb.js b/dist/extension/birb.js index 9c49f18..11654c9 100644 --- a/dist/extension/birb.js +++ b/dist/extension/birb.js @@ -478,7 +478,7 @@ "face": "#39333e", "wing": "#312c35", "wing-edge": "#171617", - "underbelly": "#ff82ba", + "underbelly": "#ff7eb8", "belly": "#ff6eaf", "foot": "#2e2c2e", "theme-highlight": "#ff82ba" @@ -1359,7 +1359,7 @@ 3500 + Math.random() * 600 * count, 2100 + Math.random() * 200 * count, 1600 + Math.random() * 400 * count]; - const VOLUMES = [0.0001, 0.2, 0.2, 0.0001]; + const VOLUMES = [0.00005, 0.165, 0.165, 0.0001]; const oscillator = this.audioContext.createOscillator(); oscillator.type = "sine"; @@ -2425,7 +2425,7 @@ }), new Separator(), new MenuItem(() => `Source Code ${isPetBoostActive() ? " ❤" : ""}`, () => { window.open("https://github.com/IdreesInc/Pocket-Bird"); }), - new MenuItem("2026.3.19", () => { alert("Thank you for using Pocket Bird! You are on version: 2026.3.19"); }, false), + new MenuItem("2026.3.20", () => { alert("Thank you for using Pocket Bird! You are on version: 2026.3.20"); }, false), ]; /** @type {Birb} */ @@ -2615,7 +2615,7 @@ setInterval(update, UPDATE_INTERVAL); - focusOnElement(true); + flyToElement(true); // TODO: Remove insertFieldGuide(); } @@ -2636,11 +2636,11 @@ // Idle for a while, do something if (focusedElement === null) { // Fly to an element - focusOnElement(); + flyToElement(); lastActionTimestamp = Date.now(); } else if (Math.random() < FOCUS_SWITCH_CHANCE) { // Fly to another element if idle for a longer while - focusOnElement(); + flyToElement(); lastActionTimestamp = Date.now(); } } @@ -2676,7 +2676,7 @@ // Update the bird's position if (currentState === States.IDLE) { if (focusedElement && !isWithinHorizontalBounds()) { - flySomewhere(); + flyToElement(); } birdY = getFocusedY(); } else if (currentState === States.FLYING) { @@ -2692,7 +2692,7 @@ startY += targetY - oldTargetY; if (targetY < 0 || targetY > getWindowHeight()) { // Fly to another element or the ground if the focused element moves out of bounds - flySomewhere(); + flyToElement(); } if (birb.draw(SPECIES[currentSpecies], currentHat)) { @@ -3211,26 +3211,6 @@ return getWindowHeight() - focusedBounds.top; } - /** - * Fly to either an element or the ground - */ - function flySomewhere() { - // On mobile, always prefer to focus on an element - // If not mobile, 50% chance to focus on ground - // if ((!isMobile() && coinFlip()) || !focusOnElement()) { - // focusOnGround(); - // } - if (!focusOnElement()) { - focusOnGround(); - } - } - - function focusOnGround() { - focusedElement = null; - updateFocusedElementBounds(); - flyTo(Math.random() * window.innerWidth, 0); - } - /** * @returns {HTMLElement|null} The random element, or null if no valid element was found */ @@ -3262,20 +3242,20 @@ } /** - * Focus on an element within the viewport + * Fly to an element within the viewport * @param {boolean} [teleport] Whether to teleport to the element instead of flying - * @returns Whether an element to focus on was found + * @returns Whether an element to fly to was found (null if flying to the ground) */ - function focusOnElement(teleport = false) { + function flyToElement(teleport = false) { if (frozen) { return false; } + const previousElement = focusedElement; focusedElement = getRandomValidElement(); - log("Focusing on element: ", focusedElement); updateFocusedElementBounds(); if (teleport) { teleportTo(getFocusedElementRandomX(), getFocusedY()); - } else { + } else if (focusedElement !== previousElement) { flyTo(getFocusedElementRandomX(), getFocusedY()); } return focusedElement !== null; diff --git a/dist/extension/manifest.json b/dist/extension/manifest.json index dcf0229..4a0742a 100644 --- a/dist/extension/manifest.json +++ b/dist/extension/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "Pocket Bird", "description": "It's a pet bird in your browser, what more could you want?", - "version": "2026.3.19", + "version": "2026.3.20", "homepage_url": "https://idreesinc.com", "icons": { "48": "images/icons/transparent/48x48x1.png", diff --git a/dist/obsidian/main.js b/dist/obsidian/main.js index f0216dd..dcdb6be 100644 --- a/dist/obsidian/main.js +++ b/dist/obsidian/main.js @@ -1,7 +1,7 @@ const { Plugin, Notice } = require('obsidian'); module.exports = class PocketBird extends Plugin { onload() { - console.log("Loading Pocket Bird version 2026.3.19..."); + console.log("Loading Pocket Bird version 2026.3.20..."); const OBSIDIAN_PLUGIN = this; (function () { 'use strict'; @@ -483,7 +483,7 @@ module.exports = class PocketBird extends Plugin { "face": "#39333e", "wing": "#312c35", "wing-edge": "#171617", - "underbelly": "#ff82ba", + "underbelly": "#ff7eb8", "belly": "#ff6eaf", "foot": "#2e2c2e", "theme-highlight": "#ff82ba" @@ -1364,7 +1364,7 @@ module.exports = class PocketBird extends Plugin { 3500 + Math.random() * 600 * count, 2100 + Math.random() * 200 * count, 1600 + Math.random() * 400 * count]; - const VOLUMES = [0.0001, 0.2, 0.2, 0.0001]; + const VOLUMES = [0.00005, 0.165, 0.165, 0.0001]; const oscillator = this.audioContext.createOscillator(); oscillator.type = "sine"; @@ -2458,7 +2458,7 @@ module.exports = class PocketBird extends Plugin { }), new Separator(), new MenuItem(() => `Source Code ${isPetBoostActive() ? " ❤" : ""}`, () => { window.open("https://github.com/IdreesInc/Pocket-Bird"); }), - new MenuItem("2026.3.19", () => { alert("Thank you for using Pocket Bird! You are on version: 2026.3.19"); }, false), + new MenuItem("2026.3.20", () => { alert("Thank you for using Pocket Bird! You are on version: 2026.3.20"); }, false), ]; /** @type {Birb} */ @@ -2648,7 +2648,7 @@ module.exports = class PocketBird extends Plugin { setInterval(update, UPDATE_INTERVAL); - focusOnElement(true); + flyToElement(true); // TODO: Remove insertFieldGuide(); } @@ -2669,11 +2669,11 @@ module.exports = class PocketBird extends Plugin { // Idle for a while, do something if (focusedElement === null) { // Fly to an element - focusOnElement(); + flyToElement(); lastActionTimestamp = Date.now(); } else if (Math.random() < FOCUS_SWITCH_CHANCE) { // Fly to another element if idle for a longer while - focusOnElement(); + flyToElement(); lastActionTimestamp = Date.now(); } } @@ -2709,7 +2709,7 @@ module.exports = class PocketBird extends Plugin { // Update the bird's position if (currentState === States.IDLE) { if (focusedElement && !isWithinHorizontalBounds()) { - flySomewhere(); + flyToElement(); } birdY = getFocusedY(); } else if (currentState === States.FLYING) { @@ -2725,7 +2725,7 @@ module.exports = class PocketBird extends Plugin { startY += targetY - oldTargetY; if (targetY < 0 || targetY > getWindowHeight()) { // Fly to another element or the ground if the focused element moves out of bounds - flySomewhere(); + flyToElement(); } if (birb.draw(SPECIES[currentSpecies], currentHat)) { @@ -3244,26 +3244,6 @@ module.exports = class PocketBird extends Plugin { return getWindowHeight() - focusedBounds.top; } - /** - * Fly to either an element or the ground - */ - function flySomewhere() { - // On mobile, always prefer to focus on an element - // If not mobile, 50% chance to focus on ground - // if ((!isMobile() && coinFlip()) || !focusOnElement()) { - // focusOnGround(); - // } - if (!focusOnElement()) { - focusOnGround(); - } - } - - function focusOnGround() { - focusedElement = null; - updateFocusedElementBounds(); - flyTo(Math.random() * window.innerWidth, 0); - } - /** * @returns {HTMLElement|null} The random element, or null if no valid element was found */ @@ -3295,20 +3275,20 @@ module.exports = class PocketBird extends Plugin { } /** - * Focus on an element within the viewport + * Fly to an element within the viewport * @param {boolean} [teleport] Whether to teleport to the element instead of flying - * @returns Whether an element to focus on was found + * @returns Whether an element to fly to was found (null if flying to the ground) */ - function focusOnElement(teleport = false) { + function flyToElement(teleport = false) { if (frozen) { return false; } + const previousElement = focusedElement; focusedElement = getRandomValidElement(); - log("Focusing on element: ", focusedElement); updateFocusedElementBounds(); if (teleport) { teleportTo(getFocusedElementRandomX(), getFocusedY()); - } else { + } else if (focusedElement !== previousElement) { flyTo(getFocusedElementRandomX(), getFocusedY()); } return focusedElement !== null; diff --git a/dist/obsidian/manifest.json b/dist/obsidian/manifest.json index c82f80c..9c272df 100644 --- a/dist/obsidian/manifest.json +++ b/dist/obsidian/manifest.json @@ -1,7 +1,7 @@ { "id": "pocket-bird", "name": "Pocket Bird", - "version": "2026.3.19", + "version": "2026.3.20", "minAppVersion": "0.15.0", "description": "Add a pet bird to fly around your notes and keep you company!", "author": "Idrees Hassan", diff --git a/dist/userscript/birb.user.js b/dist/userscript/birb.user.js index da4c2c9..0736d79 100644 --- a/dist/userscript/birb.user.js +++ b/dist/userscript/birb.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Pocket Bird // @namespace https://idreesinc.com -// @version 2026.3.19 +// @version 2026.3.20 // @description It's a pet bird in your browser, what more could you want? // @author Idrees // @downloadURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/userscript/birb.user.js @@ -492,7 +492,7 @@ "face": "#39333e", "wing": "#312c35", "wing-edge": "#171617", - "underbelly": "#ff82ba", + "underbelly": "#ff7eb8", "belly": "#ff6eaf", "foot": "#2e2c2e", "theme-highlight": "#ff82ba" @@ -1373,7 +1373,7 @@ 3500 + Math.random() * 600 * count, 2100 + Math.random() * 200 * count, 1600 + Math.random() * 400 * count]; - const VOLUMES = [0.0001, 0.2, 0.2, 0.0001]; + const VOLUMES = [0.00005, 0.165, 0.165, 0.0001]; const oscillator = this.audioContext.createOscillator(); oscillator.type = "sine"; @@ -2420,7 +2420,7 @@ }), new Separator(), new MenuItem(() => `Source Code ${isPetBoostActive() ? " ❤" : ""}`, () => { window.open("https://github.com/IdreesInc/Pocket-Bird"); }), - new MenuItem("2026.3.19", () => { alert("Thank you for using Pocket Bird! You are on version: 2026.3.19"); }, false), + new MenuItem("2026.3.20", () => { alert("Thank you for using Pocket Bird! You are on version: 2026.3.20"); }, false), ]; /** @type {Birb} */ @@ -2610,7 +2610,7 @@ setInterval(update, UPDATE_INTERVAL); - focusOnElement(true); + flyToElement(true); // TODO: Remove insertFieldGuide(); } @@ -2631,11 +2631,11 @@ // Idle for a while, do something if (focusedElement === null) { // Fly to an element - focusOnElement(); + flyToElement(); lastActionTimestamp = Date.now(); } else if (Math.random() < FOCUS_SWITCH_CHANCE) { // Fly to another element if idle for a longer while - focusOnElement(); + flyToElement(); lastActionTimestamp = Date.now(); } } @@ -2671,7 +2671,7 @@ // Update the bird's position if (currentState === States.IDLE) { if (focusedElement && !isWithinHorizontalBounds()) { - flySomewhere(); + flyToElement(); } birdY = getFocusedY(); } else if (currentState === States.FLYING) { @@ -2687,7 +2687,7 @@ startY += targetY - oldTargetY; if (targetY < 0 || targetY > getWindowHeight()) { // Fly to another element or the ground if the focused element moves out of bounds - flySomewhere(); + flyToElement(); } if (birb.draw(SPECIES[currentSpecies], currentHat)) { @@ -3206,26 +3206,6 @@ return getWindowHeight() - focusedBounds.top; } - /** - * Fly to either an element or the ground - */ - function flySomewhere() { - // On mobile, always prefer to focus on an element - // If not mobile, 50% chance to focus on ground - // if ((!isMobile() && coinFlip()) || !focusOnElement()) { - // focusOnGround(); - // } - if (!focusOnElement()) { - focusOnGround(); - } - } - - function focusOnGround() { - focusedElement = null; - updateFocusedElementBounds(); - flyTo(Math.random() * window.innerWidth, 0); - } - /** * @returns {HTMLElement|null} The random element, or null if no valid element was found */ @@ -3257,20 +3237,20 @@ } /** - * Focus on an element within the viewport + * Fly to an element within the viewport * @param {boolean} [teleport] Whether to teleport to the element instead of flying - * @returns Whether an element to focus on was found + * @returns Whether an element to fly to was found (null if flying to the ground) */ - function focusOnElement(teleport = false) { + function flyToElement(teleport = false) { if (frozen) { return false; } + const previousElement = focusedElement; focusedElement = getRandomValidElement(); - log("Focusing on element: ", focusedElement); updateFocusedElementBounds(); if (teleport) { teleportTo(getFocusedElementRandomX(), getFocusedY()); - } else { + } else if (focusedElement !== previousElement) { flyTo(getFocusedElementRandomX(), getFocusedY()); } return focusedElement !== null; diff --git a/dist/web/birb.embed.js b/dist/web/birb.embed.js index 21c630e..9e5dc96 100644 --- a/dist/web/birb.embed.js +++ b/dist/web/birb.embed.js @@ -478,7 +478,7 @@ "face": "#39333e", "wing": "#312c35", "wing-edge": "#171617", - "underbelly": "#ff82ba", + "underbelly": "#ff7eb8", "belly": "#ff6eaf", "foot": "#2e2c2e", "theme-highlight": "#ff82ba" @@ -1359,7 +1359,7 @@ 3500 + Math.random() * 600 * count, 2100 + Math.random() * 200 * count, 1600 + Math.random() * 400 * count]; - const VOLUMES = [0.0001, 0.2, 0.2, 0.0001]; + const VOLUMES = [0.00005, 0.165, 0.165, 0.0001]; const oscillator = this.audioContext.createOscillator(); oscillator.type = "sine"; @@ -2400,7 +2400,7 @@ }), new Separator(), new MenuItem(() => `Source Code ${isPetBoostActive() ? " ❤" : ""}`, () => { window.open("https://github.com/IdreesInc/Pocket-Bird"); }), - new MenuItem("2026.3.19", () => { alert("Thank you for using Pocket Bird! You are on version: 2026.3.19"); }, false), + new MenuItem("2026.3.20", () => { alert("Thank you for using Pocket Bird! You are on version: 2026.3.20"); }, false), ]; /** @type {Birb} */ @@ -2590,7 +2590,7 @@ setInterval(update, UPDATE_INTERVAL); - focusOnElement(true); + flyToElement(true); // TODO: Remove insertFieldGuide(); } @@ -2611,11 +2611,11 @@ // Idle for a while, do something if (focusedElement === null) { // Fly to an element - focusOnElement(); + flyToElement(); lastActionTimestamp = Date.now(); } else if (Math.random() < FOCUS_SWITCH_CHANCE) { // Fly to another element if idle for a longer while - focusOnElement(); + flyToElement(); lastActionTimestamp = Date.now(); } } @@ -2651,7 +2651,7 @@ // Update the bird's position if (currentState === States.IDLE) { if (focusedElement && !isWithinHorizontalBounds()) { - flySomewhere(); + flyToElement(); } birdY = getFocusedY(); } else if (currentState === States.FLYING) { @@ -2667,7 +2667,7 @@ startY += targetY - oldTargetY; if (targetY < 0 || targetY > getWindowHeight()) { // Fly to another element or the ground if the focused element moves out of bounds - flySomewhere(); + flyToElement(); } if (birb.draw(SPECIES[currentSpecies], currentHat)) { @@ -3186,26 +3186,6 @@ return getWindowHeight() - focusedBounds.top; } - /** - * Fly to either an element or the ground - */ - function flySomewhere() { - // On mobile, always prefer to focus on an element - // If not mobile, 50% chance to focus on ground - // if ((!isMobile() && coinFlip()) || !focusOnElement()) { - // focusOnGround(); - // } - if (!focusOnElement()) { - focusOnGround(); - } - } - - function focusOnGround() { - focusedElement = null; - updateFocusedElementBounds(); - flyTo(Math.random() * window.innerWidth, 0); - } - /** * @returns {HTMLElement|null} The random element, or null if no valid element was found */ @@ -3237,20 +3217,20 @@ } /** - * Focus on an element within the viewport + * Fly to an element within the viewport * @param {boolean} [teleport] Whether to teleport to the element instead of flying - * @returns Whether an element to focus on was found + * @returns Whether an element to fly to was found (null if flying to the ground) */ - function focusOnElement(teleport = false) { + function flyToElement(teleport = false) { if (frozen) { return false; } + const previousElement = focusedElement; focusedElement = getRandomValidElement(); - log("Focusing on element: ", focusedElement); updateFocusedElementBounds(); if (teleport) { teleportTo(getFocusedElementRandomX(), getFocusedY()); - } else { + } else if (focusedElement !== previousElement) { flyTo(getFocusedElementRandomX(), getFocusedY()); } return focusedElement !== null; diff --git a/dist/web/birb.js b/dist/web/birb.js index 21c630e..9e5dc96 100644 --- a/dist/web/birb.js +++ b/dist/web/birb.js @@ -478,7 +478,7 @@ "face": "#39333e", "wing": "#312c35", "wing-edge": "#171617", - "underbelly": "#ff82ba", + "underbelly": "#ff7eb8", "belly": "#ff6eaf", "foot": "#2e2c2e", "theme-highlight": "#ff82ba" @@ -1359,7 +1359,7 @@ 3500 + Math.random() * 600 * count, 2100 + Math.random() * 200 * count, 1600 + Math.random() * 400 * count]; - const VOLUMES = [0.0001, 0.2, 0.2, 0.0001]; + const VOLUMES = [0.00005, 0.165, 0.165, 0.0001]; const oscillator = this.audioContext.createOscillator(); oscillator.type = "sine"; @@ -2400,7 +2400,7 @@ }), new Separator(), new MenuItem(() => `Source Code ${isPetBoostActive() ? " ❤" : ""}`, () => { window.open("https://github.com/IdreesInc/Pocket-Bird"); }), - new MenuItem("2026.3.19", () => { alert("Thank you for using Pocket Bird! You are on version: 2026.3.19"); }, false), + new MenuItem("2026.3.20", () => { alert("Thank you for using Pocket Bird! You are on version: 2026.3.20"); }, false), ]; /** @type {Birb} */ @@ -2590,7 +2590,7 @@ setInterval(update, UPDATE_INTERVAL); - focusOnElement(true); + flyToElement(true); // TODO: Remove insertFieldGuide(); } @@ -2611,11 +2611,11 @@ // Idle for a while, do something if (focusedElement === null) { // Fly to an element - focusOnElement(); + flyToElement(); lastActionTimestamp = Date.now(); } else if (Math.random() < FOCUS_SWITCH_CHANCE) { // Fly to another element if idle for a longer while - focusOnElement(); + flyToElement(); lastActionTimestamp = Date.now(); } } @@ -2651,7 +2651,7 @@ // Update the bird's position if (currentState === States.IDLE) { if (focusedElement && !isWithinHorizontalBounds()) { - flySomewhere(); + flyToElement(); } birdY = getFocusedY(); } else if (currentState === States.FLYING) { @@ -2667,7 +2667,7 @@ startY += targetY - oldTargetY; if (targetY < 0 || targetY > getWindowHeight()) { // Fly to another element or the ground if the focused element moves out of bounds - flySomewhere(); + flyToElement(); } if (birb.draw(SPECIES[currentSpecies], currentHat)) { @@ -3186,26 +3186,6 @@ return getWindowHeight() - focusedBounds.top; } - /** - * Fly to either an element or the ground - */ - function flySomewhere() { - // On mobile, always prefer to focus on an element - // If not mobile, 50% chance to focus on ground - // if ((!isMobile() && coinFlip()) || !focusOnElement()) { - // focusOnGround(); - // } - if (!focusOnElement()) { - focusOnGround(); - } - } - - function focusOnGround() { - focusedElement = null; - updateFocusedElementBounds(); - flyTo(Math.random() * window.innerWidth, 0); - } - /** * @returns {HTMLElement|null} The random element, or null if no valid element was found */ @@ -3237,20 +3217,20 @@ } /** - * Focus on an element within the viewport + * Fly to an element within the viewport * @param {boolean} [teleport] Whether to teleport to the element instead of flying - * @returns Whether an element to focus on was found + * @returns Whether an element to fly to was found (null if flying to the ground) */ - function focusOnElement(teleport = false) { + function flyToElement(teleport = false) { if (frozen) { return false; } + const previousElement = focusedElement; focusedElement = getRandomValidElement(); - log("Focusing on element: ", focusedElement); updateFocusedElementBounds(); if (teleport) { teleportTo(getFocusedElementRandomX(), getFocusedY()); - } else { + } else if (focusedElement !== previousElement) { flyTo(getFocusedElementRandomX(), getFocusedY()); } return focusedElement !== null; diff --git a/src/application.js b/src/application.js index ae5fc84..4c8736a 100644 --- a/src/application.js +++ b/src/application.js @@ -406,7 +406,7 @@ function startApplication(birbPixels, featherPixels, hatsPixels) { setInterval(update, UPDATE_INTERVAL); - focusOnElement(true); + flyToElement(true); // TODO: Remove insertFieldGuide(); } @@ -427,11 +427,11 @@ function startApplication(birbPixels, featherPixels, hatsPixels) { // Idle for a while, do something if (focusedElement === null) { // Fly to an element - focusOnElement(); + flyToElement(); lastActionTimestamp = Date.now(); } else if (Math.random() < FOCUS_SWITCH_CHANCE) { // Fly to another element if idle for a longer while - focusOnElement(); + flyToElement(); lastActionTimestamp = Date.now(); } } @@ -467,7 +467,7 @@ function startApplication(birbPixels, featherPixels, hatsPixels) { // Update the bird's position if (currentState === States.IDLE) { if (focusedElement && !isWithinHorizontalBounds()) { - flySomewhere(); + flyToElement(); } birdY = getFocusedY(); } else if (currentState === States.FLYING) { @@ -483,7 +483,7 @@ function startApplication(birbPixels, featherPixels, hatsPixels) { startY += targetY - oldTargetY; if (targetY < 0 || targetY > getWindowHeight()) { // Fly to another element or the ground if the focused element moves out of bounds - flySomewhere(); + flyToElement(); } if (birb.draw(SPECIES[currentSpecies], currentHat)) { @@ -1006,26 +1006,6 @@ function startApplication(birbPixels, featherPixels, hatsPixels) { return getWindowHeight() - focusedBounds.top; } - /** - * Fly to either an element or the ground - */ - function flySomewhere() { - // On mobile, always prefer to focus on an element - // If not mobile, 50% chance to focus on ground - // if ((!isMobile() && coinFlip()) || !focusOnElement()) { - // focusOnGround(); - // } - if (!focusOnElement()) { - focusOnGround(); - } - } - - function focusOnGround() { - focusedElement = null; - updateFocusedElementBounds(); - flyTo(Math.random() * window.innerWidth, 0); - } - /** * @returns {HTMLElement|null} The random element, or null if no valid element was found */ @@ -1063,20 +1043,20 @@ function startApplication(birbPixels, featherPixels, hatsPixels) { } /** - * Focus on an element within the viewport + * Fly to an element within the viewport * @param {boolean} [teleport] Whether to teleport to the element instead of flying - * @returns Whether an element to focus on was found + * @returns Whether an element to fly to was found (null if flying to the ground) */ - function focusOnElement(teleport = false) { + function flyToElement(teleport = false) { if (frozen) { return false; } + const previousElement = focusedElement; focusedElement = getRandomValidElement(); - log("Focusing on element: ", focusedElement); updateFocusedElementBounds(); if (teleport) { teleportTo(getFocusedElementRandomX(), getFocusedY()); - } else { + } else if (focusedElement !== previousElement) { flyTo(getFocusedElementRandomX(), getFocusedY()); } return focusedElement !== null; diff --git a/src/sound.js b/src/sound.js index 6c4f488..9e310b0 100644 --- a/src/sound.js +++ b/src/sound.js @@ -20,7 +20,7 @@ export class Birdsong { 3500 + Math.random() * 600 * count, 2100 + Math.random() * 200 * count, 1600 + Math.random() * 400 * count]; - const VOLUMES = [0.0001, 0.2, 0.2, 0.0001]; + const VOLUMES = [0.00005, 0.165, 0.165, 0.0001]; const oscillator = this.audioContext.createOscillator(); oscillator.type = "sine";