@rocketspark/domain-checker
Version:
Embeddable Domain Checker for Rocketspark
13 lines • 2.78 kB
JavaScript
/*!
*
* @rocketspark/domain-checker v1.0.12
* git+https://github.com/rocketspark/domain-checker.git
*
* Copyright (c) Lee Reichardt and project contributors.
*
* This source code is licensed under the no license license found in the
* LICENSE file in the root directory of this source tree.
*
*/
"use strict";(self.webpackChunkDomainChecker=self.webpackChunkDomainChecker||[]).push([[66],{66:function(e,s,t){t.r(s),t.d(s,{rs_progress_circle:function(){return i}});var r=t(6919);const i=class{constructor(e){(0,r.r)(this,e),this.progress=0,this.size="default",this.dimensions={small:28,default:43,large:111},this.strokeWidth={small:2,default:4,large:4},this.activeStrokeWidth={small:4,default:6,large:8}}getProgressValue(){return this.progress>100?100:this.progress<0?0:this.progress}progressValueClass(){return{"progress-value--0":this.progress<=30,"progress-value--30":this.progress>30&&this.progress<80,"progress-value--80":this.progress>=80,"progress-circle":!0}}getSize(){return this.dimensions[this.size]}getActiveStrokeWidth(){return this.activeStrokeWidth[this.size]}getStrokeWidth(){return this.strokeWidth[this.size]}getRadius(){return this.getSize()/2-this.getActiveStrokeWidth()/2}getStrokeDashArray(){return Math.PI*(2*this.getRadius())}getStrokeDashOffset(){return(100-this.getProgressValue())/100*this.getStrokeDashArray()}render(){return(0,r.h)(r.H,{key:"3319af16d26732f3aa6c54dd6166301dec0751fa",class:`size--${this.size}`,style:{width:`${this.getSize()}px`,height:`${this.getSize()}px`}},(0,r.h)("svg",{key:"1e2c0c1ddbc70bab3aaeefaa27216fe650e48938",width:this.getSize(),height:this.getSize(),viewBox:`0 0 ${this.getSize()} ${this.getSize()}`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.h)("circle",{key:"a6458651b8e9b0612ad107345741032f725132b7",class:"progress-bar",opacity:"0.5",cx:"50%",cy:"50%",r:this.getRadius(),style:{"stroke-width":`${this.getStrokeWidth()}`}}),(0,r.h)("circle",{key:"0139138d5d5395ad1960535e22e76fc4bc834f6a",class:Object.assign({},this.progressValueClass()),cx:"50%",cy:"50%",r:this.getRadius(),style:{opacity:""+(this.getProgressValue()<1?"0":"1"),"stroke-dasharray":`${this.getStrokeDashArray()}`,"stroke-width":`${this.getActiveStrokeWidth()}px`,"stroke-dashoffset":`${this.getStrokeDashOffset()}`,"stroke-linecap":"round","transform-origin":`${this.getSize()/2}px ${this.getSize()/2}px`,transform:"rotate(-90deg)"}})))}};i.style=":host{display:block}.progress-bar{stroke:var(--rs-color-grey-light)}.progress-value--0{stroke:var(--rs-color-negative)}.progress-value--30{stroke:var(--rs-color-neutral)}.progress-value--80{stroke:var(--rs-color-positive)}.progress-circle{transition:stroke-dasharray 0.15s ease-out, stroke 0.15s ease-out, opacity 0.15s ease-out}"}}]);
//# sourceMappingURL=66.index.js.map