-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
290 lines (204 loc) · 10.9 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
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- %@page
language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"% -->
<html>
<head>
<title>X O Game</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<!-- CSS only -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="styles.css">
</head>
<body>
<nav class="navbar fixed-top navbar-light bg-light">
<br><br>
<header style="color:black; background-color:white;" id="navbar">
<nav style="color:black; background-color:white;" class="navbar-container container">
<a style="color:black; font-size:25px;" href="#" class="home-link">
<div class="navbar-logo"></div>
<span style="color: red;" class="a"><b> X </b></span>
<span style="color: #2EBF75;" class="b"><b> O </b></span>
<span style="color: yellow;" class="c"><b>Ga</b></span>
<span style="color: blue;" class="d"><b>me</b></span>
</a>
<button style="color:black; onclick:none;" type="button" class="navbar-toggle" aria-label="Open navigation menu" style="white-space:nowrap;">
<span style="color:black; onclick:none; background-color:black;" class="icon-bar"></span>
<span style="color:black; onclick:none; background-color:black;" class="icon-bar"></span>
<span style="color:black; onclick:none; background-color:black;" class="icon-bar"></span>
</button>
<div style="color:black; onclick:none;" class="navbar-menu detached" style="white-space:nowrap;">
<ul style="color:black; onclick:none; background-color:white;" class="navbar-links" style="white-space:nowrap;">
<li style="color:black; background-color:white;" class="navbar-item"><a style="color:black; background-color:white; white-space:nowrap;" style="white-space:nowrap;" class="navbar-link" style="white-space:nowrap;" href="https://strivedi4u.github.io/game/number/">Number Game</a></li>
<li style="color:black; background-color:white;" class="navbar-item"><a style="color:black; background-color:white; white-space:nowrap;" style="white-space:nowrap;" class="navbar-link" style="white-space:nowrap;" href="https://strivedi4u.github.io/game/">Toss Game </a></li>
<li style="color:black; background-color:white;" class="navbar-item"><a style="color:black; background-color:white; white-space:nowrap;" class="navbar-link" href="whatsapp://send?text=This is a X O Game. I request you to play this game and enjoy it. %0a 👇👇👇👇👇👇👇👇👇 %0a
https://strivedi4u.github.io/tictatoe"><img height="30px;" weight="30px;" src="https://1.bp.blogspot.com/-rJiaji8A2Q0/XtXMxCWKCaI/AAAAAAAAAx4/_5P8x-4jVy8Ueg7M04kKP2rhdhxmECNKQCK4BGAsYHg/i.gif" >WhatsApp</a> </li>
</ul>
</div>
</nav>
</header>
<script>
const navbar = document.getElementById("navbar");
const navbarToggle = navbar.querySelector(".navbar-toggle");
function openMobileNavbar() {
navbar.classList.add("opened");
navbarToggle.setAttribute("aria-label", "Close navigation menu.");
}
function closeMobileNavbar() {
navbar.classList.remove("opened");
navbarToggle.setAttribute("aria-label", "Open navigation menu.");
}
navbarToggle.addEventListener("click", () => {
if (navbar.classList.contains("opened")) {
closeMobileNavbar();
} else {
openMobileNavbar();
}
});
const navbarMenu = navbar.querySelector(".navbar-menu");
const navbarLinksContainer = navbar.querySelector(".navbar-links");
navbarLinksContainer.addEventListener("click", (clickEvent) => {
clickEvent.stopPropagation();
});
navbarMenu.addEventListener("click", closeMobileNavbar);
document
.getElementById("options")
.querySelectorAll("input[name='navtype']")
.forEach((option) => {
option.addEventListener("change", (e) => {
const navType = e.target.id.split("-").join(" ");
navbarMenu.classList = "navbar-menu " + navType;
});
});
</script>
</nav>
<br><br><br>
<div class="card">
<div style="text-align:center" class="card-header">
<h6 id ="turn" style= "color:red; padding-top:4px;">Player O Turn </h6>
</div>
</div>
<div style = "margin-top: 8px;" class="col twelve whole">
<div class="flex-container">
<button style= "border: none;" onclick= "submit(1)" class="flex-item" id="flex1"></button>
<button style= "border: none;" onclick= "submit(2)" class="flex-item" id="flex2"></button>
<button style= "border: none;" onclick= "submit(3)" class="flex-item" id="flex3"></button>
</div>
<div class="flex-container">
<button style= "border: none;" onclick= "submit(4)" class="flex-item" id="flex4"></button>
<button style= "border: none;" onclick= "submit(5)" class="flex-item" id="flex5"></button>
<button style= "border: none;" onclick= "submit(6)" class="flex-item" id="flex6"></button>
</div>
<div class="flex-container">
<button style= "border: none;" onclick= "submit(7)" class="flex-item" id="flex7"></button>
<button style= "border: none;" onclick= "submit(8)" class="flex-item" id="flex8"></button>
<button style= "border: none;" onclick= "submit(9)" class="flex-item" id="flex9"></button>
</div>
</div> <br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<div class="card">
<div id ="result" style="text-align:center" class="card-header">
This Game is Developed by Shashank Trivedi.
</div>
</div>
</div>
</div>
<script>
sessionStorage.clear();
let data = sessionStorage.getItem('no');
console.log(data);
function setData(){
document.getElementById("flex1").textContent = sessionStorage.getItem('1');
document.getElementById("flex2").textContent = sessionStorage.getItem('2');
document.getElementById("flex3").textContent = sessionStorage.getItem('3');
document.getElementById("flex4").textContent = sessionStorage.getItem('4');
document.getElementById("flex5").textContent = sessionStorage.getItem('5');
document.getElementById("flex6").textContent = sessionStorage.getItem('6');
document.getElementById("flex7").textContent = sessionStorage.getItem('7');
document.getElementById("flex8").textContent = sessionStorage.getItem('8');
document.getElementById("flex9").textContent = sessionStorage.getItem('9');
}
var k = 0;
function result(p){
var a = sessionStorage.getItem('1');
var b = sessionStorage.getItem('2');
var c = sessionStorage.getItem('3');
var d = sessionStorage.getItem('4');
var e = sessionStorage.getItem('5');
var f = sessionStorage.getItem('6');
var g = sessionStorage.getItem('7');
var h =sessionStorage.getItem('8');
var i = sessionStorage.getItem('9');
if( (a+b+c) == 'XXX' || (d+e+f) == 'XXX' || (g+h+i) == 'XXX' || (a+d+g) == 'XXX' || (b+e+h) == 'XXX' ||(c+f+i) == 'XXX' || (a+e+i) == 'XXX' ||(c+e+g) == 'XXX'){
document.getElementById('result').innerHTML = "X Win";
document.getElementById('turn').innerText= "Congratulations";
k = 0;
setTimeout(function() { sessionStorage.clear(); }, 1000);
setTimeout(function(){
window.location.href = 'https://strivedi4u.github.io/tictatoe/xenjoy.html';
}, 2000);
}
else if( (a+b+c) == 'OOO' || (d+e+f) == 'OOO' || (g+h+i) == 'OOO' || (a+d+g) == 'OOO' || (b+e+h) == 'OOO' ||(c+f+i) == 'OOO' || (a+e+i) == 'OOO' ||(c+e+g) == 'OOO') {
document.getElementById('result').innerHTML = "O Win";
document.getElementById('turn').innerText= "Congratulations";
setTimeout(function() { sessionStorage.clear(); }, 1000);
setTimeout(function(){
window.location.href = 'https://strivedi4u.github.io/tictatoe/oenjoy.html';
}, 2000);
k = 0;
}
else if(p >8) {
k = 0;
document.getElementById('result').innerHTML = "Draw";
document.getElementById('turn').innerText = "Oh No!";
setTimeout(function() { sessionStorage.clear(); }, 1000);
setTimeout(function(){
window.location.href = 'https://strivedi4u.github.io/tictatoe/draw.html';
}, 2000);
}
}
function submit(x) {
var no = x;
var data = sessionStorage.getItem(no);
document.getElementById('result').innerText = "This Game is Developed by Shashank Trivedi.";
if(data == "X" || data == "O"){
document.getElementById('result').innerHTML = "Value Already Store";
}
else{
k++;
}
if(k%2 == 0){
sessionStorage.setItem(no, "X");
document.getElementById('turn').textContent= "Player O Turn";
}
else {
sessionStorage.setItem(no, "O");
document.getElementById('turn').textContent = "Player X Turn";
}
setData();
result (k);
}
</script>
<br><br>
<br><br><br><br>
<div style= "position:fixed; bottom:0px;
background-color: brown;
display: inline-block;
padding:0px;
width:100%;" class="footer">
<center>
<a href="
https://www.facebook.com/sharer/sharer.php?u=
https://strivedi4u.github.io/tictatoe" target="blank" class="facebook"><i style="margin-top:15px;" class="fa fa-facebook"></i></a>
<a href="https://twitter.com/intent/tweet?text=This is a X O Game. I request you to play this game and enjoy it. %0a 👇👇👇👇👇👇👇👇👇 %0a
https://strivedi4u.github.io/tictatoe" target="blank" class="twitter"><i style="margin-top:15px;" class="fa fa-twitter"></i></a>
<a href="whatsapp://send?text=This is a X O Game. I request you to play this game and enjoy it. %0a 👇👇👇👇👇👇👇👇👇 %0a
https://strivedi4u.github.io/tictatoe" class="google"><i style="margin-top:15px;" class="fa fa-whatsapp"></i></a>
<a href="https://www.linkedin.com/shareArticle?mini=true&url=https://strivedi4u.github.io/gussing&title=Gussing Number Game&summary= This is a X O Game. I request you to play this game and enjoy it. %0a 👇👇👇👇👇👇👇👇👇 %0a
https://strivedi4u.github.io/tictatoe” target="blank" class="linkedin"> <i style="margin-top:15px;" class="fa fa-linkedin"></i></a>
<a href="https://www.instagram.com/?url=https://strivedi4u.github.io/tictatoe/" class="youtube"><i style="margin-top:15px;" class="fa fa-instagram"></i></a>
</center>
</div>
</body>
</html>