MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / getDataNumber

Function getDataNumber

src/content/Components/DomeGallery/DomeGallery.jsx:46–50  ·  view source on GitHub ↗
(el, name, fallback)

Source from the content-addressed store, hash-verified

44 return a - 180;
45};
46const getDataNumber = (el, name, fallback) => {
47 const attr = el.dataset[name] ?? el.getAttribute(`data-${name}`);
48 const n = attr == null ? NaN : parseFloat(attr);
49 return Number.isFinite(n) ? n : fallback;
50};
51
52function buildItems(pool, seg) {
53 const xCols = Array.from({ length: seg }, (_, i) => -37 + i * 2);

Callers 1

DomeGalleryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected