-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
135 lines (135 loc) · 6.67 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
<!DOCTYPE HTML>
<html>
<head>
<title>Drag & Drop Tic-Tac-Toe with JavaScript By Tran, Kenneth & Kanageswaran, Vithusan</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="styles/TicTacToe.css" />
<script type="text/javascript" src="js/TicTacToe.js"></script>
</head>
<body onload="startUp()" class="noselect">
<header>
<h2>A Game of Tic-Tac-Toe using JavaScript</h2>
</header>
<noscript>
<p>ERROR - Game cannot be loaded!</p>
<p>This is becuase JavaScript is disabled.</p>
<p>This page requires JavaScript to function properly.</p>
<p>Please enable JavaScript and refresh this page to continue.</p>
</noscript>
<div id="content" hidden="hidden">
<p id="status"></p>
<p id="pop" onClick="popClick()" hidden="hidden">Enable / Disable JavaScript Prompts<br /><span id="popBGhint">Red = Disabled, Green = Enabled (Default)</span>
</p>
<div id="preGame" hidden="hidden">
<p id="formNote">~ ~ ~ All Fields Required ~ ~ ~</p>
<p id="formError" hidden="hidden">Error List</p>
<ul id="errorList"></ul>
<div id="p1Form">
<fieldset>
<legend>Player 1 Settings</legend>
<label for="p1Name" id="p1NameLabel">Name</label>
<input type="text" id="p1Name" name="p1Name" placeholder="Player 1 Name" required/>
<br />
<label for="p1Sign" id="p1SignLabel">Zodiac #</label>
<input type="text" id="p1Sign" name="p1Sign" value="4" size="2" maxlength="2" onInput="signColor(event)" onChange="signColor(event)" onFocus="signColor(event)" onBlur= "signColor(event)" required/>
<span id="p1SignLabel1" class="zodiacInfo">( See table below )</span>
</fieldset>
</div>
<div id="p2Form">
<fieldset>
<legend>Player 2 Settings</legend>
<label for="p2Name" id="p2NameLabel">Name</label>
<input type="text" id="p2Name" name="p2Name" placeholder="Player 2 Name" required/>
<br />
<label for="p2Sign" id="p2SignLabel">Zodiac #</label>
<input type="text" id="p2Sign" name="p2Sign" value="5" size="2" maxlength="2" onInput="signColor(event)" onChange="signColor(event)" onFocus="signColor(event)" onBlur= "signColor(event)" required/>
<span id="p2SignLabel1" class="zodiacInfo">( See table below )</span>
</fieldset>
</div>
<div class="clear"></div>
<div id="sign-list">
<table>
<caption>Zodiac Animal Signs</caption>
<thead>
<tr>
<th id="s1" class="notSelected">1</th>
<th id="s2" class="notSelected">2</th>
<th id="s3" class="notSelected">3</th>
<th id="s4" class="notSelected">4</th>
<th id="s5" class="notSelected">5</th>
<th id="s6" class="notSelected">6</th>
<th id="s7" class="notSelected">7</th>
<th id="s8" class="notSelected">8</th>
<th id="s9" class="notSelected">9</th>
<th id="s10" class="notSelected">10</th>
<th id="s11" class="notSelected">11</th>
<th id="s12" class="notSelected">12</th>
</tr>
</thead>
<tbody>
<tr>
<td id="s1a" class="notSelected">Dog</td>
<td id="s2a" class="notSelected">Dragon</td>
<td id="s3a" class="notSelected">Goat</td>
<td id="s4a" class="notSelected">Horse</td>
<td id="s5a" class="notSelected">Monkey</td>
<td id="s6a" class="notSelected">Ox</td>
<td id="s7a" class="notSelected">Pig</td>
<td id="s8a" class="notSelected">Rabbit</td>
<td id="s9a" class="notSelected">Rat</td>
<td id="s10a" class="notSelected">Rooster</td>
<td id="s11a" class="notSelected">Snake</td>
<td id="s12a" class="notSelected">Tiger</td>
</tr>
</tbody>
</table>
</div>
<br />
<button type="submit" id="formSubmit" onMouseOver="buttonHoverIn()" onClick="validateOpt()" onMouseOut="buttonHoverOut()">Ready?</button>
</div>
<div id="game" hidden="hidden">
<p>
<button id="reload" onMouseOver="buttonColorIn(event)" onClick="reload()" onMouseOut="buttonColorOut(event)">New Game / Refresh Page / Clear Stats</button>
<span id="twoButtons" hidden="hidden">~ ~ ~ OR ~ ~ ~</span>
<button id="newRound" onMouseOver="buttonColorIn(event)" onClick="newRound()" onMouseOut="buttonColorOut(event)" hidden="hidden">Next / New Round</button>
</p>
<p id="stats">Current Round: <span id="rounds">0</span> | Ties: <span id="tie">0</span></p>
<div id="gameArea">
<div id="img1area">
<div class="score"><span id="sign1">Horse</span><br />Score<br /><span id="xWin">0</span></div>
<img id="img1" class="img1" src="images/Horse.png" alt="Image1 - Horse" draggable="true" ondragstart="drag(event)"/>
<div class="name">Player 1</div>
</div>
<div id="grid">
<div id="b1" class="box noselect" ondrop="drop(event)" ondragover="allowDrop(event)" ondragleave="dragLeave(event)"></div>
<div id="b2" class="box noselect" ondrop="drop(event)" ondragover="allowDrop(event)" ondragleave="dragLeave(event)"></div>
<div id="b3" class="box noselect" ondrop="drop(event)" ondragover="allowDrop(event)" ondragleave="dragLeave(event)"></div>
<div class="clear"></div>
<div id="b4" class="box noselect" ondrop="drop(event)" ondragover="allowDrop(event)" ondragleave="dragLeave(event)"></div>
<div id="b5" class="box noselect" ondrop="drop(event)" ondragover="allowDrop(event)" ondragleave="dragLeave(event)"></div>
<div id="b6" class="box noselect" ondrop="drop(event)" ondragover="allowDrop(event)" ondragleave="dragLeave(event)"></div>
<div class="clear"></div>
<div id="b7" class="box noselect" ondrop="drop(event)" ondragover="allowDrop(event)" ondragleave="dragLeave(event)"></div>
<div id="b8" class="box noselect" ondrop="drop(event)" ondragover="allowDrop(event)" ondragleave="dragLeave(event)"></div>
<div id="b9" class="box noselect" ondrop="drop(event)" ondragover="allowDrop(event)" ondragleave="dragLeave(event)"></div>
</div>
<div id="img2area">
<div class="score"><span id="sign2">Monkey</span><br />Score<Br /><span id="yWin">0</span></div>
<img id="img2" class="img2" src="images/Monkey.png" alt="Image2 - Monkey" draggable="true" ondragstart="drag(event)" />
<div class="name">Player 2</div>
</div>
<div class="clear"></div>
<p id="name1"></p>
<p id="name2"></p>
</div>
</div>
<div class="clear"></div>
<p id="load"></p>
<hr />
<p id="credit">
Tic-Tac-Toe game collaboratively developed by<br />
<b>Kenneth Tran</b> & <b>Vithusan Kanageswaran</b>
</p>
</div>
</body>
</html>