A. js / nav-tab-fixed.js

1
import { resaltaSiEstasEn } from "./lib/resaltaSiEstasEn.js"
2
3
export class NavTabFixed extends HTMLElement {
4
5
 constructor() {
6
  super()
7
  this.creado = false
8
 }
9
10
 connectedCallback() {
11
  this.classList.add("md-tab", "fixed")
12
13
  if (!this.creado) {
14
15
   this.innerHTML = /* HTML */`
16
    <a ${resaltaSiEstasEn(["/index.html", "", "/"])} href="index.html">
17
     <span class="material-symbols-outlined">home</span>
18
     Inicio
19
    </a>
20
 
21
    <a ${resaltaSiEstasEn(["/ayuda.html"])} href="ayuda.html">
22
     <span class="material-symbols-outlined">help</span>
23
     Ayuda
24
    </a>`
25
26
   this.creado = true
27
28
  }
29
30
 }
31
32
}
33
34
customElements.define("nav-tab-fixed", NavTabFixed)
skip_previous skip_next