mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-06-12 07:53:32 -07:00
website: big update
This commit is contained in:
+20
-14
@@ -372,12 +372,11 @@ export function init({
|
||||
|
||||
elements.legend.prepend(div);
|
||||
|
||||
const { input, label, spanMain } = utils.dom.createComplexLabeledInput({
|
||||
const { input, label } = utils.dom.createLabeledInput({
|
||||
inputId: `legend-${series.title}`,
|
||||
inputName: `selected-${series.title}${name}`,
|
||||
inputValue: "value",
|
||||
labelTitle: "Click to toggle",
|
||||
name: series.title,
|
||||
onClick: (event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
@@ -385,6 +384,14 @@ export function init({
|
||||
series.active.set(input.checked);
|
||||
},
|
||||
});
|
||||
|
||||
const spanMain = window.document.createElement("span");
|
||||
spanMain.classList.add("main");
|
||||
label.append(spanMain);
|
||||
|
||||
const spanName = utils.dom.createSpanName(series.title);
|
||||
spanMain.append(spanName);
|
||||
|
||||
div.append(label);
|
||||
label.addEventListener("mouseover", () => {
|
||||
const hovered = hoveredLegend();
|
||||
@@ -492,8 +499,7 @@ export function init({
|
||||
|
||||
const anchor = window.document.createElement("a");
|
||||
anchor.href = series.dataset.url;
|
||||
anchor.innerHTML = `<svg viewBox="0 0 16 16"><path d="M8.75 2.75a.75.75 0 0 0-1.5 0v5.69L5.03 6.22a.75.75 0 0 0-1.06 1.06l3.5 3.5a.75.75 0 0 0 1.06 0l3.5-3.5a.75.75 0 0 0-1.06-1.06L8.75 8.44V2.75Z" /><path d="M3.5 9.75a.75.75 0 0 0-1.5 0v1.5A2.75 2.75 0 0 0 4.75 14h6.5A2.75 2.75 0 0 0 14 11.25v-1.5a.75.75 0 0 0-1.5 0v1.5c0 .69-.56 1.25-1.25 1.25h-6.5c-.69 0-1.25-.56-1.25-1.25v-1.5Z" /></svg>`;
|
||||
anchor.target = "_target";
|
||||
anchor.target = "_blank";
|
||||
anchor.rel = "noopener noreferrer";
|
||||
div.append(anchor);
|
||||
}
|
||||
@@ -894,17 +900,17 @@ export function init({
|
||||
});
|
||||
});
|
||||
}
|
||||
initGoToButtons(elements.timeScaleDateButtons);
|
||||
initGoToButtons(elements.timeScaleHeightButtons);
|
||||
// initGoToButtons(elements.timeScaleDateButtons);
|
||||
// initGoToButtons(elements.timeScaleHeightButtons);
|
||||
|
||||
function createScaleButtonsToggleEffect() {
|
||||
const isDate = signals.createMemo(() => scale() === "date");
|
||||
signals.createEffect(isDate, (isDate) => {
|
||||
elements.timeScaleDateButtons.hidden = !isDate;
|
||||
elements.timeScaleHeightButtons.hidden = isDate;
|
||||
});
|
||||
}
|
||||
createScaleButtonsToggleEffect();
|
||||
// function createScaleButtonsToggleEffect() {
|
||||
// const isDate = signals.createMemo(() => scale() === "date");
|
||||
// signals.createEffect(isDate, (isDate) => {
|
||||
// elements.timeScaleDateButtons.hidden = !isDate;
|
||||
// elements.timeScaleHeightButtons.hidden = isDate;
|
||||
// });
|
||||
// }
|
||||
// createScaleButtonsToggleEffect();
|
||||
}
|
||||
initTimeScaleElement();
|
||||
|
||||
|
||||
+205
-886
File diff suppressed because it is too large
Load Diff
+370
-553
File diff suppressed because it is too large
Load Diff
@@ -17,9 +17,11 @@ self.addEventListener("install", (_event) => {
|
||||
"/scripts/options.js",
|
||||
"/scripts/chart.js",
|
||||
"/styles/chart.css",
|
||||
"/scripts/simulation.js",
|
||||
"/styles/simulation.css",
|
||||
"/packages/lean-qr/v2.3.4/script.js",
|
||||
"/packages/lightweight-charts/v4.2.0/script.js",
|
||||
"/packages/solid-signals/2024-11-01/script.js",
|
||||
"/packages/solid-signals/2024-11-02/script.js",
|
||||
"/packages/ufuzzy/v1.0.14/script.js",
|
||||
]);
|
||||
}),
|
||||
|
||||
Vendored
+22
-14
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
Accessor,
|
||||
Setter,
|
||||
} from "../../packages/solid-signals/2024-11-01/types/signals";
|
||||
} from "../../packages/solid-signals/2024-11-02/types/signals";
|
||||
import {
|
||||
DeepPartial,
|
||||
BaselineStyleOptions,
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
ISeriesApi,
|
||||
} from "../../packages/lightweight-charts/v4.2.0/types";
|
||||
import { DatePath, HeightPath, LastPath } from "./paths";
|
||||
import { Owner } from "../../packages/solid-signals/2024-11-01/types/core/owner";
|
||||
import { Owner } from "../../packages/solid-signals/2024-11-02/types/core/owner";
|
||||
import { AnyPossibleCohortId } from "../options";
|
||||
|
||||
type GrowToSize<T, N extends number, A extends T[]> = A["length"] extends N
|
||||
@@ -28,9 +28,6 @@ type FixedArray<T, N extends number> = GrowToSize<T, N, []>;
|
||||
|
||||
type Signal<T> = Accessor<T> & { set: Setter<T> };
|
||||
|
||||
type SettingsTheme = "system" | "dark" | "light";
|
||||
type FoldersFilter = "all" | "favorites" | "new";
|
||||
|
||||
type TimeScale = "date" | "height";
|
||||
|
||||
type TimeRange = Range<Time | number>;
|
||||
@@ -104,7 +101,7 @@ type Unit =
|
||||
| "Weight";
|
||||
|
||||
interface PartialOption {
|
||||
icon: string;
|
||||
// icon: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
@@ -135,7 +132,12 @@ interface PartialSimulationOption extends PartialOption {
|
||||
}
|
||||
|
||||
interface PartialPdfOption extends PartialOption {
|
||||
file: string;
|
||||
pdf: string;
|
||||
}
|
||||
|
||||
interface PartialUrlOption extends PartialOption {
|
||||
qrcode?: true;
|
||||
url: () => string;
|
||||
}
|
||||
|
||||
interface PartialOptionsGroup {
|
||||
@@ -147,7 +149,8 @@ type AnyPartialOption =
|
||||
| PartialHomeOption
|
||||
| PartialChartOption
|
||||
| PartialSimulationOption
|
||||
| PartialPdfOption;
|
||||
| PartialPdfOption
|
||||
| PartialUrlOption;
|
||||
|
||||
type PartialOptionsTree = (AnyPartialOption | PartialOptionsGroup)[];
|
||||
|
||||
@@ -155,8 +158,7 @@ interface ProcessedOptionAddons {
|
||||
id: string;
|
||||
path: OptionPath;
|
||||
serializedPath: string;
|
||||
isFavorite: Signal<boolean>;
|
||||
visited: Signal<boolean>;
|
||||
title: string;
|
||||
}
|
||||
|
||||
type OptionPath = {
|
||||
@@ -169,14 +171,22 @@ type SimulationOption = PartialSimulationOption & ProcessedOptionAddons;
|
||||
|
||||
interface PdfOption extends PartialPdfOption, ProcessedOptionAddons {
|
||||
kind: "pdf";
|
||||
title: string;
|
||||
}
|
||||
|
||||
interface UrlOption extends PartialUrlOption, ProcessedOptionAddons {
|
||||
kind: "url";
|
||||
}
|
||||
|
||||
interface ChartOption extends PartialChartOption, ProcessedOptionAddons {
|
||||
kind: "chart";
|
||||
}
|
||||
|
||||
type Option = HomeOption | PdfOption | ChartOption | SimulationOption;
|
||||
type Option =
|
||||
| HomeOption
|
||||
| PdfOption
|
||||
| UrlOption
|
||||
| ChartOption
|
||||
| SimulationOption;
|
||||
|
||||
type OptionsTree = (Option | OptionsGroup)[];
|
||||
|
||||
@@ -185,8 +195,6 @@ interface OptionsGroup extends PartialOptionsGroup {
|
||||
tree: OptionsTree;
|
||||
}
|
||||
|
||||
type SerializedHistory = [string, number][];
|
||||
|
||||
interface OHLC {
|
||||
open: number;
|
||||
high: number;
|
||||
|
||||
Reference in New Issue
Block a user