| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,37 @@ |
| 1 |
+import { LitElement, html, css, svg } from 'lit';
|
|
| 2 |
+ |
|
| 3 |
+export class WinzerNav extends LitElement {
|
|
| 4 |
+ static properties = {
|
|
| 5 |
+ activeTab: { type: String },
|
|
| 6 |
+ items: { type: Array } // [{ id: 'news', label: 'News', icon: '...', url: '/news' }]
|
|
| 7 |
+ }; |
|
| 8 |
+ |
|
| 9 |
+ static styles = css` |
|
| 10 |
+ :host { position: fixed; bottom: 0; left: 0; width: 100%; background: var(--bg-white); border-top: 1px solid var(--border-color); padding-bottom: env(safe-area-inset-bottom); z-index: 100; }
|
|
| 11 |
+ .nav-bar { display: flex; justify-content: space-around; padding: 10px 0; }
|
|
| 12 |
+ .nav-item { display: flex; flex-direction: column; align-items: center; font-size: 0.7rem; color: var(--text-main); cursor: pointer; width: 80px; text-decoration: none; }
|
|
| 13 |
+ .nav-item.active { color: var(--primary-color); }
|
|
| 14 |
+ .nav-item svg { width: 24px; height: 24px; margin-bottom: 4px; fill: none; stroke: currentColor; stroke-width: 2; }
|
|
| 15 |
+ `; |
|
| 16 |
+ |
|
| 17 |
+ constructor() {
|
|
| 18 |
+ super(); |
|
| 19 |
+ this.items = []; |
|
| 20 |
+ } |
|
| 21 |
+ |
|
| 22 |
+ render() {
|
|
| 23 |
+ if (!this.items || this.items.length === 0) return html``; |
|
| 24 |
+ |
|
| 25 |
+ return html` |
|
| 26 |
+ <div class="nav-bar"> |
|
| 27 |
+ ${this.items.map(item => html`
|
|
| 28 |
+ <a href="${item.url || '#'}" class="nav-item ${this.activeTab === item.id ? 'active' : ''}">
|
|
| 29 |
+ ${item.icon}
|
|
| 30 |
+ <span>${item.label}</span>
|
|
| 31 |
+ </a> |
|
| 32 |
+ `)} |
|
| 33 |
+ </div> |
|
| 34 |
+ `; |
|
| 35 |
+ } |
|
| 36 |
+} |
|
| 37 |
+customElements.define('winzer-nav', WinzerNav);
|