chatRoom.html 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 class="alert alert-danger" ng-show="service.error"><strong>Oops!</strong> {{service.error}}.</div>
  8. <div id="login">
  9. <form class="form-inline" ng-show="service.status == 'disconnected'">
  10. <input id="username" name="username" class="form-control" type="text" ng-model="username" placeholder="Username">
  11. <br>
  12. <br>
  13. <button class="btn" type="submit" ng-click="service.connect(username); username=''">{{service.hasRoom() ? 'Join Room' : 'Create New Room'}}</button>
  14. </form>
  15. </div>
  16. </div>
  17. <div ng-show="service.isConnected()" class="row">
  18. <div class="col-md-9" id="main">
  19. <div id="messages">
  20. <table>
  21. <tr class="message {{message.kind}} {{message.user == chat.username ? 'me' : ''}}" ng-repeat="message in chat.messages">
  22. <td class="user">{{message.user}}</td>
  23. <td>{{message.message}}</td>
  24. </tr>
  25. </table>
  26. </div>
  27. <input type="text" class="form-control" ng-model="text" id="talk" ng-keypress="onType($event)">
  28. </div>
  29. <div class="col-md-3" ng-controller="GameCtrl">
  30. <button class="btn btn-primary" ng-show="game.pendingRound" ng-click="game.startRound()">Start</button>
  31. <div ng-if="game.roundRunning()">
  32. <h2><ng-pluralize count="game.timer.count" when="{'0': 'Time\'s up!', 'one': '1 second', 'other': '{} seconds'}" /></h2>
  33. <h2><ng-pluralize count="game.points" when="{'one': '1 point', 'other': '{} points'}" /></h2>
  34. <hr>
  35. </div>
  36. <div ng-if="game.roundRunning()">
  37. <h3 ng-show="game.isPlayer()">you are the giver</h3>
  38. <h3 ng-show="game.isMonitor()">you are a monitor</h3>
  39. <h3 ng-show="game.isGuesser()">you are a guesser</h3>
  40. <button class="btn btn-warning" ng-show="game.isPlayer()" ng-click="game.pass()">Pass</button>
  41. <button class="btn btn-danger" ng-show="game.isMonitor()" ng-click="game.taboo()">Uh-uh!</button>
  42. <button class="btn btn-success" ng-show="game.isMonitor() || game.isPlayer()" ng-click="game.correct()">Correct</button>
  43. </div>
  44. <div ng-show="game.card">
  45. <h2>Card</h2>
  46. <h3>{{game.card.word}}</h3>
  47. <ul class="taboo">
  48. <li ng-repeat="word in game.card.taboo">{{word}}</li>
  49. </ul>
  50. </div>
  51. <h2>Team A</h2>
  52. <ul class="members">
  53. <li ng-repeat="member in game.teamA.members">{{member}}</li>
  54. </ul>
  55. <h2>Team B</h2>
  56. <ul class="members">
  57. <li ng-repeat="member in game.teamB.members">{{member}}</li>
  58. </ul>
  59. </div>
  60. </div>
  61. </div>