-
Notifications
You must be signed in to change notification settings - Fork 2
/
game.html
247 lines (222 loc) · 6.54 KB
/
game.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<script type = "text/javascript">
function fn1(){
var num1 = document.getElementById("num1").value;
var num2 = document.getElementById("num2").value;
var num3 = document.getElementById("num3").value;
var num4 = document.getElementById("num4").value;
console.log(num1+"is");
if(num1==0||num2==0)
{
console.log(num1);
alert("Fill all Tickets!");
exit();
}
else if(num3==0||num4==0)
{
alert("fill all Tickets!");
exit();
}
else if(num1==num2||num1==num3){
alert("Sorry, You can't select 2 same Tickets!");
exit();
}
else if(num2==num3||num2==num4){
alert("Sorry, You can't select 2 same Tickets!");
exit();
}
else if(num3==num4||num1==num4){
alert("Sorry, You can't select 2 same Tickets!");
exit();
}
var con = confirm("Do you really want to select: "+num1+", "+num2+", "+num3+", "+num4);
if(con!=true)
{
exit();
}
var pro = prompt("After Submission, You can't change your ticket. If agree, then Type OK");
if(pro==null)
{
exit();
}
alert("Submitted Successfully!");
document.getElementById("checkresult").innerHTML="Thankyou for Participating.<br><br>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Veritatis nisi totam, dolorem, consequatur dolore deserunt voluptates libero eaque, temporibus odio vitae magnam maiores! Eligendi repudiandae, earum sunt possimus eos autem? Possimus, eaque!<br><br>Check Result Now<br><br><a href ='winner.html' class = 'btnwin' onclick = 'valuesender()' >Check Result</a>";
}
function valueSender(){
const namea = document.getElementById("num1").value;
const nameb = document.getElementById("num2").value;
const namec = document.getElementById("num3").value;
const named = document.getElementById("num4").value;
sessionStorage.setItem("NUMA",namea);
sessionStorage.setItem("NUMB",nameb);
sessionStorage.setItem("NUMC",namec);
sessionStorage.setItem("NUMD",named);
}
</script>
<style>
#welcome{
background-image: url("console.jpg");
background-size: cover;
background-image: image-set(fit);
height:950px;
width:100%;
padding-top:1px;
}
#welcome h1,#name,#welcome h5{
text-align:center;
padding-top:50px;
color:white;
font-size:70px;
}
#welcome h5{
display:flex;
justify-content: center;
align-items: center;
font-size:30px;
color:white;
}
#name{
padding-top:0px;
font-size:80px;
font-weight: bold;
color:white;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
font-style: italic;
}
#ticketselect{
display:flex;
justify-content: center;
padding: 30px 30px;
font-size:30px;
color:purple;
}
h1{
text-align:center;
padding: 30px 30px;
}
#ticketcounter{
display: flex;
flex-direction: column;
align-items: center;
}
#getnum{
display:flex;
color:white;
align-items: center;
justify-content: center;
flex-direction: column;
height:600px;
width:70%;
border: 2px solid purple;
text-align:center;
margin:auto;
background-image:url("rose.jpg");
}
#num1,#num2,#num3,#num4{
font-size:30px;
text-align:center;
color:red;
border-radius: 20px;
padding: 10px 10px;
max-width:70%;
}
.btnwin,.btn{
border-radius: 30px;
color:white;
background-color: black;
font-size:20px;
padding:8px 20px;
}
.btn{
background-color:transparent;
border:1px solid white;
}
.btn:hover::after{
content: attr(data-hover);
}
#checkresult{
padding-top:40px;
text-align: center;
font-size: 30px;
color:rgb(19, 1, 19);
margin-bottom: 20px;
}
#checkresult a{
border:qpx solid white;
color:white;
background-color:black;
text-decoration: none;
border-radius: 25px;
padding: 10px 25px;
font-size:23px;
margin-bottom: 10px;
}
@media only screen and (max-width:1000px)
{
#num1,#num2,#num3,#num4{
font-size:15px;
}
#name{
font-size:52px;
font-weight: lighter;
}
#welcome h1{
font-size:40px;
}
#welcome h5{
font-size:20px;
}
#welcome{
height:750px;
}
#getnum{
width:100%;
}
}
</style>
<body>
<section id = "welcome">
<h1>We Welcomes You </h1>
<p id = "name"></p>
<h5>We hope that you read all rules and regulations.<br>So,here Select the tickets and stand a chance to win upto Rs 1,00,000 cash prizes.</h5>
</section>
<section id = "ticketcounter">
<p id ="ticketselect">Select atleast 4 tickets </p>
</section>
<section id = "getnum">
<input id = "num1" type = "number" placeholder = "Enter 1st Ticket">
<br><br>
<input id = "num2" type = "number" placeholder = "Enter 2nd Ticket">
<br><br>
<input id = "num3" type = "number" placeholder = "Enter 3rd Ticket">
<br><br>
<input id = "num4" type = "number" placeholder = "Enter 4th Ticket">
<br><br>
<button class = "btn" onclick="fn1() ; valueSender() ;" data-hover="→">Submit</button>
<br><br><br>
There will be charged extra money if you buy more than 4 tickets.
</section>
<div id = "firstnumber"></div>
<div id = "secondnumber"></div>
<div id = "thirdnumber"></div>
<div id = "fourthnumber"></div>
<div id = "checkresult"> </div>
</body>
<script>
let name = prompt("Enter your name","Name");
console.log(name);
if(name==0||name==null)
{
alert("We Selected Your Name as: Anonymous");
name = 'Anonymous';
}
document.getElementById("name").innerHTML = name;
console.log(num1);
</script>
</html>