MCPcopy Create free account
hub / github.com/NMWplays/Glowify / useOutsideClick

Function useOutsideClick

theme.js:6009–6022  ·  view source on GitHub ↗
(open, onClose, refs)

Source from the content-addressed store, hash-verified

6007 const textWidth = inner.scrollWidth;
6008 const containerWidth = wrap.offsetWidth;
6009 wrap.style.overflow = origOverflow || "";
6010 if (textWidth > containerWidth && containerWidth > 0) {
6011 const gap = 48;
6012 const clone = textEl.cloneNode(true);
6013 clone.removeAttribute("data-uri");
6014 clone.style.pointerEvents = "none";
6015 clone.style.marginLeft = gap + "px";
6016 inner.appendChild(clone);
6017 const scrollDist = textWidth + gap;
6018 const duration = Math.max(5e3, scrollDist / 20 * 1e3);
6019 wrap.classList.add("nsc-scrolling");
6020 const anim = inner.animate(
6021 [
6022 { transform: "translateX(0)" },
6023 { transform: `translateX(-${scrollDist}px)` }
6024 ],
6025 {

Callers 2

ColorPickerFunction · 0.85
SelectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected