UNPKG

@ionic/core

Version:
4 lines • 2.71 kB
/*! * (C) Ionic http://ionicframework.com - MIT License */ import{d as t,H as i,i as n,e as o,h as e,f as r,t as a}from"./p-Ct2aBEue.js";import{h as s}from"./p-byZM6qHV.js";import{b}from"./p-HthJZjZ6.js";const m=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.ionStyle=n(this,"ionStyle",7),this.animated=!1}componentWillLoad(){this.emitStyle()}emitStyle(){this.ionStyle.emit({"skeleton-text":!0})}render(){const t=this.animated&&o.getBoolean("animated",!0),i=s("ion-avatar",this.el)||s("ion-thumbnail",this.el),n=b(this);return e(r,{key:"1114e5caf6419e9458db8256480b39e6989963b2",class:{[n]:!0,"skeleton-text-animated":t,"in-media":i}},e("span",{key:"9137cf837f163fc0653437fc003666cddac103b0"}," "))}get el(){return this}static get style(){return":host{--background:rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065);border-radius:var(--border-radius, inherit);display:block;width:100%;height:inherit;margin-top:4px;margin-bottom:4px;background:var(--background);line-height:10px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}span{display:inline-block}:host(.in-media){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;height:100%}:host(.skeleton-text-animated){position:relative;background:-webkit-gradient(linear, left top, right top, color-stop(8%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065)), color-stop(18%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.135)), color-stop(33%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065)));background:linear-gradient(to right, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 8%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.135) 18%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 33%);background-size:800px 104px;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-name:shimmer;animation-name:shimmer;-webkit-animation-timing-function:linear;animation-timing-function:linear}@-webkit-keyframes shimmer{0%{background-position:-400px 0}100%{background-position:400px 0}}@keyframes shimmer{0%{background-position:-400px 0}100%{background-position:400px 0}}"}},[1,"ion-skeleton-text",{animated:[4]}]),g=m,c=function(){"undefined"!=typeof customElements&&["ion-skeleton-text"].forEach((t=>{"ion-skeleton-text"===t&&(customElements.get(a(t))||customElements.define(a(t),m))}))};export{g as IonSkeletonText,c as defineCustomElement}