-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTicTacToe.html
158 lines (127 loc) · 4.76 KB
/
TicTacToe.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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="assets/css/font-awesome.css">
<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="assets/css/bootstrap/css/bootstrap.min.css"/>
<link href="assets/css/style.css" rel="stylesheet" type="text/css"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Welcome to Tic tac toe</title>
<link href="assets/css/style.css" rel="stylesheet" type="text/css"/>
<script src="bower_components/jquery/dist/jquery.js"></script>
<script type="text/javascript">
function WebSocketTest()
{
if ("WebSocket" in window)
{
alert("WebSocket is supported by your Browser!");
// Let us open a web socket
var ws = new WebSocket("ws://http://localhost:63342/echo");
ws.onopen = function()
{
// Web Socket is connected, send data using send()
ws.send("Message to send");
alert("Message is sent...");
};
ws.onmessage = function (evt)
{
var received_msg = evt.data;
alert("Message is received...");
};
ws.onclose = function()
{
// websocket is closed.
alert("Connection is closed...");
};
}
else
{
// The browser doesn't support WebSocket
alert("WebSocket NOT supported by your Browser!");
}
}
</script>
</head>
<body>
<header id="header">
<h3>Tic Tac Toe...</h3>
<div>
<span id="currentTime"></span>
</div>
<div class="clear"></div>
</header>
<div>
<h4 class="game-player-name">Player name: </h4>
</div>
<div class="main-container">
<form class="game-form">
<div class="players-amount">
How many players?
<input type="radio" id="onePlayer" name="players-amount" class="radio-btn first-player-radio-btn"
value="one"
checked="checked">
<label for="onePlayer">One</label>
<br>
<input type="radio" id="twoPlayers" name="players-amount" class="radio-btn second-player-radio-btn"
value="two">
<label for="twoPlayers">Two</label>
</div>
<div class="players-name">
<input type="text" class="player player-one-name" id="firstPlayerName" placeholder="Player 1">
<label for="firstPlayerName">First player name</label>
<div class="second-player-input">
<input type="text" class="player player-two-name" id="secondPlayerName" placeholder="Player 2">
<label for="secondPlayerName">Second player name</label>
</div>
</div>
<button class="btn run-game-btn">Run Game</button>
</form>
<div class="game-board">
<div class="local-storage-players">
<div class="local-storage-player-one"></div>
<div class="game-row-one game-row">
<button class="btn game-btn not-used">0</button>
<button class="btn game-btn not-used">1</button>
<button class="btn game-btn not-used">2</button>
</div>
<div class="game-row-two game-row">
<button class="btn game-btn not-used">3</button>
<button class="btn game-btn not-used">4</button>
<button class="btn game-btn not-used">5</button>
</div>
<div class="game-row-three game-row">
<button class="btn game-btn not-used">6</button>
<button class="btn game-btn not-used">7</button>
<button class="btn game-btn not-used">8</button>
</div>
<div>
<button class="start-new-game-btn">Start new game</button>
</div>
</div>
</div>
</div>
<div>
<input type="button" id="tester" value="tester">
</div>
<h1 id="what">
<p id="how">
</p>
</h1>
<p id="countRows" onclick="clearWarningMessage()"></p>
</div>
<footer class="footer">
<p id="footerMessage">
Camel creative technology
</p>
<div id="sse">
<a href="javascript:WebSocketTest()">Run WebSocket</a>
</div>
</footer>
<script src="assets/js/formGame.js"></script>
<script src="assets/js/boardGame.js"></script>
<script src="assets/js/gameControl.js"></script>
<script src="assets/js/storeData.js"></script>
<script src="assets/js/init.js"></script>
</body>
</html>