full screen scaling

This commit is contained in:
Matt Walsh 2022-12-09 13:26:13 -06:00
parent dc4db67b96
commit 0c8db4f38e
2 changed files with 4 additions and 4 deletions

View file

@ -128,7 +128,7 @@ class CurrentWeather extends WeatherDisplay {
let Conditions = data.observations.textDescription; let Conditions = data.observations.textDescription;
if (Conditions.length > 15) { if (Conditions.length > 15) {
Conditions = this.shortConditions(Conditions); Conditions = CurrentWeather.shortConditions(Conditions);
} }
fill.condition = Conditions; fill.condition = Conditions;

View file

@ -252,11 +252,11 @@ const getDisplay = (index) => displays[index];
// resize the container on a page resize // resize the container on a page resize
const resize = () => { const resize = () => {
const widthZoomPercent = document.body.clientWidth / 640; const marginOffset = (document.fullscreenElement) ? 0 : 16;
const heightZoomPercent = document.body.clientHeight / 480; const widthZoomPercent = (window.innerWidth - marginOffset) / 640;
const heightZoomPercent = (window.innerHeight - marginOffset) / 480;
const scale = Math.min(widthZoomPercent, heightZoomPercent); const scale = Math.min(widthZoomPercent, heightZoomPercent);
console.log(scale, document.body.clientWidth);
if (scale < 1.0 || document.fullscreenElement) { if (scale < 1.0 || document.fullscreenElement) {
document.getElementById('container').style.zoom = scale; document.getElementById('container').style.zoom = scale;
} else { } else {