Commit 0d5f69df authored by Thomas Frobieter's avatar Thomas Frobieter
Browse files

Rebuild JS for Type Score according to #3261592

parent 9d7cc047
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
"use strict";!function(B){Drupal.behaviors.drowl_paragraphs_type_score={attach:function(t,r){function P(t){return t.replace(/['"]+/g,"")}function N(t){t=t.replace(/^(rgb|rgba)\(/,"").replace(/\)$/,"").replace(/\s/g,"").split(",");return"rgb("+t[0]+","+t[1]+","+t[2]+")"}B(".score:not(.processed)",t).each(function(){var t=B(this),r=B(this).children(".score__progressbar:first").attr("id"),e=t.data("score-type"),a=t.data("score-start"),s=t.data("score-end"),o=t.data("score-max");o<=0&&(o=1);var c=t.data("score-trail-width"),n=t.data("score-stroke-width"),i=t.data("score-stroke-width-start"),l=t.data("score-animation-duration"),d=t.data("score-animation-easing"),p=t.data("score-prefix"),u=t.data("score-suffix"),h=t.data("score-value-display"),g=t.children(".score__icon:first"),_=Number((a/o).toFixed(2)),b=Number((s/o).toFixed(2)),f=P(getComputedStyle(t[0]).getPropertyValue("--line-color")),m=P(getComputedStyle(t[0]).getPropertyValue("--bar-color")),a=P(getComputedStyle(t[0]).getPropertyValue("--bar-end-color"));f.startsWith("rgba")&&(f=N(f)),m.startsWith("rgba")&&(m=N(m)),a.startsWith("rgba")&&(a=N(a));var w,y,v,x,C=g.length?'<span class="score__progressbar-icon">'.concat(g.html(),"</span>"):"",k=s&&"current_and_target"==h?'<span class="score__progressbar-devider"></span>':"",S=p?'<span class="score__progressbar-prefix">'.concat(p,"</span>"):"",W=u?'<span class="score__progressbar-suffix">'.concat(u,"</span>"):"",A=s&&"current_and_target"==h?'<span class="score__progressbar-max-value">'.concat(o,"</span>"):"";"semicircle"==e?w=new ProgressBar.SemiCircle("#"+r,{strokeWidth:n,trailWidth:c,trailColor:f,easing:d,duration:l,svgStyle:null,text:{className:"score__progressbar-content",autoStyleContainer:!1,style:null},from:{color:m,width:i},to:{color:a,width:n},step:function(t,r){var e=Math.round(100*r.value());r.path.setAttribute("stroke",t.color),r.path.setAttribute("stroke-width",t.width),r.setText("".concat(C,'<span class="score__progressbar-current">').concat(0===e?0:e,"</span>").concat(k+S+A+W))}}):"line"==e?w=new ProgressBar.Line("#"+r,{strokeWidth:n,trailWidth:c,trailColor:f,easing:d,duration:l,svgStyle:null,text:{className:"score__progressbar-content",autoStyleContainer:!1,style:null},from:{color:m,width:i},to:{color:a,width:n},step:function(t,r){var e=Math.round(100*r.value());r.path.setAttribute("stroke",t.color),r.path.setAttribute("stroke-width",t.width),r.setText("".concat(C,'<span class="score__progressbar-current">').concat(0===e?0:e,"</span>").concat(k+S+A+W))}}):"circle"==e&&(w=new ProgressBar.Circle("#"+r,{strokeWidth:n,trailWidth:c,trailColor:f,easing:d,duration:l,svgStyle:null,text:{className:"score__progressbar-content",autoStyleContainer:!1,style:null},from:{color:m,width:i},to:{color:a,width:n},step:function(t,r){var e=Math.round(100*r.value());r.path.setAttribute("stroke",t.color),r.path.setAttribute("stroke-width",t.width),r.setText("".concat(C,'<span class="score__progressbar-current">').concat(0===e?0:e,"</span>").concat(k+S+A+W))}})),n=t,y=w,v=_,x=b,new IntersectionObserver(function(t){B(t).each(function(){0<B(this)[0].intersectionRatio?(0<v&&y.set(v),y.animate(x)):0<v?y.set(v):y.animate(0)})}).observe(n[0]),t.addClass("processed")})}}}(jQuery);
 No newline at end of file
"use strict";!function(B){Drupal.behaviors.drowl_paragraphs_type_score={attach:function(t,r){function P(t){return t.replace(/['"]+/g,"")}function N(t){t=t.replace(/^(rgb|rgba)\(/,"").replace(/\)$/,"").replace(/\s/g,"").split(",");return"rgb("+t[0]+","+t[1]+","+t[2]+")"}B(".score:not(.processed)",t).each(function(){var t=B(this),r=B(this).children(".score__progressbar:first").attr("id"),e=t.data("score-type"),a=t.data("score-start"),s=t.data("score-end"),o=t.data("score-max");o<=0&&(o=1);var c=t.data("score-trail-width"),n=t.data("score-stroke-width"),i=t.data("score-stroke-width-start"),l=t.data("score-animation-duration"),d=t.data("score-animation-easing"),p=t.data("score-prefix"),u=t.data("score-suffix"),h=t.data("score-value-display"),g=t.children(".score__icon:first"),_=Number((a/o).toFixed(2)),b=Number((s/o).toFixed(2)),f=P(getComputedStyle(t[0]).getPropertyValue("--line-color")),m=P(getComputedStyle(t[0]).getPropertyValue("--bar-color")),a=P(getComputedStyle(t[0]).getPropertyValue("--bar-end-color"));f.startsWith("rgba")&&(f=N(f)),m.startsWith("rgba")&&(m=N(m)),a.startsWith("rgba")&&(a=N(a));var w,y,v,x,C=g.length?'<span class="score__progressbar-icon">'.concat(g.html(),"</span>"):"",k=s&&"current_and_target"==h?'<span class="score__progressbar-devider"></span>':"",S=p?'<span class="score__progressbar-prefix">'.concat(p,"</span>"):"",W=u?'<span class="score__progressbar-suffix">'.concat(u,"</span>"):"",A=s&&"current_and_target"==h?'<span class="score__progressbar-max-value">'.concat(o,"</span>"):"";"semicircle"==e?w=new ProgressBar.SemiCircle("#"+r,{strokeWidth:n,trailWidth:c,trailColor:f,easing:d,duration:l,svgStyle:null,text:{className:"score__progressbar-content",autoStyleContainer:!1,style:null},from:{color:m,width:i},to:{color:a.length?a:m,width:n},step:function(t,r){var e=Math.round(r.value()*o);r.path.setAttribute("stroke",t.color),r.path.setAttribute("stroke-width",t.width),r.setText("".concat(C,'<span class="score__progressbar-current">').concat(0===e?0:e,"</span>").concat(k+S+A+W))}}):"line"==e?w=new ProgressBar.Line("#"+r,{strokeWidth:n,trailWidth:c,trailColor:f,easing:d,duration:l,svgStyle:null,text:{className:"score__progressbar-content",autoStyleContainer:!1,style:null},from:{color:m,width:i},to:{color:a.length?a:m,width:n},step:function(t,r){var e=Math.round(r.value()*o);r.path.setAttribute("stroke",t.color),r.path.setAttribute("stroke-width",t.width),r.setText("".concat(C,'<span class="score__progressbar-current">').concat(0===e?0:e,"</span>").concat(k+S+A+W))}}):"circle"==e&&(w=new ProgressBar.Circle("#"+r,{strokeWidth:n,trailWidth:c,trailColor:f,easing:d,duration:l,svgStyle:null,text:{className:"score__progressbar-content",autoStyleContainer:!1,style:null},from:{color:m,width:i},to:{color:a.length?a:m,width:n},step:function(t,r){var e=Math.round(r.value()*o);r.path.setAttribute("stroke",t.color),r.path.setAttribute("stroke-width",t.width),r.setText("".concat(C,'<span class="score__progressbar-current">').concat(0===e?0:e,"</span>").concat(k+S+A+W))}})),n=t,y=w,v=_,x=b,new IntersectionObserver(function(t){B(t).each(function(){0<B(this)[0].intersectionRatio?(0<v&&y.set(v),y.animate(x)):0<v?y.set(v):y.animate(0)})}).observe(n[0]),t.addClass("processed")})}}}(jQuery);
 No newline at end of file