-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.html
160 lines (134 loc) · 5.17 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
<!DOCTYPE html>
<html lang="en" ng-app>
<head>
<meta charset="utf-8">
<title>Word Fun Jam!</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Type faster than the next guy.">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href="/css/bootstrap.css" rel="stylesheet">
<link href="/css/bootstrap-responsive.min.css" rel="stylesheet">
<link href="/css/font-awesome.min.css" rel="stylesheet">
<link href="/css/bootswatch.css" rel="stylesheet">
<link href="/css/style.css" rel="stylesheet">
<script type="text/javascript" src="/js/angular.min.js"></script>
<script type="text/javascript" src="/js/game.js"></script>
</head>
<body class="preview" id="top" data-spy="scroll" data-target=".subnav" data-offset="80">
<!-- Navbar
================================================== -->
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="/index.html">Word Fun Jam!</a>
<div class="nav-collapse collapse" id="main-menu">
<ul class="nav" id="main-menu-left">
<li><a href="/index.html">Home</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Game <b class="caret"></b></a>
<ul class="dropdown-menu" id="swatch-menu">
<li><a id="newgame" href="javascript:void(0)">New</a></li>
<li><a id="joingame" href="/join">Join</a></li>
</ul>
</li>
<li><a href="credits.html">Credits</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container" ng-controller="GameCtrl">
<!-- Masthead
================================================== -->
<h1 id="currentWord">{{currentWord}}</h1>
<h1 class="countDown">{{countDown}}</h1>
<div class="points">{{opponentScore}} to {{myScore}}</div>
<div id="opponent" class="player">
<div class="name">{{opponent}}</div>
<input class="typey" type="text" ng-model="opponentText" />
</div>
<div id="alert-holder">
<div id="alerts"></div>
</div>
<div id="self" class="player">
<div class="name">{{nick}}</div>
<form style="margin:0px;" ng-submit="submitWord()">
<input id="myText" class="typey" type="text" ng-model="myText" />
</form>
</div>
<div id="entergame" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">New Game</h4>
</div>
<form id="gameform">
<div class="modal-body">
<p>Enter your name:</p>
<input type="text" id="playername"></input>
<p>Enter a new or existing Game ID:</p>
<input type="text" id="gameid"></input>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">Start Game</button>
</div>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- Footer
================================================== -->
<hr>
<footer id="footer">
<div class="links">
<a href="#">Github</a>
<a href="#">Email</a>
<a href="#">Facebook</a>
<a href="#">Donate</a>
</div>
Made by <a href="#">Cameron Seebach</a> & <a href="#">Tyrone Warren</a>.
Code licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Affero GPL</a>.
</footer>
</div><!-- /container -->
<div id="sound"></div>
<div id="music" style="visibility: hidden">
<audio autoplay loop>
<source src="/mp3/game_01.mp3" type="audio/mpeg">
<source src="/mp3/game_01.ogg" type="audio/ogg">
</audio>
</div>
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/jquery.smooth-scroll.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/bootswatch.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#newgame').click(function(){
$('#entergame').modal();
});
$('#gameform').submit(function(e){
e.preventDefault();
var playername = $('#playername').val();
var gameid = $('#gameid').val();
window.location = '/game/' + gameid + '/' + playername;
});
});
</script>
<script type="text/javascript" src="/node_modules/socket.io/node_modules/socket.io-client/dist/socket.io.js"></script>
<script>
var socket = io.connect('/');
</script>
</body>
</html>