Full-size scaling is not suitable for all screen sizes
Abb4d0n opened this issue · 0 comments
Abb4d0n commented
Hi,
when using the "full-size" option, static scaling and translate values are used:
power-flow-card-plus/src/style.ts
Line 67 in 31a9518
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