website: redesign part 11

This commit is contained in:
nym21
2026-06-06 22:29:33 +02:00
parent 66dc7cd8f5
commit 041c542046
49 changed files with 17275 additions and 193 deletions
+10 -6
View File
@@ -29,20 +29,23 @@ export function createLegend() {
const separator = createSpan("|");
captureScroll(separator);
/** @type {HTMLElement | null} */
let prefix = null;
return {
element,
scroller,
/** @param {HTMLElement} el */
setPrefix(el) {
const prev = separator.previousSibling;
if (prev) {
prev.replaceWith(el);
} else {
scroller.prepend(el, separator);
}
prefix ? prefix.replaceWith(el) : scroller.prepend(el, separator);
prefix = el;
captureScroll(el);
},
clearPrefix() {
prefix?.remove();
prefix = null;
separator.remove();
},
};
}
@@ -76,6 +79,7 @@ export function createSeriesLegend() {
return {
element: legend.element,
setPrefix: legend.setPrefix,
clearPrefix: legend.clearPrefix,
/**
* @param {Object} args
* @param {AnySeries} args.series