// Find a standalone version of this loading icon at // https://codepen.io/trusktr/pen/poNxzqJ /** * @class LoadingIcon - A `` element useful for an initial loading * animation while assets are loading. The element has no dependencies, so it * can be imported directly quickly on its own to add into a web app as soon as * possible while other modules are still being fetched. * * ## Live Example * * Hit "Rerun" to see the loading icon again. * * * * * ## Usage: * * ```html * * * * * * * * * * * * * * * ``` * * ## CSS Properties * * ### `--loading-icon-color` * * A string with an RGB triplet, comma separated. * * Default: `120,130,140` * * ### `--loading-icon-outer-radius` * * The outer size of the icon. * * Default: `20px` * * ### `--loading-icon-inner-radius` * * The size of the inner hole. * * Default: `calc(0.7 * var(--loading-icon-outer-radius))` * * @extends HTMLElement */ export class LoadingIcon extends HTMLElement { connectedCallback() { this.attachShadow({mode: 'open'}) this.shadowRoot!.innerHTML = /*html*/ `
` } } customElements.define('loading-icon', LoadingIcon) declare module 'solid-js' { namespace JSX { interface IntrinsicElements { // Default attributes because this class has none. 'loading-icon': JSX.HTMLAttributes // Otherwise use this if we add attributes, like with other classes: // 'loading-icon': ElementAttributes } } } declare global { interface HTMLElementTagNameMap { 'loading-icon': LoadingIcon } }