Skip to content

Commit

Permalink
swiper media title
Browse files Browse the repository at this point in the history
  • Loading branch information
matt8707 committed Jan 7, 2023
1 parent 132cbbd commit d8f8f97
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions button_card_templates/media.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,19 @@ conditional_media:
]]]
state_display: >
[[[
let horizontalStack = this.getRootNode().host,
swipeCard = horizontalStack.getRootNode().host,
gridTitle = swipeCard.getRootNode().querySelector("h1");
swipeCard.swiper.on("slideChange", () => {
if (swipeCard.swiper.realIndex === 0) {
gridTitle.textContent = "Media";
}
else if (swipeCard.swiper.realIndex === 1) {
gridTitle.textContent = "Spelare";
}
});
if (entity) {
let elt = this.shadowRoot,
await = setTimeout(marquee, 100),
Expand Down

0 comments on commit d8f8f97

Please sign in to comment.