-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
355 lines (320 loc) · 11.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- NO permitir Zoom en movil-->
<!--<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1, minimum-scale=1">-->
<!-- SI permitir Zoom en movil-->
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1">
<meta name="keywords" content="JavaScript, library, internet explorer, tool, device, detect, edge legacy">
<meta name="description" content="Device.js is a JavaScript library to detect device, viewport, and browser information using plain JavaScript.">
<meta name="author" content="Emanuel Rojas Vasquez">
<title>Device.js</title>
<link rel="icon" href="Device-favicon.png" type="image/png" sizes="16x16">
<link href="normalize.min.css" rel="stylesheet">
<link href="index.css" rel="stylesheet">
<script src="Device.min.js"></script>
<!--
<div id="dpi" style="height: 1in; width: 1in; left: 100%; position: fixed; top: 100%;"></div>
<b>Your Device Screen Size in Centimeters <br /><br /><h3>If Your Device is :<br />
-->
</head>
<body>
<a href="https://github.com/erovas/Device.js">
<h1>Device.js</h1>
</a>
<!--
<script>
var dpi_x = document.getElementById('dpi').offsetWidth;
var dpi_xx = parseFloat(getComputedStyle(document.getElementById('dpi')).width);
var dpi_y = document.getElementById('dpi').offsetHeight;
var dpi_yy = parseFloat(getComputedStyle(document.getElementById('dpi')).height);
var width = screen.width / dpi_x / window.devicePixelRatio;
var height = screen.height / dpi_y / window.devicePixelRatio;
document.write('Desktop Aspect Ratio : ' + (Math.max(width, height) / Math.min(width, height)) + ' <br>');
document.write('Desktop dpi_x : ' + dpi_x + ' <br>');
document.write('Desktop dpi_xx : ' + dpi_xx + ' <br>');
document.write('Desktop dpi_y : ' + dpi_y + ' <br>');
document.write('Desktop dpi_yy : ' + dpi_yy + ' <br>');
document.write('Desktop Height : ' + height + ' <br>');
document.write('Desktop Width : ' + width + ' <br>');
var asd = 1.727 //BIEN - Probado en mi portatil con 15.9"
var widthMB2 = width * asd//Math.floor( width * 1.99) ; //ratio for Android mobile and iPads
var heightMB2 = height * asd//Math.floor( height * 1.79) ; //ratio for Android mobile and iPads
document.write('<br>');
document.write('<hr>');
document.write('Desktop WINDOWS demo Size : ' + (widthMB2 / 2.54) + ' x ' + (heightMB2 / 2.54) + ' inch <br>');
document.write('Desktop WINDOWS aspect ratio : ' + (widthMB2 / heightMB2) + ' <br>');
document.write('Desktop WINDOWS demo Size : ' + (widthMB2) + ' x ' + (heightMB2) + ' cm <br>');
document.write('Desktop WINDOWS demo diagonal : ' + ( Math.sqrt(widthMB2 * widthMB2 + heightMB2 * heightMB2) / 2.54 ) + ' inch ');
document.write('<br>');
var asd2 = 3 //BIEN - Probado Iphone SE 2020 con pantalla 4.7"
var widthiPhone = width * asd2//Math.floor( width * 3.40) ; //ratio for iPhone
var heightiPhone = height * asd2//Math.floor( height * 3.1) ; //ratio for iPhone
document.write('<br>');
document.write('<hr>');
document.write('Apple iPhones Size : ' + (widthiPhone / 2.54) + ' x ' + (heightiPhone / 2.54) + ' inch <br>');
document.write('Apple iPhones diagonal : ' + ( Math.sqrt(widthiPhone*widthiPhone + heightiPhone * heightiPhone) / 2.54) + ' inch <br>');
document.write('Apple iPhones aspect ratio : ' + ( Math.max(width, height) / Math.min(width, height) ) + ' <br>');
//document.write('Apple iPhones aspect ratio : ' + ( Math.max(widthiPhone, heightiPhone) / Math.min(widthiPhone, heightiPhone) ) + ' inch <br>');
document.write('<br>');
var asd3 = 3.822 //BIEN - MAC air 13.3"
var widthMB3 = width * asd3//Math.floor( width * 1.99) ; //ratio for Android mobile and iPads
var heightMB3 = height * asd3//Math.floor( height * 1.79) ; //ratio for Android mobile and iPads
document.write('<br>');
document.write('<hr>');
document.write('Desktop MAC demo Size : ' + (widthMB3 / 2.54) + ' x ' + (heightMB3 / 2.54) + ' inch <br>');
document.write('Desktop MAC aspect ratio : ' + (widthMB3 / heightMB3) + ' <br>');
document.write('Desktop MAC demo Size : ' + (widthMB3) + ' x ' + (heightMB3) + ' cm <br>');
document.write('Desktop MAC demo diagonal : ' + ( Math.sqrt(widthMB3 * widthMB3 + heightMB3 * heightMB3) / 2.54 ) + ' inch ');
document.write('<br><br>');
var qwerty = 3.656
var widthMB = width * qwerty//Math.floor( width * 1.79) ; //ratio for Android mobile and iPads
var heightMB = height * qwerty//Math.floor( height * 1.79) ; //ratio for Android mobile and iPads
document.write('<br />');
document.write('<hr>');
document.write('Android Mobile Size : ' + (widthMB / 2.54) + ' x ' + (heightMB / 2.54) + ' inch <br>');
document.write('Android Mobile Size : ' + (widthMB) + ' x ' + (heightMB) + ' cm <br>');
document.write('Android Mobile diagonal : ' + ( Math.sqrt(widthMB * widthMB + heightMB * heightMB) / 2.54 ) + ' inch ');
document.write('<br />');
/*
var widthCM = Math.ceil( width * 3.2) ;
var heightCM = Math.ceil( height * 2.98) ;
document.write('<br />');
document.write('<hr>');
document.write('Desktop / Laptop Size : ' + (widthCM / 2.54) + ' x ' + (heightCM / 2.54) + ' inch <br />');
document.write('Desktop / Laptop diagonal : ' + ( Math.sqrt(widthCM * widthCM + heightCM * heightCM) / 2.54 ) + ' inch <br />');
document.write('<br />');
document.write('<hr>');
document.write('Apple iPad Size : ' + (widthMB / 2.54) + ' x ' + (heightMB / 2.54) + ' inch <br>');
document.write('Apple iPad diagonal : ' + ( Math.sqrt(widthMB * widthMB + heightMB * heightMB) / 2.54 ) + ' inch ');
document.write('<br /> ');
*/
</script>
-->
<table>
<tr>
<th colspan="2">Operating System (OS)</th>
</tr>
<tr>
<td>name</td>
<td>version</td>
</tr>
<tr>
<td id="OSName"></td>
<td id="OSVersion"></td>
</tr>
</table>
<table>
<tr>
<th colspan="3">browser</th>
</tr>
<tr>
<td>name</td>
<td>major</td>
<td>version</td>
</tr>
<tr>
<td id="browserName"></td>
<td id="browserMajor"></td>
<td id="browserVersion"></td>
</tr>
</table>
<table>
<tr>
<th>Architecture (CPU)</th>
</tr>
<tr>
<td id="CPU"></td>
</tr>
</table>
<table>
<tr>
<th colspan="3">Type</th>
</tr>
<tr>
<td>isMobile</td>
<td>isTablet</td>
<td>isDesktop</td>
</tr>
<tr>
<td id="isMobile"></td>
<td id="isTablet"></td>
<td id="isDesktop"></td>
</tr>
</table>
<table>
<tr>
<th colspan="3">Viewports</th>
</tr>
<tr>
<td></td>
<td>width</td>
<td>height</td>
</tr>
<tr>
<td>resolution</td>
<td id="wresolution"></td>
<td id="hresolution"></td>
</tr>
<tr>
<td>screenViewport</td>
<td id="wscreenViewport"></td>
<td id="hscreenViewport"></td>
</tr>
<tr>
<td>innerViewport</td>
<td id="winnerViewport"></td>
<td id="hinnerViewport"></td>
</tr>
<tr>
<td>outerViewport</td>
<td id="wouterViewport"></td>
<td id="houterViewport"></td>
</tr>
<tr>
<td>clientViewport</td>
<td id="wclientViewport"></td>
<td id="hclientViewport"></td>
</tr>
<tr>
<td>availViewport</td>
<td id="wavailViewport"></td>
<td id="havailViewport"></td>
</tr>
<tr>
<td>vw - vh</td>
<td id="vw"></td>
<td id="vh"></td>
</tr>
</table>
<table>
<tr>
<td style="width: 55%;">open keyboard (mobile)</td>
<td> <input style="width: 90%;"> </td>
</tr>
<tr>
</tr>
</table>
<table>
<tr>
<th colspan="2">addressBar</th>
</tr>
<tr>
<td>width</td>
<td>height</td>
</tr>
<tr>
<td id="waddressBarSize"></td>
<td id="haddressBarSize"></td>
</tr>
</table>
<table>
<tr>
<th colspan="3">scrollBar</th>
</tr>
<tr>
<td></td>
<td>X</td>
<td>Y</td>
</tr>
<tr>
<td>width</td>
<td id="scrollBarXWidth"></td>
<td id="scrollBarYWidth"></td>
</tr>
<tr>
<td>height</td>
<td id="scrollBarXHeight"></td>
<td id="scrollBarYHeight"></td>
</tr>
<tr>
<td>position</td>
<td id="scrollBarXPosition"></td>
<td id="scrollBarYPosition"></td>
</tr>
<tr>
<td>maxPosition</td>
<td id="scrollBarXMaxPosition"></td>
<td id="scrollBarYMaxPosition"></td>
</tr>
<tr>
<td>ACTIVATED</td>
<td>
<label>
<input type="checkbox" id="checkScrollX">
</label>
</td>
<td>
<label>
<input type="checkbox" id="checkScrollY">
</label>
</td>
</tr>
</table>
<table>
<tr>
<th colspan="2">orientation</th>
</tr>
<tr>
<td>angle</td>
<td>type</td>
</tr>
<tr>
<td id="angle"></td>
<td id="type"></td>
</tr>
</table>
<table>
<tr>
<th colspan="2">Miscelaneous</th>
</tr>
<tr>
<td>isDarkMode</td>
<td id="isDark"></td>
</tr>
<tr>
<td>isLightMode</td>
<td id="isLight"></td>
</tr>
<tr>
<td>isSafeConnection</td>
<td id="isSafe"></td>
</tr>
<tr>
<td>isFullscreen</td>
<td id="isFullScreen"></td>
</tr>
<tr>
<td>isPortrait</td>
<td id="isPortrait"></td>
</tr>
<tr>
<td>isLandscape</td>
<td id="isLandscape"></td>
</tr>
<tr>
<td>isTouchScreen</td>
<td id="isTouchScreen"></td>
</tr>
<tr>
<td>touchPoints</td>
<td id="touchPoints"></td>
</tr>
<tr>
<td>pixelRatio</td>
<td id="pixelRatio"></td>
</tr>
<tr>
<td>workers</td>
<td id="workers"></td>
</tr>
</table>
<a class="anchor-repository" href="https://github.com/erovas/Device.js">
Github repository
</a>
<div style="height:50px;"></div>
<script src="index.js"></script>
</body>
</html>