Skip to content

Commit

Permalink
Cleans up html and css
Browse files Browse the repository at this point in the history
  • Loading branch information
luixal committed Jan 19, 2025
1 parent 2a76047 commit ac6c19d
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions media-source-image-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,27 @@ class MediaSourceImageCard extends HTMLElement {
this.innerHTML = `
<style>
ha-card {
overflow: hidden;
height: 100%;
overflow: hidden;
height: 100%;
display: flex;
align-content: center;
justify-content: center;
}
ha-card.clickable {
cursor: pointer;
}
.card-content {
padding: 0px;
display: flex;
align-content: center;
justify-content: center;
cursor: pointer;
}
img {
display: block;
max-width: ${this.config.width ? this.config.width : '100%'};
max-height: ${this.config.height ? this.config.height : '100%'};
width: 100%;
height: 100%;
display: block;
max-width: ${this.config.width ? this.config.width : '100%'};
max-height: ${this.config.height ? this.config.height : '100%'};
width: 100%;
height: 100%;
}
img.off {
-webkit-filter: grayscale();
-webkit-filter: grayscale();
}
.error {
Expand All @@ -45,12 +41,10 @@ class MediaSourceImageCard extends HTMLElement {
</style>
<ha-card>
<div class="card-content">
<img src="">
</div>
<img src="">
</ha-card>
`;
this.content = this.querySelector("div");
this.content = this.querySelector("ha-card");
this.content.addEventListener('click', () => this.handleClick())
}
}
Expand Down Expand Up @@ -205,7 +199,7 @@ window.customCards.push({
});

console.info(
`%c MEDIA SOURCE IMAGE CARD %c Version 0.5.0 `,
`%c MEDIA SOURCE IMAGE CARD %c Version 0.5.1 `,
'color: orange; font-weight: bold; background: black',
'color: white; font-weight: bold; background: dimgray',
);

0 comments on commit ac6c19d

Please sign in to comment.