Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/ui/graph/circle/dist/ |
Upload File : |
this.BX=this.BX||{};this.BX.UI=this.BX.UI||{};(function(t,e){"use strict";let s=false;class r{constructor(t,e,s,r,i){this.domNode=t;this.perimetr=e;this.radius=e/2;this.progressBar=Number(s)>100?100:s;this.progressBg=null;this.number=null;this.waves=null;this.leftWave=null;this.rightWave=null;this.fixCounter=r?r:null;this.withoutWaves=i?i:null}getCircumFerence(){return(this.radius-10)*2*3.14}getCircumProgress(){return this.getCircumFerence()-this.getCircumFerence()/100*this.progressBar}createCircle(){this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg");this.svg.setAttributeNS(null,"class","ui-graph-circle-bar");this.svg.setAttributeNS(null,"viewport","0 0 "+this.radius+" "+this.radius);this.svg.setAttributeNS(null,"width",this.perimetr);this.svg.setAttributeNS(null,"height",this.perimetr);this.progressBg=document.createElementNS("http://www.w3.org/2000/svg","circle");this.progressBg.setAttributeNS(null,"r",this.radius-10);this.progressBg.setAttributeNS(null,"cx",this.radius);this.progressBg.setAttributeNS(null,"cy",this.radius);this.progressBg.setAttributeNS(null,"class","ui-graph-circle-bar-bg");this.progressMove=document.createElementNS("http://www.w3.org/2000/svg","circle");this.progressMove.setAttributeNS(null,"r",this.radius-10);this.progressMove.setAttributeNS(null,"cx",this.radius);this.progressMove.setAttributeNS(null,"cy",this.radius);this.progressMove.setAttributeNS(null,"stroke-dasharray",this.getCircumFerence());this.progressMove.setAttributeNS(null,"stroke-dashoffset",this.getCircumFerence());this.progressMove.setAttributeNS(null,"class","ui-graph-circle-bar-progress");e.Dom.append(this.progressBg,this.svg);e.Dom.append(this.progressMove,this.svg);return this.svg}animateFixedBar(){this.svg.setAttributeNS(null,"class","ui-graph-circle-bar ui-graph-circle-bar-animate ui-graph-circle-bar-without-animate");this.progressMove.setAttributeNS(null,"stroke-dashoffset",0)}animateProgressBar(){this.svg.setAttributeNS(null,"class","ui-graph-circle-bar ui-graph-circle-bar-animate");this.progressMove.setAttributeNS(null,"stroke-dashoffset",this.getCircumProgress())}createNumberBlock(){this.number=e.Dom.create("div",{attrs:{className:"ui-graph-circle-number","data-progress":this.progressBar}});return this.number}createWavesBlock(){return e.Dom.create("div",{attrs:{className:"ui-graph-circle-waves-wrapper"},children:[this.waves=e.Dom.create("div",{attrs:{className:"ui-graph-circle-waves"},children:[this.leftWave=e.Dom.create("div",{attrs:{className:"ui-graph-circle-waves-left"}}),this.rightWave=e.Dom.create("div",{attrs:{className:"ui-graph-circle-waves-right"}})]})]})}animateWavesBlock(t){let e=this.progressBar;if(t){if(e<=50){e=45}if(e>50){e=85}this.progressBar<=25?e=25:null;this.waves.style.transform="translateY(-"+e+"%)"}this.progressBar<=25?e=25:null;this.waves.style.transform="translateY(-"+e+"%)"}animateBothWaves(){let t=0;let e=50;let r=15;let i;let a=Date.now();let h=1e3/r;let l;function u(){if(s){return}requestAnimationFrame(u);i=Date.now();l=i-a;if(l>h){a=i-l%h;const s=document.querySelector(".ui-graph-circle-waves-left");const r=document.querySelector(".ui-graph-circle-waves-right");t+=1;e-=1;s.style.transform="translate3d("+t+"%, 0, 0)";r.style.transform="translate3d("+e+"%, 0, 0)";if(parseInt(t,10)>=50){t=0}if(parseInt(e,10)<=0){e=50}}}u()}createWrapper(){this.graph=e.Dom.create("div",{attrs:{className:"ui-graph-circle-wrapper"}});e.Dom.append(this.createCircle(),this.graph);e.Dom.append(this.createNumberBlock(),this.graph);e.Dom.append(this.createWavesBlock(),this.graph);return this.graph}addWrapperClass(){e.Dom.addClass(this.graph,"ui-graph-circle-wrapper-animate");if(this.fixCounter){e.Dom.addClass(this.graph,"ui-graph-circle-counter")}}animateNumber(t){let e=this.progressBar;if(t){e=t}if(Number(e)<=0){if(t){this.number.innerHTML="0"}else{this.number.innerHTML="0"+" <span>%</span>"}return}if(t){this.number.innerHTML=t;this.number.innerHTML.length>=4?this.graph.classList.add("ui-graph-font-sm"):null}else{let t=0;let s=1e3/e;let r=setInterval(function(){t++;this.number.innerHTML=t+" <span>%</span>";t===Number(e)?clearInterval(r):null}.bind(this),s)}}updateCounter(t,e){this.progressBar=t;if(e){this.progressMove.setAttributeNS(null,"stroke-dashoffset",0)}else{this.progressMove.setAttributeNS(null,"stroke-dashoffset",this.getCircumProgress())}this.animateNumber(e);this.animateWavesBlock(e)}show(){s=false;e.Dom.append(this.createWrapper(),this.domNode);setTimeout(function(){this.addWrapperClass();this.animateNumber(this.fixCounter);if(this.fixCounter){this.animateFixedBar()}else{this.animateProgressBar()}if(this.withoutWaves){return}else{this.animateBothWaves();this.animateWavesBlock(this.fixCounter)}}.bind(this),500)}stop(){s=true}}t.Circle=r})(this.BX.UI.Graph=this.BX.UI.Graph||{},BX); //# sourceMappingURL=ui.circle.bundle.map.js