diff --git a/fab-ui/index.html b/fab-ui/index.html index 512fff4..c29f6df 100644 --- a/fab-ui/index.html +++ b/fab-ui/index.html @@ -4,34 +4,38 @@ - Vite + Lit + TS + FaB Cards
+
diff --git a/fab-ui/src/fab-card.ts b/fab-ui/src/fab-card.ts index 64c02a1..af8aeca 100644 --- a/fab-ui/src/fab-card.ts +++ b/fab-ui/src/fab-card.ts @@ -1,16 +1,64 @@ import { LitElement, css, html } from 'lit' import { customElement, property } from 'lit/decorators.js' +@customElement("fab-rarity-symbol") +export class FabRaritySymbol extends LitElement { + @property({ type: String }) + rarity = ''; + + render() { + return html` + ${this.rarity} + `; + } + + static styles = css` + .fab-rarity-icon { + font-family: monospace; + display: inline-block; + width: 1.2em; + height: 1.2em; + line-height: 1.1em; + text-align: center; + border-radius: 50%; + color: #fff; + font-size: 0.7em; + } + + .fab-rarity-icon.fab-rarity-m { + background-color: red; + } + + .fab-rarity-icon.fab-rarity-r { + background-color: blue; + } + + .fab-rarity-icon.fab-rarity-p { + background-color: green; + } + + .fab-rarity-icon.fab-rarity-c { + background-color: gray; + } + + .fab-rarity-icon.fab-rarity-l { + background-color: orange; + } + `; +} + @customElement('fab-card') export class FabCard extends LitElement { @property({ type: String }) - cardSetId = ''; + setId = ''; @property({ type: String }) - cardName = ''; + name = ''; @property({ type: String }) - cardColor = ''; + color = ''; @property({ type: String }) - cardComment = ''; + rarity = ''; + @property({ type: String }) + comment = ''; @property({ type: String }) foiling = 'S'; @@ -18,14 +66,15 @@ export class FabCard extends LitElement { return html`
- ${this.cardName} + ${this.name}
- ${this.cardSetId} - ${this.cardName} - (${this.cardColor}) + + ${this.setId} + ${this.name} + (${this.color}) ${this.foiling == "S" ? '' : this.foiling } - +
`; diff --git a/index.html b/index.html new file mode 100644 index 0000000..8b9e75c --- /dev/null +++ b/index.html @@ -0,0 +1,49 @@ + + + + + + Lit Example + + + + + + + + + \ No newline at end of file