Skip to content
Snippets Groups Projects
Commit d61d8f58 authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire: Committed by Reiter, Christoph
Browse files

Add mini-spinner text support

parent 010239f9
No related branches found
No related tags found
No related merge requests found
......@@ -99,6 +99,7 @@ class VpuCommonDemo extends LitElement {
<div class="content">
<h2>Mini Spinner</h2>
<div class="control">
<vpu-mini-spinner text="Loading..."></vpu-mini-spinner>
<vpu-mini-spinner></vpu-mini-spinner>
<vpu-mini-spinner style="font-size: 2em"></vpu-mini-spinner>
<vpu-mini-spinner style="font-size: 3em"></vpu-mini-spinner>
......
......@@ -5,10 +5,21 @@ import * as commonUtils from './utils.js';
class MiniSpinner extends LitElement {
constructor() {
super();
this.text = "";
}
static get properties() {
return {
text: { type: String },
};
}
static get styles() {
// language=css
return css`
.outer {
display: flex;
}
.ring {
display: inline-block;
position: relative;
......@@ -42,11 +53,18 @@ class MiniSpinner extends LitElement {
100% {
transform: rotate(360deg);
}
}
.text {
display: inline-block;
margin-left: 0.5em;
font-size: 0.7em;
}`;
}
render() {
return html`<div class="ring"><div></div><div></div><div></div><div></div></div>`;
const textHtml = this.text !== "" ? html`<div class="text">${this.text}</div>` : html``;
return html`<div class="outer"><div class="ring"><div></div><div></div><div></div><div></div></div>${textHtml}</div>`;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment