mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-24 19:59:36 +00:00
Allow landing on fixed elements in obsidian
This commit is contained in:
6
dist/birb.js
vendored
6
dist/birb.js
vendored
@@ -1946,7 +1946,7 @@
|
||||
insertModal(`${birdBirb()} Mode`, message);
|
||||
}),
|
||||
new Separator(),
|
||||
new MenuItem("2025.11.13.47", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.13.47"); }, false),
|
||||
new MenuItem("2025.11.13.64", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.13.64"); }, false),
|
||||
];
|
||||
|
||||
const styleElement = document.createElement("style");
|
||||
@@ -2590,7 +2590,11 @@
|
||||
// @ts-expect-error
|
||||
const largeElements = Array.from(visible).filter((img) => img instanceof HTMLElement && img !== focusedElement && img.offsetWidth >= MIN_FOCUS_ELEMENT_WIDTH);
|
||||
// Ensure the bird doesn't land on fixed or sticky elements
|
||||
const fixedAllowed = getContext() instanceof ObsidianContext;
|
||||
const nonFixedElements = largeElements.filter((el) => {
|
||||
if (fixedAllowed) {
|
||||
return true;
|
||||
}
|
||||
const style = window.getComputedStyle(el);
|
||||
return style.position !== "fixed" && style.position !== "sticky";
|
||||
});
|
||||
|
||||
BIN
dist/extension.zip
vendored
BIN
dist/extension.zip
vendored
Binary file not shown.
6
dist/extension/birb.js
vendored
6
dist/extension/birb.js
vendored
@@ -1946,7 +1946,7 @@
|
||||
insertModal(`${birdBirb()} Mode`, message);
|
||||
}),
|
||||
new Separator(),
|
||||
new MenuItem("2025.11.13.47", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.13.47"); }, false),
|
||||
new MenuItem("2025.11.13.64", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.13.64"); }, false),
|
||||
];
|
||||
|
||||
const styleElement = document.createElement("style");
|
||||
@@ -2590,7 +2590,11 @@
|
||||
// @ts-expect-error
|
||||
const largeElements = Array.from(visible).filter((img) => img instanceof HTMLElement && img !== focusedElement && img.offsetWidth >= MIN_FOCUS_ELEMENT_WIDTH);
|
||||
// Ensure the bird doesn't land on fixed or sticky elements
|
||||
const fixedAllowed = getContext() instanceof ObsidianContext;
|
||||
const nonFixedElements = largeElements.filter((el) => {
|
||||
if (fixedAllowed) {
|
||||
return true;
|
||||
}
|
||||
const style = window.getComputedStyle(el);
|
||||
return style.position !== "fixed" && style.position !== "sticky";
|
||||
});
|
||||
|
||||
2
dist/extension/manifest.json
vendored
2
dist/extension/manifest.json
vendored
@@ -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": "2025.11.13.47",
|
||||
"version": "2025.11.13.64",
|
||||
"homepage_url": "https://idreesinc.com",
|
||||
"icons": {
|
||||
"48": "images/icons/transparent/48x48x1.png",
|
||||
|
||||
8
dist/obsidian/main.js
vendored
8
dist/obsidian/main.js
vendored
@@ -2,7 +2,7 @@
|
||||
const { Plugin, Notice } = require('obsidian');
|
||||
module.exports = class PocketBird extends Plugin {
|
||||
onload() {
|
||||
console.log("Loading Pocket Bird version 2025.11.13.47...");
|
||||
console.log("Loading Pocket Bird version 2025.11.13.64...");
|
||||
const OBSIDIAN_PLUGIN = this;
|
||||
(function () {
|
||||
'use strict';
|
||||
@@ -1952,7 +1952,7 @@ module.exports = class PocketBird extends Plugin {
|
||||
insertModal(`${birdBirb()} Mode`, message);
|
||||
}),
|
||||
new Separator(),
|
||||
new MenuItem("2025.11.13.47", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.13.47"); }, false),
|
||||
new MenuItem("2025.11.13.64", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.13.64"); }, false),
|
||||
];
|
||||
|
||||
const styleElement = document.createElement("style");
|
||||
@@ -2596,7 +2596,11 @@ module.exports = class PocketBird extends Plugin {
|
||||
// @ts-expect-error
|
||||
const largeElements = Array.from(visible).filter((img) => img instanceof HTMLElement && img !== focusedElement && img.offsetWidth >= MIN_FOCUS_ELEMENT_WIDTH);
|
||||
// Ensure the bird doesn't land on fixed or sticky elements
|
||||
const fixedAllowed = getContext() instanceof ObsidianContext;
|
||||
const nonFixedElements = largeElements.filter((el) => {
|
||||
if (fixedAllowed) {
|
||||
return true;
|
||||
}
|
||||
const style = window.getComputedStyle(el);
|
||||
return style.position !== "fixed" && style.position !== "sticky";
|
||||
});
|
||||
|
||||
2
dist/obsidian/manifest.json
vendored
2
dist/obsidian/manifest.json
vendored
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "pocket-bird",
|
||||
"name": "Pocket Bird",
|
||||
"version": "2025.11.13.47",
|
||||
"version": "2025.11.13.64",
|
||||
"minAppVersion": "0.15.0",
|
||||
"description": "It's a pet bird in your Obsidian, what more could you want?",
|
||||
"author": "Idrees Hassan",
|
||||
|
||||
8
dist/userscript/birb.user.js
vendored
8
dist/userscript/birb.user.js
vendored
@@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @name Pocket Bird
|
||||
// @namespace https://idreesinc.com
|
||||
// @version 2025.11.13.47
|
||||
// @version 2025.11.13.64
|
||||
// @description It's a bird that hops around your web browser, the future is here
|
||||
// @author Idrees
|
||||
// @downloadURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/userscript/birb.user.js
|
||||
@@ -1960,7 +1960,7 @@
|
||||
insertModal(`${birdBirb()} Mode`, message);
|
||||
}),
|
||||
new Separator(),
|
||||
new MenuItem("2025.11.13.47", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.13.47"); }, false),
|
||||
new MenuItem("2025.11.13.64", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.13.64"); }, false),
|
||||
];
|
||||
|
||||
const styleElement = document.createElement("style");
|
||||
@@ -2604,7 +2604,11 @@
|
||||
// @ts-expect-error
|
||||
const largeElements = Array.from(visible).filter((img) => img instanceof HTMLElement && img !== focusedElement && img.offsetWidth >= MIN_FOCUS_ELEMENT_WIDTH);
|
||||
// Ensure the bird doesn't land on fixed or sticky elements
|
||||
const fixedAllowed = getContext() instanceof ObsidianContext;
|
||||
const nonFixedElements = largeElements.filter((el) => {
|
||||
if (fixedAllowed) {
|
||||
return true;
|
||||
}
|
||||
const style = window.getComputedStyle(el);
|
||||
return style.position !== "fixed" && style.position !== "sticky";
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@ import Frame from './frame.js';
|
||||
import Layer from './layer.js';
|
||||
import Anim from './anim.js';
|
||||
import { Birb, Animations } from './birb.js';
|
||||
import { getContext } from './context.js';
|
||||
import { getContext, ObsidianContext } from './context.js';
|
||||
|
||||
import {
|
||||
Directions,
|
||||
@@ -880,7 +880,11 @@ Promise.all([
|
||||
// @ts-expect-error
|
||||
const largeElements = Array.from(visible).filter((img) => img instanceof HTMLElement && img !== focusedElement && img.offsetWidth >= MIN_FOCUS_ELEMENT_WIDTH);
|
||||
// Ensure the bird doesn't land on fixed or sticky elements
|
||||
const fixedAllowed = getContext() instanceof ObsidianContext;
|
||||
const nonFixedElements = largeElements.filter((el) => {
|
||||
if (fixedAllowed) {
|
||||
return true;
|
||||
}
|
||||
const style = window.getComputedStyle(el);
|
||||
return style.position !== "fixed" && style.position !== "sticky";
|
||||
});
|
||||
|
||||
@@ -222,7 +222,7 @@ class BrowserExtensionContext extends Context {
|
||||
}
|
||||
}
|
||||
|
||||
class ObsidianContext extends Context {
|
||||
export class ObsidianContext extends Context {
|
||||
|
||||
/**
|
||||
* @override
|
||||
|
||||
Reference in New Issue
Block a user