full screen scaling
This commit is contained in:
parent
dc4db67b96
commit
0c8db4f38e
|
@ -128,7 +128,7 @@ class CurrentWeather extends WeatherDisplay {
|
|||
|
||||
let Conditions = data.observations.textDescription;
|
||||
if (Conditions.length > 15) {
|
||||
Conditions = this.shortConditions(Conditions);
|
||||
Conditions = CurrentWeather.shortConditions(Conditions);
|
||||
}
|
||||
fill.condition = Conditions;
|
||||
|
||||
|
|
|
@ -252,11 +252,11 @@ const getDisplay = (index) => displays[index];
|
|||
|
||||
// resize the container on a page resize
|
||||
const resize = () => {
|
||||
const widthZoomPercent = document.body.clientWidth / 640;
|
||||
const heightZoomPercent = document.body.clientHeight / 480;
|
||||
const marginOffset = (document.fullscreenElement) ? 0 : 16;
|
||||
const widthZoomPercent = (window.innerWidth - marginOffset) / 640;
|
||||
const heightZoomPercent = (window.innerHeight - marginOffset) / 480;
|
||||
|
||||
const scale = Math.min(widthZoomPercent, heightZoomPercent);
|
||||
console.log(scale, document.body.clientWidth);
|
||||
if (scale < 1.0 || document.fullscreenElement) {
|
||||
document.getElementById('container').style.zoom = scale;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue