Personal Site

Create and register HTMLNowPlayingElement. Currently just stores slotted components (from SSR)

vielle.dev cb51719c f5c6cd75

verified
+15
+15
src/components/playing/NowPlaying.astro
··· 451 451 452 452 return nodeList; 453 453 } 454 + 455 + /************************* 456 + * HTMLNowPlayingElement * 457 + *************************/ 458 + 459 + class HTMLNowPlayingElement extends HTMLElement { 460 + // load elements and throw if wrong type 461 + elements = { 462 + title: querySelector(this, "[slot=title]", HTMLAnchorElement), 463 + album: querySelector(this, "[slot=album]", HTMLSpanElement), 464 + artists: querySelector(this, "[slot=artists]", HTMLSpanElement), 465 + art: querySelector(this, "[slot=art]", HTMLImageElement), 466 + }; 467 + } 468 + customElements.define("now-playing", HTMLNowPlayingElement); 454 469 </script>