-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresolution.html
More file actions
82 lines (82 loc) · 2.78 KB
/
Copy pathresolution.html
File metadata and controls
82 lines (82 loc) · 2.78 KB
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
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Résolution de l'écran</title>
<script src="webix/webix.js"></script>
<link rel="stylesheet" href="webix/webix.css">
<script src="js/utils.js"></script>
</head>
<body>
<script>
secret = "097YZPIE?117116111098117115SSDJ";
webix.ready(function() {
webix.ui({
rows: [
{},
{
cols:[
{},
{
view:"form",
id:"screen-form",
width:400,
elements:[
{
autoheight:true,
borderless:true,
template:"Quelle est la résolution de l'écran que vous utilisez actuellement ?"
},
{
view:"text",
label: "Largeur (en pixels) :",
labelWidth:150,
name: "width",
id: "width",
validate: webix.rules.isNumber
},
{
view:"text",
label: "Hauteur (en pixels) :",
labelWidth:150,
name: "height",
id: "height",
validate: webix.rules.isNumber
},
{
view:"button",
width:100,
label:"Vérifier",
align:"center",
click: function(e) {
if ($$('screen-form').validate()) {
var width = window.screen.width;
var height = window.screen.height;
var test = ($$('width').getValue() == width && $$('height').getValue() == height);
if (!test && window.devicePixelRatio) {
test = ($$('width').getValue() == Math.round(width*window.devicePixelRatio) && $$('height').getValue() == Math.round(height*window.devicePixelRatio));
}
if (test) {
webix.alert("Bravo !<br>Le mot que vous cherchez est « "+getWord()+" »");
} else {
webix.alert("Désolé, ce n'est pas ça.");
}
} else {
webix.alert("Vous devez entrer des nombres entiers.");
}
}
}
]
},
{}
]
},
{}
]
});
});
</script>
</body>
</html>