-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8be83a1
commit bae953b
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |