Open Abb4d0n opened 2 months ago
Hi,
when using the "full-size" option, static scaling and translate values are used: https://github.com/flixlix/power-flow-card-plus/blob/31a95183699cfd456f84ccf0849e97ac57364612/src/style.ts#L67 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:
ha-card
div
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
Hi,
when using the "full-size" option, static scaling and translate values are used: https://github.com/flixlix/power-flow-card-plus/blob/31a95183699cfd456f84ccf0849e97ac57364612/src/style.ts#L67 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 contentdiv
? Maybe something like this:Thanks