diff --git a/diu/diuJS.js b/diu/diuJS.js index 1d14cb2..bcbd5d2 100644 --- a/diu/diuJS.js +++ b/diu/diuJS.js @@ -6,6 +6,7 @@ var vres1 = $('#INPUT_VRES').val(); var ar1 = hres1 / vres1; + var diag = parseFloat(size); var width = size * Math.sin(Math.atan(hres1 / vres1)); var height = size * Math.cos(Math.atan(hres1 / vres1)); var area = width * height; @@ -30,6 +31,7 @@ */ display(new UNIT(unit_select), [ + ['RESULT_DIAG', 1, diag.toFixed(3) , (size != '' && size != 0) ], ['RESULT_WIDTH', 1, width.toFixed(3) , (hres1 != '' && vres1 != '' && size != '' && hres1 != 0 && vres1 != 0 && size != 0) ], ['RESULT_HEIGHT', 1, height.toFixed(3) , (hres1 != '' && vres1 != '' && size != '' && hres1 != 0 && vres1 != 0 && size != 0) ], ['RESULT_AREA', 2, area.toFixed(3) , (hres1 != '' && vres1 != '' && size != '' && hres1 != 0 && vres1 != 0 && size != 0) ], @@ -171,7 +173,10 @@ function prefixGen(num, precision) { function pxPrefix(num, precision) { var x = prefixGen(num, precision); return (x['num'] + ' ' + x['prefix'] + 'px'); -} function GCD(a, b) { +} + + +function GCD(a, b) { a = Math.abs(a); b = Math.abs(b); if (b > a) { var temp = a; a = b; b = temp; } @@ -181,7 +186,8 @@ function pxPrefix(num, precision) { if (a == 0) return b; b %= a; } -} +} + function commas(x) { var parts = x.toString().split("."); diff --git a/diu/index.html b/diu/index.html index 8cb0040..7930306 100644 --- a/diu/index.html +++ b/diu/index.html @@ -14,6 +14,7 @@ font-family: "Consolas", "Inconsolata", "Lucida Console", Monospace; font-size: 15px; min-height: 100%; + overflow-y: scroll; } div.wrapper { @@ -25,7 +26,6 @@ border: 0px solid transparent; font-size: 15px; padding-bottom: 48px; - margin-left: auto; margin-right: auto; } @@ -38,17 +38,16 @@ vertical-align: middle; background-color: #DDDDDD; cursor: pointer; - min-width: 512px; } div.title { - margin-left:auto; - margin-right:auto; - text-align:center; - font-weight:bold; - background-color:#DDDDDD; - padding:8px; + margin-left: auto; + margin-right: auto; + text-align: center; + font-weight: bold; + background-color: #DDDDDD; + padding: 8px; } span.title { @@ -56,41 +55,41 @@ } input { - padding:4px; - text-align:center; + padding: 4px; + text-align: center; } - input[type="text"] { - border:1px solid #CCCCCC; - background-color:#F4F4F8; - } + input[type="text"] { + border: 1px solid #CCCCCC; + background-color: #F4F4F8; + } - input.res_input { - width:50px; - } + input.res_input { + width: 50px; + } table { - margin-left:auto; - margin-right:auto; - border:0px solid black; + margin-left: auto; + margin-right: auto; + border: 0px solid black; } td { - padding:8px; - vertical-align:middle; - border:solid 1px transparent; + padding: 8px; + vertical-align: middle; + border: solid 1px transparent; } - td.label { - font-weight:bold; - min-width:192px; - text-align:right; - } + td.label { + font-weight: bold; + min-width: 192px; + text-align: right; + } - td.result { - min-width:120px; - width:100%; - } + td.result { + min-width: 120px; + width: 100%; + } a:link { color: #777777; @@ -114,16 +113,25 @@ sup { vertical-align: baseline; - position:relative; - top:-0.4em; - line-height:0; + position: relative; + top: -0.4em; + line-height: 0; } sub { vertical-align: baseline; - position:relative; - top:0.3em; - line-height:0; + position: relative; + top: 0.3em; + line-height: 0; + } + + span.res_x { + font-family: 'Courier New'; + font-size: 10px; + vertical-align: baseline; + position: relative; + top: -0.1em; + line-height: 0; } @@ -139,7 +147,7 @@
-
Display Info Utility

+
Display Info Utility

DISPLAY INFO UTILITY
@@ -147,21 +155,21 @@ Size: - +
-
- +
+
Resolution: - - - + + + @@ -180,6 +188,10 @@ Pixel Density: + + Diagonal: + + Width: @@ -200,7 +212,7 @@ Companion Resolution
or Aspect Ratio: - + @@ -208,9 +220,9 @@   Warning: Formats commonly known as "21:9" are not an exact 21:9 ratio
-   2560 1080 is a 64:27 ratio
-   3440 1440 is a 43:18 ratio
-   3840 1600 is a 12:5 ratio
+   2560 1080 is a 64:27 ratio
+   3440 1440 is a 43:18 ratio
+   3840 1600 is a 12:5 ratio