UNPKG

@tindtechnologies/universalviewer

Version:

The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎

2 lines (1 loc) 6.21 kB
import{b as m}from"./chunk-Y2TXPXZV.js";import{a as u,e as o,f as y,n as f,o as p}from"./chunk-VNJCZCB4.js";import"./chunk-L67DAW3A.js";var k={bubbles:{dur:1e3,circles:9,fn:function(n,r,t){var s=n*r/t-n+"ms",e=2*Math.PI*r/t;return{r:5,style:{top:9*Math.sin(e)+"px",left:9*Math.cos(e)+"px","animation-delay":s}}}},circles:{dur:1e3,circles:8,fn:function(n,r,t){var s=r/t,e=n*s-n+"ms",a=2*Math.PI*s;return{r:5,style:{top:9*Math.sin(a)+"px",left:9*Math.cos(a)+"px","animation-delay":e}}}},circular:{dur:1400,elmDuration:!0,circles:1,fn:function(){return{r:20,cx:44,cy:44,fill:"none",viewBox:"22 22 44 44",transform:"translate(0,0)",style:{}}}},crescent:{dur:750,circles:1,fn:function(){return{r:26,style:{}}}},dots:{dur:750,circles:3,fn:function(n,r){var t=-(110*r)+"ms";return{r:6,style:{left:9-9*r+"px","animation-delay":t}}}},lines:{dur:1e3,lines:12,fn:function(n,r,t){var s="rotate("+(30*r+(r<6?180:-180))+"deg)",e=n*r/t-n+"ms";return{y1:17,y2:29,style:{transform:s,"animation-delay":e}}}},"lines-small":{dur:1e3,lines:12,fn:function(n,r,t){var s="rotate("+(30*r+(r<6?180:-180))+"deg)",e=n*r/t-n+"ms";return{y1:12,y2:20,style:{transform:s,"animation-delay":e}}}}},d=k,g=function(){function n(r){u(this,r),this.paused=!1}return n.prototype.getName=function(){var r=this.name||f.get("spinner"),t=p(this);return r||(t==="ios"?"lines":"circular")},n.prototype.render=function(){var r,t=this,s=p(t),e=t.getName(),a=d[e]||d.lines,l=typeof t.duration=="number"&&t.duration>10?t.duration:a.dur,c=[];if(a.circles!==void 0)for(var i=0;i<a.circles;i++)c.push(h(a,l,i,a.circles));else if(a.lines!==void 0)for(var i=0;i<a.lines;i++)c.push(b(a,l,i,a.lines));return o(y,{class:Object.assign(Object.assign({},m(t.color)),(r={},r[s]=!0,r["spinner-"+e]=!0,r["spinner-paused"]=!!t.paused||f.getBoolean("_testing"),r)),role:"progressbar",style:a.elmDuration?{animationDuration:l+"ms"}:{}},c)},Object.defineProperty(n,"style",{get:function(){return":host{display:inline-block;position:relative;width:28px;height:28px;color:var(--color);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host(.ion-color){color:var(--ion-color-base)}svg{left:0;top:0;-webkit-transform-origin:center;transform-origin:center;position:absolute;width:100%;height:100%;-webkit-transform:translateZ(0);transform:translateZ(0)}:host-context([dir=rtl]) svg,[dir=rtl] svg{left:unset;right:unset;right:0;-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}:host(.spinner-lines) line,:host(.spinner-lines-small) line{stroke-width:4px;stroke-linecap:round;stroke:currentColor}:host(.spinner-lines) svg,:host(.spinner-lines-small) svg{-webkit-animation:spinner-fade-out 1s linear infinite;animation:spinner-fade-out 1s linear infinite}:host(.spinner-bubbles) svg{-webkit-animation:spinner-scale-out 1s linear infinite;animation:spinner-scale-out 1s linear infinite;fill:currentColor}:host(.spinner-circles) svg{-webkit-animation:spinner-fade-out 1s linear infinite;animation:spinner-fade-out 1s linear infinite;fill:currentColor}:host(.spinner-crescent) circle{fill:transparent;stroke-width:4px;stroke-dasharray:128px;stroke-dashoffset:82px;stroke:currentColor}:host(.spinner-crescent) svg{-webkit-animation:spinner-rotate 1s linear infinite;animation:spinner-rotate 1s linear infinite}:host(.spinner-dots) circle{stroke-width:0;fill:currentColor}:host(.spinner-dots) svg{-webkit-animation:spinner-dots 1s linear infinite;animation:spinner-dots 1s linear infinite}:host(.spinner-circular){-webkit-animation:spinner-circular linear infinite;animation:spinner-circular linear infinite}:host(.spinner-circular) circle{-webkit-animation:spinner-circular-inner ease-in-out infinite;animation:spinner-circular-inner ease-in-out infinite;stroke:currentColor;stroke-dasharray:80px,200px;stroke-dashoffset:0px;stroke-width:3.6;fill:none}:host(.spinner-paused),:host(.spinner-paused) circle,:host(.spinner-paused) svg{-webkit-animation-play-state:paused;animation-play-state:paused}@-webkit-keyframes spinner-fade-out{0%{opacity:1}to{opacity:0}}@keyframes spinner-fade-out{0%{opacity:1}to{opacity:0}}@-webkit-keyframes spinner-scale-out{0%{-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:scale(0);transform:scale(0)}}@keyframes spinner-scale-out{0%{-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:scale(0);transform:scale(0)}}@-webkit-keyframes spinner-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spinner-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes spinner-dots{0%{-webkit-transform:scale(1);transform:scale(1);opacity:.9}50%{-webkit-transform:scale(.4);transform:scale(.4);opacity:.3}to{-webkit-transform:scale(1);transform:scale(1);opacity:.9}}@keyframes spinner-dots{0%{-webkit-transform:scale(1);transform:scale(1);opacity:.9}50%{-webkit-transform:scale(.4);transform:scale(.4);opacity:.3}to{-webkit-transform:scale(1);transform:scale(1);opacity:.9}}@-webkit-keyframes spinner-circular{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spinner-circular{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes spinner-circular-inner{0%{stroke-dasharray:1px,200px;stroke-dashoffset:0px}50%{stroke-dasharray:100px,200px;stroke-dashoffset:-15px}to{stroke-dasharray:100px,200px;stroke-dashoffset:-125px}}@keyframes spinner-circular-inner{0%{stroke-dasharray:1px,200px;stroke-dashoffset:0px}50%{stroke-dasharray:100px,200px;stroke-dashoffset:-15px}to{stroke-dasharray:100px,200px;stroke-dashoffset:-125px}}"},enumerable:!0,configurable:!0}),n}(),h=function(n,r,t,s){var e=n.fn(r,t,s);return e.style["animation-duration"]=r+"ms",o("svg",{viewBox:e.viewBox||"0 0 64 64",style:e.style},o("circle",{transform:e.transform||"translate(32,32)",cx:e.cx,cy:e.cy,r:e.r,style:n.elmDuration?{animationDuration:r+"ms"}:{}}))},b=function(n,r,t,s){var e=n.fn(r,t,s);return e.style["animation-duration"]=r+"ms",o("svg",{viewBox:e.viewBox||"0 0 64 64",style:e.style},o("line",{transform:"translate(32,32)",y1:e.y1,y2:e.y2}))};export{g as ion_spinner};