1
0

chatRoom.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <div ng-controller="ChatCtrl">
  2. <div class="page-header">
  3. <h1 ng-show="service.isConnected()">Welcome <small>You are playing as {{service.username}}</small></h1>
  4. <h1 ng-hide="service.isConnected()">Welcome <small>login to play</small></h1>
  5. </div>
  6. <div ng-show="!service.isConnected()" class="row">
  7. <div id="login" class="offset4 span6">
  8. <form ng-show="service.status == 'disconnected'">
  9. <input id="username" name="username" class="input-small" type="text" ng-model="username" placeholder="Username">
  10. <br>
  11. <br>
  12. <button class="btn" type="submit" ng-click="service.connect(username); username=''">{{service.hasRoom() ? 'Join Room' : 'Create New Room'}}</button>
  13. </form>
  14. </div>
  15. </div>
  16. <div ng-show="service.isConnected()" class="row">
  17. <div class="span10" id="main">
  18. <div id="messages">
  19. <div class="message {{message.kind}} {{message.user == chat.username ? 'me' : ''}}" ng-repeat="message in chat.messages">
  20. <span>{{message.user}}</span>
  21. <p>{{message.message}}</p>
  22. </div>
  23. </div>
  24. <input type="text" ng-model="text" id="talk" ng-keypress="onType($event)">
  25. </div>
  26. <div class="span4" ng-controller="GameCtrl">
  27. <button class="btn" ng-show="game.pendingRound" ng-click="game.startRound()">Start</button>
  28. <div ng-if="game.roundRunning()">
  29. <h2><ng-pluralize count="game.timer.count" when="{'0': 'Time\'s up!', 'one': '1 second', 'other': '{} seconds'}" /></h2>
  30. <h2><ng-pluralize count="game.points" when="{'one': '1 point', 'other': '{} points'}" /></h2>
  31. <hr>
  32. </div>
  33. <div ng-if="game.roundRunning()">
  34. <h3 ng-show="game.isPlayer()">you are the giver</button>
  35. <h3 ng-show="game.isMonitor()">you are a monitor</button>
  36. <h3 ng-show="game.isGuesser()">you are a guesser</button>
  37. <button class="btn" ng-show="game.isPlayer()" ng-click="game.pass()">Pass</button>
  38. <button class="btn" ng-show="game.isMonitor()" ng-click="game.taboo()">Uh-uh!</button>
  39. <button class="btn" ng-show="game.isMonitor() || game.isPlayer()" ng-click="game.correct()">Correct</button>
  40. </div>
  41. <div ng-show="game.card">
  42. <h2>Card</h2>
  43. <h3>{{game.card.word}}</h3>
  44. <ul class="taboo">
  45. <li ng-repeat="word in game.card.taboo">{{word}}</li>
  46. </ul>
  47. </div>
  48. <h2>Team A</h2>
  49. <ul class="members">
  50. <li ng-repeat="member in game.teamA.members">{{member}}</li>
  51. </ul>
  52. <h2>Team B</h2>
  53. <ul class="members">
  54. <li ng-repeat="member in game.teamB.members">{{member}}</li>
  55. </ul>
  56. </div>
  57. </div>
  58. </div>