PATH:
home
/
letacommog
/
les-compagnons
/
wp-content
/
plugins
/
elementor-extras
/
assets
/
lib
/
scroll-indicator
!function(e,t,n,o){e.scrollIndicator=function(o,i){var r={scope:e(t),progress:"circle",autoHover:!0,click:!0,property:"width",scrollOffset:0},l=this;l.opts={};var c=null,a=null,s=e(o),d=null,u=null,f=null,p=null,h=null,g=!1,m=!1,u=null,k=null,v=null,_=null,S=null,C=null,b=null,q=null,I=null,y=null,H=null,L=null;l.init=function(){l.opts=e.extend({},r,i),l._construct()},l._construct=function(){l.setup(),d.length&&(l.events(),l.update())},l.setup=function(){c=l.opts.scope,a=e("body"),d=e(""),I=s.find(".ee-scroll-indicator__element__link"),$elements=s.find(".ee-scroll-indicator__element"),f=parseInt(Math.PI*(2*$elements.eq(0).find("circle").attr("r"))),p=c.height(),h=e(n).height(),s.addClass("is--active"),$elements.each(function(){var t=e(this).data("selector"),n=e("#"+t);n.length&&(d=d.add(n))}),d.length||(d=d.add(e("body")))},l.events=function(){c.on("scroll",l.checkRead),c.on("resize",l.resetScroll),l.opts.click&&s.on("click","a",l.onClick)},l.onClick=function(t){t.preventDefault();var n=d.eq(e(this).parent("li").index());if(n.length){var o=n.offset().top;c.off("scroll",l.checkRead),e("body,html").animate({scrollTop:o+2+l.opts.scrollOffset},300,function(){l.checkRead(),c.on("scroll",l.checkRead)})}},l.getChapters=function(){return s.find(".ee-scroll-indicator__element")},l.getDefaultSectionLink=function(){return l.getChapters().eq(0).children(".ee-scroll-indicator__element__link")},l.getSectionLink=function(e){var t=e.attr("id"),n=l.getDefaultSectionLink();return t&&($_element=l.getChapters().filter("[data-selector="+t+"]").children(".ee-scroll-indicator__element__link"),$_element.length&&(n=$_element)),n},l.isLastSection=function(e){return e+1===d.length},l.isVisibleAtEnd=function(e){return p>h-(d.eq(e).offset().top+d.eq(e).outerHeight())},l.isWindowTaller=function(e){return p>=d.eq(e).outerHeight()},l.update=function(){u=c.scrollTop(),d.each(function(t,n){var o=e(this);I.not(":eq("+t+")");l.updateSectionVars(t,o),L.length&&(b?b&&q?(L.addClass("is--reading").removeClass("is--read"),l.opts.autoHover&&L.trigger("hotip.show"),l.progress(t,o)):(l.opts.autoHover&&L.trigger("hotip.hide"),L.removeClass("is--reading").addClass("is--read")):(L.removeClass("is--read is--reading"),l.opts.autoHover&&L.trigger("hotip.hide")))}),g=!1},l.progress=function(e,t){"circle"===l.opts.progress?l.updateCircle(e,t):"background"===l.opts.progress&&l.updateBackground(e,t)},l.updateCircle=function(e,t){l.updateSectionVars(e,t);var n=L.find("circle"),o=f*((y+C-u)/H);n.attr({"stroke-dashoffset":o})},l.updateBackground=function(e,t){l.updateSectionVars(e,t);var n=L.find(".ee-scroll-indicator__element__progress"),o=100-(y+C-u)/H*100,i={};i[l.opts.property]=o+"%",n.css(i)},l.checkRead=function(){g||(g=!0,t.requestAnimationFrame?t.requestAnimationFrame(l.update):setTimeout(l.update,300))},l.resetScroll=function(){m||(m=!0,t.requestAnimationFrame?t.requestAnimationFrame(l.updateParams):setTimeout(l.updateParams,300),l.checkRead())},l.updateSectionVars=function(e,t){var n=l.getSectionLink(t).parent().data("start"),o=l.getSectionLink(t).parent().data("start-offset"),i=l.getSectionLink(t).parent().data("end"),r=l.getSectionLink(t).parent().data("end-offset");u=c.scrollTop(),y=t.offset().top+o,H=t.outerHeight()-o-r,L=l.getSectionLink(t),k=u>=y,v=u+p>=y,_=u+p<=y+H,S=u<=y+H,b=k,q=S,C=H,"bottom-top"===n&&"bottom-bottom"===i?(b=v,q=_,circleHeight=H+p,C=H-p):"top-top"===n&&"bottom-bottom"===i?(b=k,q=_,H-=p,circleHeight=H+p,C=H):"bottom-top"===n&&"top-bottom"===i&&(b=v,q=S,H+=p)},l.updateParams=function(){h=e(n).height(),p=e(t).height(),c.off("scroll",l.checkRead),c.on("scroll",l.checkRead),m=!1},l.destroy=function(){c.off("scroll",l.checkRead),c.off("resize",l.resetScroll),s.off("click","a",l.onClick),s.removeClass("is--active")},l.init()},e.fn.scrollIndicator=function(t){return this.each(function(){if(e.fn.scrollIndicator.destroy=function(){void 0!==n&&(e(this).data("scrollIndicator").destroy(),e(this).removeData("scrollIndicator"))},void 0===e(this).data("scrollIndicator")){var n=new e.scrollIndicator(this,t);e(this).data("scrollIndicator",n)}})}}(jQuery,window,document);
[+]
..
[-] scroll-indicator.min.js
[edit]
[-] scroll-indicator.js
[edit]