Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full-size scaling is not suitable for all screen sizes #605

Open
Abb4d0n opened this issue Apr 23, 2024 · 0 comments
Open

Full-size scaling is not suitable for all screen sizes #605

Abb4d0n opened this issue Apr 23, 2024 · 0 comments

Comments

@Abb4d0n
Copy link

Abb4d0n commented Apr 23, 2024

Hi,

when using the "full-size" option, static scaling and translate values are used:

transform: scale(2) translateY(30%);

However, this is not suitable for all screen sizes.

Would it be possible to calculate a scale factor depending on the size of the ha-card tag and the content div?
Maybe something like this:

var hacard = document.getElementsByTagName("ha-card")[0];
var content = document.getElementById("power-flow-card-plus");
var scalefactor = Math.min(hacard.offsetHeight/ content.offsetHeight, hacard.offsetWidth / content.offsetWidth)
content.style.transform = "scale("+scalefactor+")";

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant