mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-26 02:08:10 -07:00
parser: reactivate bkp url for price fetching
This commit is contained in:
+2
-2
@@ -34,7 +34,7 @@
|
||||
"prettier-plugin-tailwindcss": "^0.6.5",
|
||||
"pwa-asset-generator": "^6.3.1",
|
||||
"rollup-plugin-visualizer": "^5.12.0",
|
||||
"tailwindcss": "^3.4.6",
|
||||
"tailwindcss": "^3.4.7",
|
||||
"typescript": "^5.5.4",
|
||||
"unplugin-auto-import": "^0.18.2",
|
||||
"unplugin-icons": "^0.19.0",
|
||||
@@ -42,6 +42,6 @@
|
||||
"vite-plugin-pwa": "^0.20.1",
|
||||
"vite-plugin-solid": "^2.10.2",
|
||||
"workbox-window": "^7.1.0",
|
||||
"wrangler": "^3.66.0"
|
||||
"wrangler": "^3.67.0"
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+14
-14
@@ -36,7 +36,7 @@ devDependencies:
|
||||
version: 1.1.118
|
||||
'@tailwindcss/container-queries':
|
||||
specifier: ^0.1.1
|
||||
version: 0.1.1(tailwindcss@3.4.6)
|
||||
version: 0.1.1(tailwindcss@3.4.7)
|
||||
autoprefixer:
|
||||
specifier: ^10.4.19
|
||||
version: 10.4.19(postcss@8.4.40)
|
||||
@@ -56,8 +56,8 @@ devDependencies:
|
||||
specifier: ^5.12.0
|
||||
version: 5.12.0(rollup@2.79.1)
|
||||
tailwindcss:
|
||||
specifier: ^3.4.6
|
||||
version: 3.4.6
|
||||
specifier: ^3.4.7
|
||||
version: 3.4.7
|
||||
typescript:
|
||||
specifier: ^5.5.4
|
||||
version: 5.5.4
|
||||
@@ -80,8 +80,8 @@ devDependencies:
|
||||
specifier: ^7.1.0
|
||||
version: 7.1.0
|
||||
wrangler:
|
||||
specifier: ^3.66.0
|
||||
version: 3.66.0
|
||||
specifier: ^3.67.0
|
||||
version: 3.67.0
|
||||
|
||||
packages:
|
||||
|
||||
@@ -2295,12 +2295,12 @@ packages:
|
||||
string.prototype.matchall: 4.0.11
|
||||
dev: true
|
||||
|
||||
/@tailwindcss/container-queries@0.1.1(tailwindcss@3.4.6):
|
||||
/@tailwindcss/container-queries@0.1.1(tailwindcss@3.4.7):
|
||||
resolution: {integrity: sha512-p18dswChx6WnTSaJCSGx6lTmrGzNNvm2FtXmiO6AuA1V4U5REyoqwmT6kgAsIMdjo07QdAfYXHJ4hnMtfHzWgA==}
|
||||
peerDependencies:
|
||||
tailwindcss: '>=3.2.0'
|
||||
dependencies:
|
||||
tailwindcss: 3.4.6
|
||||
tailwindcss: 3.4.7
|
||||
dev: true
|
||||
|
||||
/@types/babel__core@7.20.5:
|
||||
@@ -2635,7 +2635,7 @@ packages:
|
||||
hasBin: true
|
||||
dependencies:
|
||||
caniuse-lite: 1.0.30001643
|
||||
electron-to-chromium: 1.5.1
|
||||
electron-to-chromium: 1.5.2
|
||||
node-releases: 2.0.18
|
||||
update-browserslist-db: 1.1.0(browserslist@4.23.2)
|
||||
dev: true
|
||||
@@ -3101,8 +3101,8 @@ packages:
|
||||
jake: 10.9.2
|
||||
dev: true
|
||||
|
||||
/electron-to-chromium@1.5.1:
|
||||
resolution: {integrity: sha512-FKbOCOQ5QRB3VlIbl1LZQefWIYwszlBloaXcY2rbfpu9ioJnNh3TK03YtIDKDo3WKBi8u+YV4+Fn2CkEozgf4w==}
|
||||
/electron-to-chromium@1.5.2:
|
||||
resolution: {integrity: sha512-kc4r3U3V3WLaaZqThjYz/Y6z8tJe+7K0bbjUVo3i+LWIypVdMx5nXCkwRe6SWbY6ILqLdc1rKcKmr3HoH7wjSQ==}
|
||||
dev: true
|
||||
|
||||
/emoji-regex@8.0.0:
|
||||
@@ -5469,8 +5469,8 @@ packages:
|
||||
engines: {node: '>= 0.4'}
|
||||
dev: true
|
||||
|
||||
/tailwindcss@3.4.6:
|
||||
resolution: {integrity: sha512-1uRHzPB+Vzu57ocybfZ4jh5Q3SdlH7XW23J5sQoM9LhE9eIOlzxer/3XPSsycvih3rboRsvt0QCmzSrqyOYUIA==}
|
||||
/tailwindcss@3.4.7:
|
||||
resolution: {integrity: sha512-rxWZbe87YJb4OcSopb7up2Ba4U82BoiSGUdoDr3Ydrg9ckxFS/YWsvhN323GMcddgU65QRy7JndC7ahhInhvlQ==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
@@ -6184,8 +6184,8 @@ packages:
|
||||
'@cloudflare/workerd-windows-64': 1.20240718.0
|
||||
dev: true
|
||||
|
||||
/wrangler@3.66.0:
|
||||
resolution: {integrity: sha512-5fEyXsP8qvrUeR13kCfA3OG1z/ABx+/a8hzIA55nCUM2/tjI67ZkfeN1VdOmG6cipZDvs4HfN8rp7j+e+21nKA==}
|
||||
/wrangler@3.67.0:
|
||||
resolution: {integrity: sha512-elun6p9rAmGr/CtnCixhUXWeKT+LnFbHDsLLizgAlFJbsgCPV/O1if7uMjTGD/fUJNXrwbTVRpxvInz5X9gE2Q==}
|
||||
engines: {node: '>=16.17.0'}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { phone, touchScreen } from "/src/env";
|
||||
import { createRWS } from "/src/solid/rws";
|
||||
|
||||
const texts = [
|
||||
@@ -135,9 +136,12 @@ function TextWrapper({
|
||||
}
|
||||
});
|
||||
|
||||
onMount(() => {
|
||||
seconds.set(Math.round(p()!.clientWidth / 20));
|
||||
});
|
||||
// Bug in Safari iOS, not sure where else, works perfectly on Mac OS though
|
||||
if (!touchScreen) {
|
||||
onMount(() => {
|
||||
seconds.set(Math.round(p()!.clientWidth / 20));
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<p
|
||||
|
||||
+9
-85
@@ -12,6 +12,7 @@ import {
|
||||
import { readBooleanURLParam, writeURLParam } from "../scripts/utils/urlParams";
|
||||
import { webSockets } from "../scripts/ws";
|
||||
import { classPropToString } from "../solid/classes";
|
||||
import { createPreferredColorSchemeAccessor } from "../solid/prefferedColorScheme";
|
||||
import { Background } from "./components/background";
|
||||
import { ChartFrame } from "./components/frames/chart";
|
||||
import { FavoritesFrame } from "./components/frames/favorites";
|
||||
@@ -20,6 +21,7 @@ import { HistoryFrame } from "./components/frames/history";
|
||||
import { SettingsFrame } from "./components/frames/settings";
|
||||
import { StripDesktop, StripMobile } from "./components/strip";
|
||||
import { Update } from "./components/update";
|
||||
import { createUserConfig } from "./scripts/user";
|
||||
|
||||
const LOCAL_STORAGE_BAR_KEY = "bar-width";
|
||||
const LOCAL_STORAGE_FULLSCREEN = "fullscrenn";
|
||||
@@ -29,90 +31,12 @@ export const INPUT_PRESET_SEARCH_ID = "input-search-preset";
|
||||
export function App() {
|
||||
const tabFocused = createRWS(true);
|
||||
const qrcode = createRWS("");
|
||||
|
||||
const appTheme = createSL(["System", "Dark", "Light"] as const, {
|
||||
saveable: {
|
||||
key: "app-theme",
|
||||
mode: "localStorage",
|
||||
},
|
||||
defaultIndex: 0,
|
||||
});
|
||||
|
||||
const dark = createRWS(false);
|
||||
|
||||
const preferredColorSchemeMatchMedia = window.matchMedia(
|
||||
"(prefers-color-scheme: dark)",
|
||||
);
|
||||
|
||||
const preferredSystemTheme = createRWS<"light" | "dark">(
|
||||
preferredColorSchemeMatchMedia.matches ? "dark" : "light",
|
||||
);
|
||||
|
||||
function preferredColorSchemeListener(event: MediaQueryListEvent) {
|
||||
return preferredSystemTheme.set(event.matches ? "dark" : "light");
|
||||
}
|
||||
|
||||
preferredColorSchemeMatchMedia.addEventListener(
|
||||
"change",
|
||||
preferredColorSchemeListener,
|
||||
);
|
||||
|
||||
onCleanup(() => {
|
||||
preferredColorSchemeMatchMedia.removeEventListener(
|
||||
"change",
|
||||
preferredColorSchemeListener,
|
||||
);
|
||||
const userConfig = createUserConfig({
|
||||
dark,
|
||||
});
|
||||
|
||||
createEffect(() => {
|
||||
if (
|
||||
appTheme.selected() === "Dark" ||
|
||||
(appTheme.selected() === "System" && preferredSystemTheme() === "dark")
|
||||
) {
|
||||
dark.set(true);
|
||||
document.documentElement.classList.add("dark");
|
||||
} else {
|
||||
dark.set(false);
|
||||
document.documentElement.classList.remove("dark");
|
||||
}
|
||||
});
|
||||
|
||||
const backgroundMode = createSL(["Scroll", "Static"] as const, {
|
||||
saveable: {
|
||||
key: "bg-mode",
|
||||
mode: "localStorage",
|
||||
},
|
||||
defaultIndex: 0,
|
||||
});
|
||||
|
||||
const backgroundOpacity = createSL(
|
||||
[
|
||||
{
|
||||
text: "Strong",
|
||||
value: 0.0444,
|
||||
},
|
||||
{
|
||||
text: "Normal",
|
||||
value: 0.0333,
|
||||
},
|
||||
{
|
||||
text: "Light",
|
||||
value: 0.0222,
|
||||
},
|
||||
{
|
||||
text: "Subtle",
|
||||
value: 0.0111,
|
||||
},
|
||||
] as const,
|
||||
{
|
||||
saveable: {
|
||||
key: "bg-text-opacity",
|
||||
mode: "localStorage",
|
||||
},
|
||||
defaultIndex: 2,
|
||||
},
|
||||
);
|
||||
|
||||
const fullscreen = createRWS(
|
||||
readBooleanURLParam(LOCAL_STORAGE_FULLSCREEN) ||
|
||||
readBooleanFromStorage(LOCAL_STORAGE_FULLSCREEN) ||
|
||||
@@ -240,8 +164,8 @@ export function App() {
|
||||
<>
|
||||
<Background
|
||||
focused={tabFocused}
|
||||
mode={backgroundMode}
|
||||
opacity={backgroundOpacity}
|
||||
mode={userConfig.settings.background.mode}
|
||||
opacity={userConfig.settings.background.opacity}
|
||||
/>
|
||||
|
||||
<div
|
||||
@@ -321,9 +245,9 @@ export function App() {
|
||||
<HistoryFrame presets={presets} selectedFrame={selectedFrame} />
|
||||
<SettingsFrame
|
||||
selectedFrame={selectedFrame}
|
||||
appTheme={appTheme}
|
||||
backgroundMode={backgroundMode}
|
||||
backgroundOpacity={backgroundOpacity}
|
||||
appTheme={userConfig.settings.appTheme}
|
||||
backgroundMode={userConfig.settings.background.mode}
|
||||
backgroundOpacity={userConfig.settings.background.opacity}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
type UserConfig = ReturnType<typeof import("./user").createUserConfig>;
|
||||
@@ -0,0 +1,70 @@
|
||||
import { createSL } from "/src/scripts/utils/selectableList/static";
|
||||
import { createPreferredColorSchemeAccessor } from "/src/solid/prefferedColorScheme";
|
||||
|
||||
export function createUserConfig({ dark }: { dark: RWS<boolean> }) {
|
||||
const userConfig = {
|
||||
settings: {
|
||||
appTheme: createSL(["System", "Dark", "Light"] as const, {
|
||||
saveable: {
|
||||
key: "app-theme",
|
||||
mode: "localStorage",
|
||||
},
|
||||
defaultIndex: 1,
|
||||
}),
|
||||
background: {
|
||||
mode: createSL(["Scroll", "Static"] as const, {
|
||||
saveable: {
|
||||
key: "bg-mode",
|
||||
mode: "localStorage",
|
||||
},
|
||||
defaultIndex: 0,
|
||||
}),
|
||||
opacity: createSL(
|
||||
[
|
||||
{
|
||||
text: "Strong",
|
||||
value: 0.0444,
|
||||
},
|
||||
{
|
||||
text: "Normal",
|
||||
value: 0.0333,
|
||||
},
|
||||
{
|
||||
text: "Light",
|
||||
value: 0.0222,
|
||||
},
|
||||
{
|
||||
text: "Subtle",
|
||||
value: 0.0111,
|
||||
},
|
||||
] as const,
|
||||
{
|
||||
saveable: {
|
||||
key: "bg-text-opacity",
|
||||
mode: "localStorage",
|
||||
},
|
||||
defaultIndex: 2,
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const preferredSystemTheme = createPreferredColorSchemeAccessor();
|
||||
|
||||
createEffect(() => {
|
||||
if (
|
||||
userConfig.settings.appTheme.selected() === "Dark" ||
|
||||
(userConfig.settings.appTheme.selected() === "System" &&
|
||||
preferredSystemTheme() === "dark")
|
||||
) {
|
||||
dark.set(true);
|
||||
document.documentElement.classList.add("dark");
|
||||
} else {
|
||||
dark.set(false);
|
||||
document.documentElement.classList.remove("dark");
|
||||
}
|
||||
});
|
||||
|
||||
return userConfig;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { createRWS } from "./rws";
|
||||
|
||||
type ColorScheme = "light" | "dark";
|
||||
|
||||
export function createPreferredColorSchemeAccessor() {
|
||||
const preferredColorSchemeMatchMedia = window.matchMedia(
|
||||
"(prefers-color-scheme: dark)",
|
||||
);
|
||||
|
||||
const preferredColorScheme = createRWS<ColorScheme>(
|
||||
preferredColorSchemeMatchMedia.matches ? "dark" : "light",
|
||||
);
|
||||
|
||||
function preferredColorSchemeListener(event: MediaQueryListEvent) {
|
||||
return preferredColorScheme.set(event.matches ? "dark" : "light");
|
||||
}
|
||||
|
||||
preferredColorSchemeMatchMedia.addEventListener(
|
||||
"change",
|
||||
preferredColorSchemeListener,
|
||||
);
|
||||
|
||||
onCleanup(() => {
|
||||
preferredColorSchemeMatchMedia.removeEventListener(
|
||||
"change",
|
||||
preferredColorSchemeListener,
|
||||
);
|
||||
});
|
||||
|
||||
return preferredColorScheme satisfies Accessor<ColorScheme>;
|
||||
}
|
||||
Reference in New Issue
Block a user