-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
105 lines (68 loc) · 3.73 KB
/
test.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
<!DOCTYPE html>
<html>
<head>
</head>
<style>
svg{
display: none;
fill: green;
}
#svgtick{
fill: green;
}
#svgcross{
fill: red;
}
.demo
{
font-size: 50px;
text-align: right;
align-content: right;
width: 100px;
height: 50px;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
</style>
<body onload="myFunction()">
<div>
<div class="demo" id="firstno"> </div>
<div class="demo" id="secondno"> </div>
<div> <input type="number" id="result" onkeydown="three()" class="demo"> </div>
</div>
<script>
var x = Math.floor((Math.random() * 5));
var y = Math.floor((Math.random() * 5));
var z = (x + y);
function myFunction() {
document.getElementById("firstno").innerHTML = " " + x;
document.getElementById("secondno").innerHTML = " + " + y;
}
function four() {
document.getElementById("svgtick").style.display = "block";
}
function five() {
document.getElementById("svgcross").style.display = "block";
}
function three (){
var a = document.getElementById("result");
a.addEventListener("keydown", function (e) {
if (e.keyCode === 13) {
var answ = document.getElementById("result").value;
if (answ == z){
four();} else {
five();
}
}
});
}
</script>
<svg id="svgtick" width="70" height="70" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<path class="cls-1" d="M157,325a7.92,7.92,0,0,1,2.82-.42,8.64,8.64,0,0,1,1.44.08,9.69,9.69,0,0,1,1.43.23l1.42.34c.46.15.91.32,1.36.48a21,21,0,0,1,2.67,1.14,46.81,46.81,0,0,1,9.45,6.65,87,87,0,0,1,7.91,8.39c1.18,1.51,2.44,3,3.56,4.52l3.36,4.66-3,.43,2.15-6.67,2.49-6.56c.91-2.15,1.91-4.26,2.86-6.4s2.12-4.16,3.18-6.25,2.3-4.06,3.48-6.08,2.53-3.93,3.78-5.89c2.63-3.87,5.37-7.65,8.36-11.23a138.53,138.53,0,0,1,19.77-19.72A105.53,105.53,0,0,1,259,268a140.31,140.31,0,0,0-21.92,16.6,167.16,167.16,0,0,0-18.52,20.13c-2.79,3.61-5.47,7.29-8,11.09-1.2,1.93-2.5,3.81-3.63,5.78s-2.34,3.91-3.42,5.91-2.14,4-3.15,6.05l-2.87,6.2-2.6,6.3-2.27,6.44-1.17,3.3-1.88-2.87-3.08-4.69c-1-1.58-2.18-3-3.26-4.57l-.82-1.14-.89-1.08-1.75-2.19c-.56-.75-1.2-1.42-1.83-2.12l-1.87-2.07a48.42,48.42,0,0,0-8.55-7.11,21.41,21.41,0,0,0-2.43-1.35c-.42-.2-.84-.41-1.27-.59l-1.31-.47c-.43-.17-.89-.24-1.34-.37a9.06,9.06,0,0,0-1.38-.25A7.76,7.76,0,0,0,157,325Z" transform="translate(-157 -268)"/></svg>
<svg id="svgcross" width="70" height="70" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140"><path class="cls-1" d="M134.68,211.07a215.1,215.1,0,0,1,23.29,6.5,221.19,221.19,0,0,1,22.51,9c3.71,1.62,7.29,3.51,10.9,5.36,1.81.89,3.54,2,5.31,2.93s3.55,2,5.28,3l5.15,3.23,2.57,1.62,2.5,1.74,5,3.47,1.25.87,1.2.93,2.42,1.85,4.79,3.75,4.61,4c1.52,1.34,3.1,2.62,4.57,4l4.38,4.23,2.18,2.12,1.09,1.06,1,1.12,4.12,4.48c2.82,2.91,5.3,6.14,7.85,9.28a180.94,180.94,0,0,1,25.06,41.33,238.93,238.93,0,0,0-27.47-39.35c-2.65-3-5.18-6.07-8-8.88l-4.15-4.3-1-1.08-1.09-1-2.19-2-4.36-4.1c-1.45-1.36-3-2.6-4.52-3.91l-4.55-3.86-4.74-3.65a249,249,0,0,0-40.48-25.4c-7.12-3.65-14.43-6.92-21.85-9.95S142.32,213.62,134.68,211.07Z" transform="translate(-134.68 -210.22)"/><path class="cls-1" d="M281.56,210.22c-7.63,2.57-15.18,5.3-22.58,8.4s-14.71,6.34-21.81,10a248.59,248.59,0,0,0-40.41,25.52L192,257.81l-4.54,3.88c-1.5,1.31-3.06,2.56-4.51,3.92l-4.34,4.11-2.18,2-1.1,1-1,1.08-4.14,4.32c-2.82,2.82-5.35,5.91-8,8.91a239.46,239.46,0,0,0-27.35,39.42,181.34,181.34,0,0,1,24.94-41.4c2.55-3.15,5-6.38,7.83-9.3l4.1-4.49,1-1.12,1.08-1.07L176,267l4.37-4.24c1.47-1.4,3-2.68,4.56-4l4.6-4,4.78-3.76,2.41-1.86,1.21-.93,1.24-.88,5-3.49,2.5-1.74,2.56-1.63,5.14-3.25c1.72-1.06,3.51-2,5.27-3s3.49-2.05,5.31-3c3.59-1.86,7.17-3.76,10.88-5.4a221.1,221.1,0,0,1,22.48-9A212.86,212.86,0,0,1,281.56,210.22Z" transform="translate(-134.68 -210.22)"/></svg>
</body>
</html>