-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show loading states in player and cover
- Loading branch information
1 parent
d2e84a4
commit 611ee2e
Showing
7 changed files
with
106 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { LitElement, css, html } from "lit"; | ||
import { customElement, property } from "lit/decorators.js"; | ||
|
||
/** | ||
* Icon that shows a loader. | ||
*/ | ||
@customElement("loader-icon") | ||
export class LoaderIcon extends LitElement { | ||
@property({ type: Number }) size = 24; | ||
@property({ type: Boolean }) animated = true; | ||
|
||
static styles = css` | ||
.animated { | ||
animation: spin 2s linear infinite; | ||
} | ||
@keyframes spin { | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
`; | ||
|
||
render() { | ||
return html`<svg | ||
class=${this.animated ? "animated" : ""} | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox=${`0 0 ${this.size} ${this.size}`} | ||
height=${this.size} | ||
width=${this.size} | ||
> | ||
<path | ||
d="M13 2h-2v6h2V2zm0 14h-2v6h2v-6zm9-5v2h-6v-2h6zM8 13v-2H2v2h6zm7-6h2v2h-2V7zm4-2h-2v2h2V5zM9 7H7v2h2V7zM5 5h2v2H5V5zm10 12h2v2h2v-2h-2v-2h-2v2zm-8 0v-2h2v2H7v2H5v-2h2z" | ||
fill="currentColor" | ||
/> | ||
</svg>`; | ||
} | ||
} | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
"loader-icon": LoaderIcon; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters