Skip to content

Commit

Permalink
Create vvscale.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorin-Oakenpants authored Sep 6, 2023
1 parent 8be83a1 commit bae953b
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions vvscale.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>vvscale</title>
<style>
.mono {font-family: monospace, "Courier New"; font-size: 12px;}
</style>
</head>

<body>
<br>
<span class="mono">
visualViewport.scale = <span id="vvscale"></span>
</span>

<script>
'use strict';
const el = document.getElementById("vvscale")

function get_scale() {
try {
el.innerHTML = visualViewport.scale
} catch(e) {
el.innerHTML = e
}
}

try {
visualViewport.onresize = () => {
get_scale()
}
} catch(e) {
el.innerHTML = e
}

</script>
</body>
</html>

0 comments on commit bae953b

Please sign in to comment.