accessify-widget 0.3.11 → 0.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accessify.min.js +1 -1
- package/dist/accessify.min.js.map +1 -1
- package/dist/accessify.mjs +1 -1
- package/dist/{index-CK-JGSFG.js → index-CWccrgpi.js} +128 -75
- package/dist/{index-CK-JGSFG.js.map → index-CWccrgpi.js.map} +1 -1
- package/dist/{keyboard-nav-BK_UYLtc.js → keyboard-nav-DX2xdXSe.js} +2 -2
- package/dist/{keyboard-nav-BK_UYLtc.js.map → keyboard-nav-DX2xdXSe.js.map} +1 -1
- package/dist/loader.min.js +1 -1
- package/dist/{page-structure-C7f5kvRE.js → page-structure-tjDPoRal.js} +2 -2
- package/dist/{page-structure-C7f5kvRE.js.map → page-structure-tjDPoRal.js.map} +1 -1
- package/dist/{text-size-C6OFhCGi.js → text-size-m_mHNPWo.js} +3 -3
- package/dist/text-size-m_mHNPWo.js.map +1 -0
- package/dist/widget.js +1 -1
- package/dist/widget.js.map +1 -1
- package/package.json +1 -1
- package/dist/text-size-C6OFhCGi.js.map +0 -1
package/dist/accessify.mjs
CHANGED
|
@@ -76,6 +76,10 @@ const STALE_REACTION = new class StaleReactionError extends Error {
|
|
|
76
76
|
__publicField(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
|
|
77
77
|
}
|
|
78
78
|
}();
|
|
79
|
+
const IS_XHTML = (
|
|
80
|
+
// We gotta write it like this because after downleveling the pure comment may end up in the wrong location
|
|
81
|
+
!!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml")
|
|
82
|
+
);
|
|
79
83
|
function invariant_violation(message) {
|
|
80
84
|
if (DEV) {
|
|
81
85
|
const error = new Error(`invariant_violation
|
|
@@ -4289,6 +4293,17 @@ function set_style(dom, value, prev_styles, next_styles) {
|
|
|
4289
4293
|
}
|
|
4290
4294
|
const IS_CUSTOM_ELEMENT = Symbol("is custom element");
|
|
4291
4295
|
const IS_HTML = Symbol("is html");
|
|
4296
|
+
const PROGRESS_TAG = IS_XHTML ? "progress" : "PROGRESS";
|
|
4297
|
+
function set_value(element, value) {
|
|
4298
|
+
var attributes = get_attributes(element);
|
|
4299
|
+
if (attributes.value === (attributes.value = // treat null and undefined the same for the initial value
|
|
4300
|
+
value ?? void 0) || // @ts-expect-error
|
|
4301
|
+
// `progress` elements always need their value set when it's `0`
|
|
4302
|
+
element.value === value && (value !== 0 || element.nodeName !== PROGRESS_TAG)) {
|
|
4303
|
+
return;
|
|
4304
|
+
}
|
|
4305
|
+
element.value = value ?? "";
|
|
4306
|
+
}
|
|
4292
4307
|
function set_attribute(element, attribute, value, skip_warning) {
|
|
4293
4308
|
var attributes = get_attributes(element);
|
|
4294
4309
|
if (attributes[attribute] === (attributes[attribute] = value)) return;
|
|
@@ -4754,7 +4769,7 @@ const deJson = {
|
|
|
4754
4769
|
"profile.adhdFriendly.desc": "Ablenkungen reduzieren und Fokus verbessern",
|
|
4755
4770
|
"feature.contrast": "Kontrast",
|
|
4756
4771
|
"feature.contrast.desc": "Kontrast erhöhen für bessere Lesbarkeit",
|
|
4757
|
-
"feature.textSize": "
|
|
4772
|
+
"feature.textSize": "Textgröße",
|
|
4758
4773
|
"feature.textSize.desc": "Text vergrößern oder verkleinern",
|
|
4759
4774
|
"feature.spacing": "Textabstand",
|
|
4760
4775
|
"feature.spacing.desc": "Abstände zwischen Buchstaben und Zeilen anpassen",
|
|
@@ -4843,7 +4858,7 @@ const enJson = {
|
|
|
4843
4858
|
"profile.adhdFriendly.desc": "Reduce distractions and improve focus",
|
|
4844
4859
|
"feature.contrast": "Contrast",
|
|
4845
4860
|
"feature.contrast.desc": "Increase contrast for better readability",
|
|
4846
|
-
"feature.textSize": "
|
|
4861
|
+
"feature.textSize": "Text Size",
|
|
4847
4862
|
"feature.textSize.desc": "Increase or decrease text size",
|
|
4848
4863
|
"feature.spacing": "Text Spacing",
|
|
4849
4864
|
"feature.spacing.desc": "Adjust letter and line spacing",
|
|
@@ -6325,7 +6340,7 @@ Return ONLY the simplified text.`;
|
|
|
6325
6340
|
}
|
|
6326
6341
|
var root_2$1 = /* @__PURE__ */ from_html(`<button class="accessify-chip accessify-chip--icon"><span class="accessify-chip-icon" aria-hidden="true"></span> <span> </span></button>`);
|
|
6327
6342
|
var root_1$2 = /* @__PURE__ */ from_html(`<div class="accessify-control-row" role="group"><div class="accessify-control-label"><span class="accessify-control-label-icon" aria-hidden="true"></span> <span class="accessify-control-label-text"> </span></div> <div class="accessify-chip-row"></div></div>`);
|
|
6328
|
-
var root_3$1 = /* @__PURE__ */ from_html(`<div class="accessify-control-row" role="group"><div class="accessify-control-label"><span class="accessify-control-label-icon" aria-hidden="true"></span> <span class="accessify-control-label-text"> </span></div> <div class="accessify-
|
|
6343
|
+
var root_3$1 = /* @__PURE__ */ from_html(`<div class="accessify-control-row" role="group"><div class="accessify-control-label"><span class="accessify-control-label-icon" aria-hidden="true"></span> <span class="accessify-control-label-text"> </span></div> <div class="accessify-slider-wrap"><button class="accessify-stepper-btn" aria-label="Decrease text size">−</button> <input type="range" class="accessify-slider"/> <button class="accessify-stepper-btn" aria-label="Increase text size">+</button> <span class="accessify-stepper-value" aria-live="polite"> </span></div></div>`);
|
|
6329
6344
|
var root_5 = /* @__PURE__ */ from_html(`<div class="accessify-card-wrap"><button class="accessify-card" role="switch"><span class="accessify-card-icon" aria-hidden="true"></span> <span class="accessify-card-label"> </span></button> <span class="accessify-card-info" tabindex="0"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg> <span class="accessify-card-tooltip"> </span></span></div>`);
|
|
6330
6345
|
var root_4 = /* @__PURE__ */ from_html(`<div class="accessify-features"></div>`);
|
|
6331
6346
|
var root$2 = /* @__PURE__ */ from_html(`<!> <!> <div class="accessify-section-divider"></div> <!>`, 1);
|
|
@@ -6425,22 +6440,22 @@ function FeatureGrid($$anchor, $$props) {
|
|
|
6425
6440
|
icon: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 2v20"/><path d="M12 2a10 10 0 0 1 0 20" fill="currentColor"/></svg>'
|
|
6426
6441
|
}
|
|
6427
6442
|
];
|
|
6428
|
-
const TEXT_SIZE_MIN =
|
|
6443
|
+
const TEXT_SIZE_MIN = 75;
|
|
6429
6444
|
const TEXT_SIZE_MAX = 200;
|
|
6430
|
-
const TEXT_SIZE_STEP =
|
|
6445
|
+
const TEXT_SIZE_STEP = 5;
|
|
6431
6446
|
const AI_FEATURES = /* @__PURE__ */ new Set(["text-simplify", "alt-text"]);
|
|
6432
6447
|
const loadedModules = /* @__PURE__ */ new Map();
|
|
6433
6448
|
const FEATURE_LOADERS = {
|
|
6434
6449
|
contrast: () => import("./contrast-CqsICAkU.js"),
|
|
6435
|
-
"text-size": () => import("./text-size-
|
|
6436
|
-
"keyboard-nav": () => import("./keyboard-nav-
|
|
6450
|
+
"text-size": () => import("./text-size-m_mHNPWo.js"),
|
|
6451
|
+
"keyboard-nav": () => import("./keyboard-nav-DX2xdXSe.js"),
|
|
6437
6452
|
"link-highlight": () => import("./link-highlight-DBGm067Y.js"),
|
|
6438
6453
|
"reading-guide": () => import("./reading-guide-VT8NciIL.js"),
|
|
6439
6454
|
"reading-mask": () => import("./reading-mask-BABChuCz.js"),
|
|
6440
6455
|
"animation-stop": () => import("./animation-stop-C0MwseK0.js"),
|
|
6441
6456
|
"hide-images": () => import("./hide-images-B_LeCBcd.js"),
|
|
6442
6457
|
"big-cursor": () => import("./big-cursor-B2UKu9dQ.js"),
|
|
6443
|
-
"page-structure": () => import("./page-structure-
|
|
6458
|
+
"page-structure": () => import("./page-structure-tjDPoRal.js"),
|
|
6444
6459
|
tts: () => import("./tts-CjszLRnb.js"),
|
|
6445
6460
|
"text-simplify": () => import("./text-simplify-Cvhpio7g.js"),
|
|
6446
6461
|
"alt-text": () => Promise.resolve().then(() => altText)
|
|
@@ -6485,6 +6500,7 @@ function FeatureGrid($$anchor, $$props) {
|
|
|
6485
6500
|
}
|
|
6486
6501
|
if (id === "text-size") {
|
|
6487
6502
|
set(textSize, typeof state2.value === "number" ? state2.value : 100, true);
|
|
6503
|
+
$$props.ontextsize?.(get(textSize));
|
|
6488
6504
|
}
|
|
6489
6505
|
}
|
|
6490
6506
|
function handleReset() {
|
|
@@ -6496,6 +6512,7 @@ function FeatureGrid($$anchor, $$props) {
|
|
|
6496
6512
|
}
|
|
6497
6513
|
set(contrastMode, "off");
|
|
6498
6514
|
set(textSize, 100);
|
|
6515
|
+
$$props.ontextsize?.(100);
|
|
6499
6516
|
}
|
|
6500
6517
|
if (typeof window !== "undefined") {
|
|
6501
6518
|
window.addEventListener("accessify:reset", handleReset);
|
|
@@ -6568,12 +6585,14 @@ function FeatureGrid($$anchor, $$props) {
|
|
|
6568
6585
|
module.deactivate();
|
|
6569
6586
|
set(textSize, 100);
|
|
6570
6587
|
$$props.ontoggle("text-size", false);
|
|
6588
|
+
$$props.ontextsize?.(100);
|
|
6571
6589
|
return;
|
|
6572
6590
|
}
|
|
6573
6591
|
if (!module.getState().enabled) module.activate();
|
|
6574
6592
|
module.setState?.(value);
|
|
6575
6593
|
set(textSize, value, true);
|
|
6576
6594
|
$$props.ontoggle("text-size", true);
|
|
6595
|
+
$$props.ontextsize?.(value);
|
|
6577
6596
|
}
|
|
6578
6597
|
let visualFeatures = /* @__PURE__ */ user_derived(() => getVisibleFeatures(VISUAL_IDS));
|
|
6579
6598
|
let readingFeatures = /* @__PURE__ */ user_derived(() => getVisibleFeatures(READING_IDS));
|
|
@@ -6638,23 +6657,35 @@ function FeatureGrid($$anchor, $$props) {
|
|
|
6638
6657
|
var text_2 = child(span_5);
|
|
6639
6658
|
var div_5 = sibling(div_4, 2);
|
|
6640
6659
|
var button_1 = child(div_5);
|
|
6641
|
-
var
|
|
6660
|
+
var input = sibling(button_1, 2);
|
|
6661
|
+
set_attribute(input, "min", TEXT_SIZE_MIN);
|
|
6662
|
+
set_attribute(input, "max", TEXT_SIZE_MAX);
|
|
6663
|
+
set_attribute(input, "step", TEXT_SIZE_STEP);
|
|
6664
|
+
set_attribute(input, "aria-valuemin", TEXT_SIZE_MIN);
|
|
6665
|
+
set_attribute(input, "aria-valuemax", TEXT_SIZE_MAX);
|
|
6666
|
+
var button_2 = sibling(input, 2);
|
|
6667
|
+
var span_6 = sibling(button_2, 2);
|
|
6642
6668
|
var text_3 = child(span_6);
|
|
6643
|
-
var button_2 = sibling(span_6, 2);
|
|
6644
6669
|
template_effect(
|
|
6645
|
-
($0, $1) => {
|
|
6670
|
+
($0, $1, $2) => {
|
|
6646
6671
|
set_attribute(div_3, "aria-label", $0);
|
|
6647
6672
|
set_text(text_2, $1);
|
|
6648
6673
|
button_1.disabled = get(textSize) <= TEXT_SIZE_MIN;
|
|
6649
|
-
|
|
6674
|
+
set_value(input, get(textSize));
|
|
6675
|
+
set_attribute(input, "aria-label", $2);
|
|
6676
|
+
set_attribute(input, "aria-valuenow", get(textSize));
|
|
6677
|
+
set_attribute(input, "aria-valuetext", `${get(textSize) ?? ""}%`);
|
|
6650
6678
|
button_2.disabled = get(textSize) >= TEXT_SIZE_MAX;
|
|
6679
|
+
set_text(text_3, `${get(textSize) ?? ""}%`);
|
|
6651
6680
|
},
|
|
6652
6681
|
[
|
|
6682
|
+
() => t("feature.textSize", $$props.config.lang),
|
|
6653
6683
|
() => t("feature.textSize", $$props.config.lang),
|
|
6654
6684
|
() => t("feature.textSize", $$props.config.lang)
|
|
6655
6685
|
]
|
|
6656
6686
|
);
|
|
6657
6687
|
delegated("click", button_1, () => setTextSize(Math.max(TEXT_SIZE_MIN, get(textSize) - TEXT_SIZE_STEP)));
|
|
6688
|
+
delegated("input", input, (e) => setTextSize(Number(e.target.value)));
|
|
6658
6689
|
delegated("click", button_2, () => setTextSize(Math.min(TEXT_SIZE_MAX, get(textSize) + TEXT_SIZE_STEP)));
|
|
6659
6690
|
append($$anchor2, div_3);
|
|
6660
6691
|
};
|
|
@@ -6716,7 +6747,7 @@ function FeatureGrid($$anchor, $$props) {
|
|
|
6716
6747
|
append($$anchor, fragment);
|
|
6717
6748
|
pop();
|
|
6718
6749
|
}
|
|
6719
|
-
delegate(["click"]);
|
|
6750
|
+
delegate(["click", "input"]);
|
|
6720
6751
|
var root_1$1 = /* @__PURE__ */ from_html(`<span aria-hidden="true">·</span> <a target="_blank" rel="noopener noreferrer"> </a>`, 1);
|
|
6721
6752
|
var root$1 = /* @__PURE__ */ from_html(`<div class="accessify-footer"><div class="accessify-footer-links"><a target="_blank" rel="noopener noreferrer">Accessify Dashboard</a> <!></div> <button class="accessify-footer-close"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg> <span> </span></button></div>`);
|
|
6722
6753
|
function PanelFooter($$anchor, $$props) {
|
|
@@ -7142,6 +7173,7 @@ function WidgetApp($$anchor, $$props) {
|
|
|
7142
7173
|
let activeProfileId = /* @__PURE__ */ state(null);
|
|
7143
7174
|
let langDropdownOpen = /* @__PURE__ */ state(false);
|
|
7144
7175
|
let panelX = /* @__PURE__ */ state(null);
|
|
7176
|
+
let widgetZoom = /* @__PURE__ */ state(1);
|
|
7145
7177
|
const PANEL_X_KEY = "accessify-panel-x";
|
|
7146
7178
|
const textTransformService = createTextTransformService();
|
|
7147
7179
|
const STORAGE_KEY = "accessify-prefs";
|
|
@@ -7258,11 +7290,20 @@ function WidgetApp($$anchor, $$props) {
|
|
|
7258
7290
|
const action = enabled ? t("status.activated", get(widgetLang)) : t("status.deactivated", get(widgetLang));
|
|
7259
7291
|
announce(`${name} ${action}`);
|
|
7260
7292
|
}
|
|
7293
|
+
function handleTextSize(size) {
|
|
7294
|
+
const factor = size / 100;
|
|
7295
|
+
set(widgetZoom, Math.min(1.35, Math.max(0.85, factor)), true);
|
|
7296
|
+
const mount2 = $$props.shadow.getElementById("accessify-mount");
|
|
7297
|
+
if (mount2) {
|
|
7298
|
+
mount2.style.zoom = get(widgetZoom) === 1 ? "" : String(get(widgetZoom));
|
|
7299
|
+
}
|
|
7300
|
+
}
|
|
7261
7301
|
function resetAll() {
|
|
7262
7302
|
set(activeFeatures, /* @__PURE__ */ new Map(), true);
|
|
7263
7303
|
set(activeProfileId, null);
|
|
7264
7304
|
savePrefs();
|
|
7265
7305
|
textTransformService.restore();
|
|
7306
|
+
handleTextSize(100);
|
|
7266
7307
|
window.dispatchEvent(new CustomEvent("accessify:reset"));
|
|
7267
7308
|
announce(t("widget.resetConfirm", get(widgetLang)));
|
|
7268
7309
|
}
|
|
@@ -7422,7 +7463,8 @@ function WidgetApp($$anchor, $$props) {
|
|
|
7422
7463
|
get activeFeatures() {
|
|
7423
7464
|
return get(activeFeatures);
|
|
7424
7465
|
},
|
|
7425
|
-
ontoggle: handleFeatureToggle
|
|
7466
|
+
ontoggle: handleFeatureToggle,
|
|
7467
|
+
ontextsize: handleTextSize
|
|
7426
7468
|
});
|
|
7427
7469
|
}
|
|
7428
7470
|
var node_7 = sibling(div_2, 2);
|
|
@@ -7766,6 +7808,29 @@ function createWidgetStyles(config2) {
|
|
|
7766
7808
|
font-size: 13px; font-weight: 600; color: var(--text); user-select: none;
|
|
7767
7809
|
}
|
|
7768
7810
|
|
|
7811
|
+
/* Text Size slider */
|
|
7812
|
+
.accessify-slider-wrap {
|
|
7813
|
+
display: flex; align-items: center; gap: 8px;
|
|
7814
|
+
}
|
|
7815
|
+
.accessify-slider {
|
|
7816
|
+
flex: 1; height: 6px; -webkit-appearance: none; appearance: none;
|
|
7817
|
+
background: var(--surface-dim); border-radius: 3px; outline: none;
|
|
7818
|
+
cursor: pointer; border: none; margin: 0;
|
|
7819
|
+
}
|
|
7820
|
+
.accessify-slider::-webkit-slider-thumb {
|
|
7821
|
+
-webkit-appearance: none; appearance: none;
|
|
7822
|
+
width: 18px; height: 18px; border-radius: 50%;
|
|
7823
|
+
background: var(--accent); cursor: pointer;
|
|
7824
|
+
border: 2px solid var(--surface-card);
|
|
7825
|
+
box-shadow: 0 1px 4px rgba(0,0,0,0.3);
|
|
7826
|
+
}
|
|
7827
|
+
.accessify-slider::-moz-range-thumb {
|
|
7828
|
+
width: 18px; height: 18px; border-radius: 50%;
|
|
7829
|
+
background: var(--accent); cursor: pointer;
|
|
7830
|
+
border: 2px solid var(--surface-card);
|
|
7831
|
+
box-shadow: 0 1px 4px rgba(0,0,0,0.3);
|
|
7832
|
+
}
|
|
7833
|
+
|
|
7769
7834
|
/* ─── Feature Cards (2-column grid) ─── */
|
|
7770
7835
|
.accessify-features {
|
|
7771
7836
|
display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap);
|
|
@@ -8163,74 +8228,74 @@ function createAltTextModule(aiService, initialLang = "de", serverConfig) {
|
|
|
8163
8228
|
});
|
|
8164
8229
|
}
|
|
8165
8230
|
const BADGE_ATTR = "data-accessify-badge";
|
|
8231
|
+
const WRAPPER_ATTR = "data-accessify-badge-wrap";
|
|
8166
8232
|
function addInfoBadge(target, altText2) {
|
|
8167
8233
|
if (target.getAttribute(BADGE_ATTR)) return;
|
|
8168
|
-
const rect = target.getBoundingClientRect();
|
|
8169
|
-
if (rect.width < 40 || rect.height < 40) {
|
|
8170
|
-
if (target.tagName === "IMG") {
|
|
8171
|
-
const obs = new IntersectionObserver((entries) => {
|
|
8172
|
-
for (const entry of entries) {
|
|
8173
|
-
if (entry.isIntersecting && entry.boundingClientRect.width >= 40) {
|
|
8174
|
-
obs.disconnect();
|
|
8175
|
-
if (enabled && !target.getAttribute(BADGE_ATTR)) {
|
|
8176
|
-
addInfoBadge(target, altText2);
|
|
8177
|
-
}
|
|
8178
|
-
}
|
|
8179
|
-
}
|
|
8180
|
-
});
|
|
8181
|
-
obs.observe(target);
|
|
8182
|
-
setTimeout(() => obs.disconnect(), 3e4);
|
|
8183
|
-
}
|
|
8184
|
-
return;
|
|
8185
|
-
}
|
|
8186
8234
|
target.setAttribute(BADGE_ATTR, "1");
|
|
8187
|
-
const
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
|
|
8193
|
-
|
|
8194
|
-
|
|
8195
|
-
|
|
8196
|
-
|
|
8235
|
+
const isImg = target.tagName === "IMG";
|
|
8236
|
+
let anchor;
|
|
8237
|
+
if (isImg) {
|
|
8238
|
+
const wrapper = document.createElement("span");
|
|
8239
|
+
wrapper.setAttribute(WRAPPER_ATTR, "1");
|
|
8240
|
+
Object.assign(wrapper.style, {
|
|
8241
|
+
position: "relative",
|
|
8242
|
+
display: "inline-block",
|
|
8243
|
+
lineHeight: "0"
|
|
8244
|
+
});
|
|
8245
|
+
target.parentElement.insertBefore(wrapper, target);
|
|
8246
|
+
wrapper.appendChild(target);
|
|
8247
|
+
anchor = wrapper;
|
|
8248
|
+
} else {
|
|
8249
|
+
const pos = getComputedStyle(target).position;
|
|
8250
|
+
if (pos === "static") target.style.position = "relative";
|
|
8251
|
+
anchor = target;
|
|
8252
|
+
}
|
|
8253
|
+
const badge = document.createElement("span");
|
|
8197
8254
|
Object.assign(badge.style, {
|
|
8198
|
-
|
|
8199
|
-
|
|
8255
|
+
position: "absolute",
|
|
8256
|
+
top: "6px",
|
|
8257
|
+
left: "6px",
|
|
8258
|
+
width: "22px",
|
|
8259
|
+
height: "22px",
|
|
8200
8260
|
borderRadius: "50%",
|
|
8201
8261
|
background: "rgba(0,0,0,0.6)",
|
|
8202
8262
|
color: "#fff",
|
|
8203
8263
|
fontFamily: "sans-serif",
|
|
8204
8264
|
fontWeight: "bold",
|
|
8205
|
-
fontSize: "
|
|
8206
|
-
lineHeight: "
|
|
8265
|
+
fontSize: "13px",
|
|
8266
|
+
lineHeight: "22px",
|
|
8207
8267
|
textAlign: "center",
|
|
8208
8268
|
cursor: "default",
|
|
8269
|
+
zIndex: "10000",
|
|
8270
|
+
pointerEvents: "auto",
|
|
8209
8271
|
boxShadow: "0 1px 4px rgba(0,0,0,0.4)",
|
|
8210
8272
|
transition: "background 0.15s"
|
|
8211
8273
|
});
|
|
8212
8274
|
badge.textContent = "i";
|
|
8213
8275
|
badge.setAttribute("aria-hidden", "true");
|
|
8214
|
-
|
|
8276
|
+
badge.setAttribute(BADGE_ATTR, "badge");
|
|
8277
|
+
const tooltip = document.createElement("span");
|
|
8215
8278
|
Object.assign(tooltip.style, {
|
|
8216
8279
|
display: "none",
|
|
8217
8280
|
position: "absolute",
|
|
8218
|
-
top: "
|
|
8219
|
-
left: "
|
|
8220
|
-
minWidth: "
|
|
8221
|
-
maxWidth: "
|
|
8222
|
-
padding: "
|
|
8281
|
+
top: "32px",
|
|
8282
|
+
left: "6px",
|
|
8283
|
+
minWidth: "150px",
|
|
8284
|
+
maxWidth: "280px",
|
|
8285
|
+
padding: "6px 10px",
|
|
8223
8286
|
background: "rgba(0,0,0,0.88)",
|
|
8224
8287
|
color: "#fff",
|
|
8225
8288
|
fontFamily: "sans-serif",
|
|
8226
8289
|
fontSize: "12px",
|
|
8227
8290
|
lineHeight: "1.4",
|
|
8228
8291
|
borderRadius: "6px",
|
|
8292
|
+
zIndex: "10001",
|
|
8229
8293
|
pointerEvents: "none",
|
|
8230
8294
|
wordWrap: "break-word",
|
|
8231
8295
|
boxShadow: "0 2px 8px rgba(0,0,0,0.3)"
|
|
8232
8296
|
});
|
|
8233
8297
|
tooltip.textContent = altText2;
|
|
8298
|
+
tooltip.setAttribute(BADGE_ATTR, "tooltip");
|
|
8234
8299
|
badge.addEventListener("mouseenter", () => {
|
|
8235
8300
|
badge.style.background = "rgba(0,0,0,0.85)";
|
|
8236
8301
|
tooltip.style.display = "block";
|
|
@@ -8239,31 +8304,19 @@ function createAltTextModule(aiService, initialLang = "de", serverConfig) {
|
|
|
8239
8304
|
badge.style.background = "rgba(0,0,0,0.6)";
|
|
8240
8305
|
tooltip.style.display = "none";
|
|
8241
8306
|
});
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
document.body.appendChild(container);
|
|
8245
|
-
const updatePos = () => {
|
|
8246
|
-
const r = target.getBoundingClientRect();
|
|
8247
|
-
container.style.top = `${r.top + 6}px`;
|
|
8248
|
-
container.style.left = `${r.left + 6}px`;
|
|
8249
|
-
container.style.display = r.bottom < 0 || r.top > window.innerHeight ? "none" : "";
|
|
8250
|
-
};
|
|
8251
|
-
const scrollHandler = () => requestAnimationFrame(updatePos);
|
|
8252
|
-
window.addEventListener("scroll", scrollHandler, { passive: true });
|
|
8253
|
-
window.addEventListener("resize", scrollHandler, { passive: true });
|
|
8254
|
-
container._cleanup = () => {
|
|
8255
|
-
window.removeEventListener("scroll", scrollHandler);
|
|
8256
|
-
window.removeEventListener("resize", scrollHandler);
|
|
8257
|
-
};
|
|
8307
|
+
anchor.appendChild(badge);
|
|
8308
|
+
anchor.appendChild(tooltip);
|
|
8258
8309
|
}
|
|
8259
8310
|
function removeAllBadges() {
|
|
8260
|
-
document.querySelectorAll(
|
|
8261
|
-
|
|
8262
|
-
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
|
|
8311
|
+
document.querySelectorAll(`[${WRAPPER_ATTR}]`).forEach((wrapper) => {
|
|
8312
|
+
const img = wrapper.querySelector("img");
|
|
8313
|
+
if (img && wrapper.parentElement) {
|
|
8314
|
+
wrapper.parentElement.insertBefore(img, wrapper);
|
|
8315
|
+
wrapper.remove();
|
|
8316
|
+
}
|
|
8266
8317
|
});
|
|
8318
|
+
document.querySelectorAll(`[${BADGE_ATTR}="badge"], [${BADGE_ATTR}="tooltip"]`).forEach((el) => el.remove());
|
|
8319
|
+
document.querySelectorAll(`[${BADGE_ATTR}]`).forEach((el) => el.removeAttribute(BADGE_ATTR));
|
|
8267
8320
|
}
|
|
8268
8321
|
function addBadgesToAllImages() {
|
|
8269
8322
|
document.querySelectorAll("img").forEach((img) => {
|
|
@@ -8708,4 +8761,4 @@ export {
|
|
|
8708
8761
|
init as i,
|
|
8709
8762
|
t
|
|
8710
8763
|
};
|
|
8711
|
-
//# sourceMappingURL=index-
|
|
8764
|
+
//# sourceMappingURL=index-CWccrgpi.js.map
|