PluginProbe
UiCore Elements – Free widgets and templates for Elementor / trunk
UiCore Elements – Free widgets and templates for Elementor vtrunk
1.3.17 1.3.16 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 All 41 releases
uicore-elements / assets / js / elements / highlighted-text.js

highlighted-text.js in UiCore Elements – Free widgets and templates for Elementor trunk, at assets/js/elements/highlighted-text.js

1 lines 3.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 "use strict";function _createForOfIteratorHelper(e,t){var n,r,o,a,i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return o=!(r=!0),{s:function(){i=i.call(e)},n:function(){var e=i.next();return r=e.done,e},e:function(e){o=!0,n=e},f:function(){try{r||null==i.return||i.return()}finally{if(o)throw n}}};if(Array.isArray(e)||(i=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return i&&(e=i),a=0,{s:t=function(){},n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var n;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}jQuery(document).ready(function(){function e(){n&&cancelAnimationFrame(n),n=requestAnimationFrame(function(){return r()})}var t=document.querySelectorAll(".elementor-widget-highlighted-text.ui-e-a-animate .ui-e--highlighted-text"),n=null;function r(e){var e=0<arguments.length&&void 0!==e?e:{},t=e.headlineSelector,e=e.underlineSelector,s=void 0===e?".uicore-svg-wrapper":e;document.querySelectorAll(void 0===t?".ui-e-headline-highlighted":t).forEach(function(e){if(e){var t=e.nextElementSibling;if(t&&t.matches(s)){var n=t.parentNode,r=(n.querySelectorAll(".uicore-svg-wrapper--clone").forEach(function(e){return e.remove()}),function(e){var t=document.createRange();if(t.selectNodeContents(e),!(e=Array.from(t.getClientRects())).length)return[];var n,r=[],o=_createForOfIteratorHelper(e.sort(function(e,t){return e.top-t.top}));try{for(o.s();!(n=o.n()).done;){var a=n.value,i=Math.round(a.top),u=r[r.length-1];!u||3<Math.abs(Math.round(u.top)-i)?r.push({top:i,bottom:a.bottom,height:a.height}):(u.bottom=Math.max(u.bottom,a.bottom),u.height=Math.max(u.height,a.height))}}catch(e){o.e(e)}finally{o.f()}return r}(e));if(!(r.length<=1))for(var e=t.querySelector("svg")||t,o=(a=e,"fixed"===getComputedStyle(a).position?window.innerHeight||document.documentElement.clientHeight||0:(a=a.offsetParent||document.documentElement).getBoundingClientRect().height||a.clientHeight||0),a=getComputedStyle(e),i=(e=a.bottom,a=o,e&&"auto"!==e?/%$/.test(e)?e:(e=parseFloat(e),!isNaN(e)&&a?"".concat(+(e/a*100).toFixed(4),"%"):"0%"):"0%"),u=r[r.length-1].bottom,l=0;l<r.length-1;l++){var c,h=t.cloneNode(!0),h=(h.classList.add("uicore-svg-wrapper--clone"),h.setAttribute("aria-hidden","true"),n.contains(t)?n.insertBefore(h,t):n.appendChild(h),h.querySelector("svg path")||h);h.style.animationPlayState="running",2===r.length?h.style.bottom="50%":3===r.length?h.style.bottom=0===l?"66%":"33%":(c=function(e,t){return t=Math.pow(10,1<arguments.length&&void 0!==t?t:3),Math.round(e*t)/t}((u-r[l].bottom)/o*100),h.style.bottom="calc(".concat(i," + ").concat(c,"%)"))}}}})}new ResizeObserver(e).observe(document.documentElement),e(),window.addEventListener("orientationchange",e,{passive:!0}),t.forEach(function(e,t){var n=e.querySelectorAll(".uicore-svg-wrapper path"),o=e.getAttribute("data-delay")||0;n.forEach(function(t,n){var r=new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting&&(e=300*n+400+parseInt(o),setTimeout(function(){t.style.animationPlayState="running"},e),r.unobserve(t))})},{threshold:.9});r.observe(t)})}),r()});