Skip to content

Commit

Permalink
temp: added screenproperties checker to ibiss
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmerveen committed Oct 22, 2024
1 parent 999bd9f commit e50f137
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions docs/screen-properties.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pennions Screen checker</title>
</head>
<style>
pre {
background-color: lightgrey;
border: 0.5px solid black;
margin: 0 auto;
padding: 2rem;
width: 50%;
margin-top: 10rem;
}
</style>

<body>

<pre id="view">

</pre>
<script>
window.onload = () => {
const viewportWidth = window.innerWidth;
const viewportHeight = window.innerHeight;
const devicePixelRatio = window.devicePixelRatio;

let scalingFactor = window.devicePixelRatio; // Scaling factor
let element = document.querySelector("body");
let computedFontSize = window.getComputedStyle(element).fontSize; // Adjusted font size

let data = `Zoom level: ${scalingFactor}\r\n`;
data += `Adjusted font size of body: ${computedFontSize}\r\n`;
data += `Device Pixel Ratio: ${devicePixelRatio}\r\n`;
data += `Viewport Width: ${viewportWidth}\r\n`;
data += `Viewport Height: ${viewportHeight}\r\n`;
document.getElementById('view').innerText = data;
}
</script>

</body>

</html>

0 comments on commit e50f137

Please sign in to comment.