{"version":3,"file":"Highlight_Text.kl9LP7DC.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/ua1ASDRkre9P07ISe1QH/yUli04mJ89ryx0cldLfZ/Highlight_Text.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";export function withHighlightColor1(Component){return props=>{const[isVisible,setIsVisible]=useState(false);useEffect(()=>{const elements=document.querySelectorAll(`.${props.className} [style*=\"--framer-text-decoration\"]`);// Now, let's add a parent <mark> tag to the selected elements\nelements.forEach(element=>{element.style.removeProperty(\"--framer-text-decoration\");const markElement=document.createElement(\"mark\");const spanElement=document.createElement(\"span\");// Wrap the element with mark\nelement.parentNode.insertBefore(markElement,element);markElement.appendChild(element);// Wrap the content of the element with span\nwhile(element.firstChild){spanElement.appendChild(element.firstChild);}element.appendChild(spanElement);setIsVisible(true);});const handle=entries=>{entries.forEach(entry=>{const highlightedValue=entry.target.style.getPropertyValue(\"--highlighted\");console.log(\"handle\");if(!highlightedValue||parseInt(highlightedValue)===0){entry.target.style.setProperty(\"--highlighted\",entry.isIntersecting?\"1\":\"0\");}});};const observer=new IntersectionObserver(handle,{threshold:1});elements.forEach(M=>observer.observe(M));},[props]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n.${props.className} mark {\n--highlighted: 0;\n--highlight: rgba(236, 244, 10, 0.5);\nbackground: transparent;\n}\n\n.${props.className} mark span {\nbackground: linear-gradient(120deg, var(--highlight) 50%, transparent 50%) 110% 0 / 200% 100% no-repeat;\nbackground-position: calc((1 - var(--highlighted)) * 110%) 0;\ntransition: background-position 1s;\ncolor: black;\n}\n`}),/*#__PURE__*/_jsx(Component,{...props,style:!isVisible?{opacity:0}:{}})]});};}export function withHighlightColor2(Component){return props=>{const[isVisible,setIsVisible]=useState(false);useEffect(()=>{const elements=document.querySelectorAll(`.${props.className} [style*=\"--framer-text-decoration\"]`);// Now, let's add a parent <mark> tag to the selected elements\nelements.forEach(element=>{element.style.removeProperty(\"--framer-text-decoration\");const markElement=document.createElement(\"mark\");const spanElement=document.createElement(\"span\");// Wrap the element with mark\nelement.parentNode.insertBefore(markElement,element);markElement.appendChild(element);// Wrap the content of the element with span\nwhile(element.firstChild){spanElement.appendChild(element.firstChild);}element.appendChild(spanElement);setIsVisible(true);});const handle=entries=>{entries.forEach(entry=>{const highlightedValue=entry.target.style.getPropertyValue(\"--highlighted\");if(!highlightedValue||parseInt(highlightedValue)===0){entry.target.style.setProperty(\"--highlighted\",entry.isIntersecting?\"1\":\"0\");}});};const observer=new IntersectionObserver(handle,{threshold:1});elements.forEach(M=>observer.observe(M));},[props]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n.${props.className} mark {\n--highlighted: 0;\n--highlight: rgba(255, 195, 0, 0.8);\nbackground: transparent;\n}\n\n.${props.className} mark span {\nbackground: linear-gradient(120deg, var(--highlight) 50%, transparent 50%) 110% 0 / 200% 100% no-repeat;\nbackground-position: calc((1 - var(--highlighted)) * 110%) 0;\ntransition: background-position 1s;\ncolor: black;\n}\n`}),/*#__PURE__*/_jsx(Component,{...props,style:!isVisible?{opacity:0}:{}})]});};}export function withHighlightColor3(Component){return props=>{const[isVisible,setIsVisible]=useState(false);useEffect(()=>{const elements=document.querySelectorAll(`.${props.className} [style*=\"--framer-text-decoration\"]`);// Now, let's add a parent <mark> tag to the selected elements\nelements.forEach(element=>{element.style.removeProperty(\"--framer-text-decoration\");const markElement=document.createElement(\"mark\");const spanElement=document.createElement(\"span\");// Wrap the element with mark\nelement.parentNode.insertBefore(markElement,element);markElement.appendChild(element);// Wrap the content of the element with span\nwhile(element.firstChild){spanElement.appendChild(element.firstChild);}element.appendChild(spanElement);setIsVisible(true);});const handle=entries=>{entries.forEach(entry=>{const highlightedValue=entry.target.style.getPropertyValue(\"--highlighted\");if(!highlightedValue||parseInt(highlightedValue)===0){entry.target.style.setProperty(\"--highlighted\",entry.isIntersecting?\"1\":\"0\");}});};const observer=new IntersectionObserver(handle,{threshold:1});elements.forEach(M=>observer.observe(M));},[props]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n.${props.className} mark {\n--highlighted: 0;\n--highlight: rgba(140, 0, 255, 0.5);\nbackground: transparent;\n}\n\n.${props.className} mark span {\nbackground: linear-gradient(120deg, var(--highlight) 50%, transparent 50%) 110% 0 / 200% 100% no-repeat;\nbackground-position: calc((1 - var(--highlighted)) * 110%) 0;\ntransition: background-position 1s;\ncolor: white;\n}\n`}),/*#__PURE__*/_jsx(Component,{...props,style:!isVisible?{opacity:0}:{}})]});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withHighlightColor1\":{\"type\":\"reactHoc\",\"name\":\"withHighlightColor1\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHighlightColor2\":{\"type\":\"reactHoc\",\"name\":\"withHighlightColor2\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHighlightColor3\":{\"type\":\"reactHoc\",\"name\":\"withHighlightColor3\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Highlight_Text.map"],"mappings":"uIAAqH,SAAgB,EAAoB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAU,GAAcA,EAAS,EAAK,EAG2S,OAHzS,MAAc,CAAC,IAAM,EAAS,SAAS,iBAAiB,IAAI,EAAM,UAAU,qCAAqC,EAClV,EAAS,QAAQ,GAAS,CAAC,EAAQ,MAAM,eAAe,0BAA0B,EAAE,IAAM,EAAY,SAAS,cAAc,MAAM,EAAQ,EAAY,SAAS,cAAc,MAAM,EAEpL,IADA,EAAQ,WAAW,aAAa,EAAY,CAAO,EAAE,EAAY,YAAY,CAAO,EAC9E,EAAQ,YAAY,EAAY,YAAY,EAAQ,UAAU,EAAG,EAAQ,YAAY,CAAW,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