-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1.html
More file actions
134 lines (121 loc) · 3.32 KB
/
1.html
File metadata and controls
134 lines (121 loc) · 3.32 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
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
<html>
<head> <title> QUIZZER! </title>
<style type="text/css">
<!--
a:link {
text-decoration:underline
}
a:visited {
color:black; text-decoration:underline
}
a:active {
color:red; text-decoration:underline
}
a:hover {
color:Green; font-size:32px; font-weight:bold; font-style:italic; text-decoration:underline
}
body {
background:url(/bg.jpg) repeat fixed; color:Green; font-size:18px; font-weight:bold; font-family:Arial;
}
--></style>
</head>
<body>
<h1 style="text-align:center"> Unjumble the Jumbled </h1>
<h4 style="text-align:center"></h4>
<p id="img" align=center style="float:center"></p>
<h4 style="text-align:center"></h4>
<p id="hint" align=center></p>
<p id="name" style="text-align:center"></p>
<br/>
<p align=center>
GUESS : <input type="text" name="input_str" id="input_str" align=center style="text-align:center" value="Enter the brand name"/><br/>
<button onclick="hint_1()">Hint</button>
<!-- <button onclick="hint_2()">hint-2</button> -->
<button onclick="check()">submit</button>
</p>
<fb:like href="https://www.facebook.com/pages/Logo-Quiz/519844888042075?fref=ts" layout="standard" show-faces="true" width="450" action="like" colorscheme="light" />
<script type="text/javascript" charset="UTF-8" src="in.js"> </script>
<script>
var score=0;
var j=Math.floor((Math.random()*40+7));
var hint=2;
start(j);
function shuffle(string) {
var parts = string.split('');
for (var i = parts.length; i > 0;) {
var random = parseInt(Math.random() * i);
var temp = parts[--i];
parts[i] = parts[random];
parts[random] = temp;
}
return parts.join('');
}
function start() {
document.getElementById("name").innerHTML=shuffle(names[j]);
document.getElementById("hint").innerHTML="no.of hints left=" + hint;
if(item[j]=="food")
document.getElementById("img").innerHTML="<img src='food.png' width='20%'/>";
else if(item[j]=="car")
document.getElementById("img").innerHTML="<img src='car.jpg' width='20%'/>";
else if(item[j]=="sports")
document.getElementById("img").innerHTML="<img src='sports.gif' width='20%'/>";
else if(item[j]=="cartoons")
document.getElementById("img").innerHTML="<img src='cartoons.gif' width='20%'/>";
else if(item[j]=="web")
document.getElementById("img").innerHTML="<img src='web.png' width='20%'/>";
}
function check()
{
var x = document.getElementById("input_str").value;
if(x==names[j])
{
score+=1;
if(score%5==0)
{
hint+=1;
}
if(score==10)
{
document.getElementById("hint").innerHTML="Winner";//to add a winning wall paper
alert("congrats you win");
}
alert("correct !! Your score is"+score);
start(j=Math.floor((Math.random()*10+1)));
return;
}
else
{
alert("Wrong");
}
}
function hint_1()
{
if(hint>0)
{
document.getElementById("hint").innerHTML="<img "+"width='10%'"+"src="+"logos/"+arr_1[j]+" />" ;
//alert(arr_1[j]);//might be incorrect because the value of j may not change
hint-=1;
}
if(hint<0)
{
document.getElementById("hint").innerHTML="No more hints left";
//alert("No more hints left");
}
}
function hint_2()
{
if(hint>0)
{
document.getElementById("hint").innerHTML=arr_1[j];
//alert(arr_1[j]);//might be incorrect because the value of j may not change
hint-=1;
}
if(hint<0)
{
document.getElementById("hint").innerHTML="No more hints left";
//alert("No more hints left");
}
}
</script>
</body>
</html>