mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-25 12:17:22 +00:00
Fix font not loading
This commit is contained in:
14
birb.js
14
birb.js
@@ -912,6 +912,13 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Preload font
|
||||||
|
const MONOCRAFT_SRC = "https://cdn.jsdelivr.net/gh/idreesinc/Monocraft@99b32ab40612ff2533a69d8f14bd8b3d9e604456/dist/Monocraft.otf";
|
||||||
|
const fontLink = document.createElement("link");
|
||||||
|
fontLink.rel = "stylesheet";
|
||||||
|
fontLink.href = `url(${MONOCRAFT_SRC}) format("opentype")`;
|
||||||
|
document.head.appendChild(fontLink);
|
||||||
|
|
||||||
load();
|
load();
|
||||||
|
|
||||||
styleElement.innerHTML = STYLESHEET;
|
styleElement.innerHTML = STYLESHEET;
|
||||||
@@ -1301,6 +1308,9 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI
|
|||||||
onClick(closeButton, func);
|
onClick(closeButton, func);
|
||||||
}
|
}
|
||||||
document.addEventListener("keydown", (e) => {
|
document.addEventListener("keydown", (e) => {
|
||||||
|
if (closeButton && !document.body.contains(closeButton)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (e.key === "Escape") {
|
if (e.key === "Escape") {
|
||||||
func();
|
func();
|
||||||
}
|
}
|
||||||
@@ -1450,7 +1460,9 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI
|
|||||||
}
|
}
|
||||||
content.innerHTML = "";
|
content.innerHTML = "";
|
||||||
for (const item of menuItems) {
|
for (const item of menuItems) {
|
||||||
content.appendChild(makeMenuItem(item));
|
if (!item.isDebug || debugMode) {
|
||||||
|
content.appendChild(makeMenuItem(item));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
updateMenuLocation(menu);
|
updateMenuLocation(menu);
|
||||||
}
|
}
|
||||||
|
|||||||
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-08-28-1
|
// @version 2025-09-09-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
|
||||||
|
|||||||
21
dist/birb.js
vendored
21
dist/birb.js
vendored
@@ -50,12 +50,7 @@ const DEFAULT_SETTINGS = {
|
|||||||
|
|
||||||
let userSettings = {};
|
let userSettings = {};
|
||||||
|
|
||||||
const STYLESHEET = `@font-face {
|
const STYLESHEET = `:root {
|
||||||
font-family: Monocraft;
|
|
||||||
src: url("https://cdn.jsdelivr.net/gh/idreesinc/Monocraft@99b32ab40612ff2533a69d8f14bd8b3d9e604456/dist/Monocraft.otf");
|
|
||||||
}
|
|
||||||
|
|
||||||
:root {
|
|
||||||
--border-size: 2px;
|
--border-size: 2px;
|
||||||
--neg-border-size: calc(var(--border-size) * -1);
|
--neg-border-size: calc(var(--border-size) * -1);
|
||||||
--double-border-size: calc(var(--border-size) * 2);
|
--double-border-size: calc(var(--border-size) * 2);
|
||||||
@@ -1232,6 +1227,13 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Preload font
|
||||||
|
const MONOCRAFT_SRC = "https://cdn.jsdelivr.net/gh/idreesinc/Monocraft@99b32ab40612ff2533a69d8f14bd8b3d9e604456/dist/Monocraft.otf";
|
||||||
|
const fontLink = document.createElement("link");
|
||||||
|
fontLink.rel = "stylesheet";
|
||||||
|
fontLink.href = `url(${MONOCRAFT_SRC}) format("opentype")`;
|
||||||
|
document.head.appendChild(fontLink);
|
||||||
|
|
||||||
load();
|
load();
|
||||||
|
|
||||||
styleElement.innerHTML = STYLESHEET;
|
styleElement.innerHTML = STYLESHEET;
|
||||||
@@ -1621,6 +1623,9 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI
|
|||||||
onClick(closeButton, func);
|
onClick(closeButton, func);
|
||||||
}
|
}
|
||||||
document.addEventListener("keydown", (e) => {
|
document.addEventListener("keydown", (e) => {
|
||||||
|
if (closeButton && !document.body.contains(closeButton)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (e.key === "Escape") {
|
if (e.key === "Escape") {
|
||||||
func();
|
func();
|
||||||
}
|
}
|
||||||
@@ -1770,7 +1775,9 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI
|
|||||||
}
|
}
|
||||||
content.innerHTML = "";
|
content.innerHTML = "";
|
||||||
for (const item of menuItems) {
|
for (const item of menuItems) {
|
||||||
content.appendChild(makeMenuItem(item));
|
if (!item.isDebug || debugMode) {
|
||||||
|
content.appendChild(makeMenuItem(item));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
updateMenuLocation(menu);
|
updateMenuLocation(menu);
|
||||||
}
|
}
|
||||||
|
|||||||
23
dist/birb.user.js
vendored
23
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-08-28-1
|
// @version 2025-09-09-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
|
||||||
@@ -64,12 +64,7 @@ const DEFAULT_SETTINGS = {
|
|||||||
|
|
||||||
let userSettings = {};
|
let userSettings = {};
|
||||||
|
|
||||||
const STYLESHEET = `@font-face {
|
const STYLESHEET = `:root {
|
||||||
font-family: Monocraft;
|
|
||||||
src: url("https://cdn.jsdelivr.net/gh/idreesinc/Monocraft@99b32ab40612ff2533a69d8f14bd8b3d9e604456/dist/Monocraft.otf");
|
|
||||||
}
|
|
||||||
|
|
||||||
:root {
|
|
||||||
--border-size: 2px;
|
--border-size: 2px;
|
||||||
--neg-border-size: calc(var(--border-size) * -1);
|
--neg-border-size: calc(var(--border-size) * -1);
|
||||||
--double-border-size: calc(var(--border-size) * 2);
|
--double-border-size: calc(var(--border-size) * 2);
|
||||||
@@ -1246,6 +1241,13 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Preload font
|
||||||
|
const MONOCRAFT_SRC = "https://cdn.jsdelivr.net/gh/idreesinc/Monocraft@99b32ab40612ff2533a69d8f14bd8b3d9e604456/dist/Monocraft.otf";
|
||||||
|
const fontLink = document.createElement("link");
|
||||||
|
fontLink.rel = "stylesheet";
|
||||||
|
fontLink.href = `url(${MONOCRAFT_SRC}) format("opentype")`;
|
||||||
|
document.head.appendChild(fontLink);
|
||||||
|
|
||||||
load();
|
load();
|
||||||
|
|
||||||
styleElement.innerHTML = STYLESHEET;
|
styleElement.innerHTML = STYLESHEET;
|
||||||
@@ -1635,6 +1637,9 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI
|
|||||||
onClick(closeButton, func);
|
onClick(closeButton, func);
|
||||||
}
|
}
|
||||||
document.addEventListener("keydown", (e) => {
|
document.addEventListener("keydown", (e) => {
|
||||||
|
if (closeButton && !document.body.contains(closeButton)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (e.key === "Escape") {
|
if (e.key === "Escape") {
|
||||||
func();
|
func();
|
||||||
}
|
}
|
||||||
@@ -1784,7 +1789,9 @@ Promise.all([loadSpriteSheetPixels(SPRITE_SHEET), loadSpriteSheetPixels(DECORATI
|
|||||||
}
|
}
|
||||||
content.innerHTML = "";
|
content.innerHTML = "";
|
||||||
for (const item of menuItems) {
|
for (const item of menuItems) {
|
||||||
content.appendChild(makeMenuItem(item));
|
if (!item.isDebug || debugMode) {
|
||||||
|
content.appendChild(makeMenuItem(item));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
updateMenuLocation(menu);
|
updateMenuLocation(menu);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
@font-face {
|
|
||||||
font-family: Monocraft;
|
|
||||||
src: url("https://cdn.jsdelivr.net/gh/idreesinc/Monocraft@99b32ab40612ff2533a69d8f14bd8b3d9e604456/dist/Monocraft.otf");
|
|
||||||
}
|
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--border-size: 2px;
|
--border-size: 2px;
|
||||||
--neg-border-size: calc(var(--border-size) * -1);
|
--neg-border-size: calc(var(--border-size) * -1);
|
||||||
|
|||||||
Reference in New Issue
Block a user