diff --git a/docs/tests/screen.js b/docs/tests/screen.js index 1c53cd74..154aa0af 100644 --- a/docs/tests/screen.js +++ b/docs/tests/screen.js @@ -117,24 +117,27 @@ const getScreenMatchMedia = () => { const getCSS = () => { const gcd = (a, b) => b == 0 ? a : gcd(b, a%b) - const { innerWidth: w, innerHeight: h } = window - const { width: sw, height: sh } = screen - const r = gcd(w, h) - const sr = gcd(sw, sh) - const aspectRatio = `${w/r}/${h/r}` - const deviceAspectRatio = `${sw/sr}/${sh/sr}` + const { innerWidth, innerHeight } = window + const { width: screenWidth, height: screenHeight } = screen + const ratio = gcd(innerWidth, innerHeight) + const screenRatio = gcd(screenWidth, screenHeight) + const aspectRatio = `${innerWidth/ratio}/${innerHeight/ratio}` + const deviceAspectRatio = `${screenWidth/screenRatio}/${screenHeight/screenRatio}` const el = document.getElementById('fingerprint-data') patch(el, html`