index.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <!DOCTYPE html>
  2. <!-- LInE - Free Education, Private Data - http://www.usp.br/line -->
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="description" content="Educational game for teaching fractions" />
  7. <meta name="keywords" content="ifractions, fraction, game, private data" />
  8. <link rel="shortcut icon" href="assets/img/scene/flag.png">
  9. <title> iFractions</title>
  10. <link rel="stylesheet" href="css/bootstrap.min.css">
  11. <style>
  12. /*
  13. body, .panel-body {
  14. background-color: #313857;
  15. }
  16. */
  17. #iFractions-canvas {
  18. padding: 0 auto 0 auto;
  19. margin-left: auto;
  20. margin-right: auto;
  21. display: block;
  22. }
  23. #textbox {
  24. position: absolute;
  25. margin-left: auto;
  26. margin-right: auto;
  27. top: 300px;
  28. left: 0;
  29. right: 0;
  30. text-align: center;
  31. visibility: hidden;
  32. }
  33. input[type=text] {
  34. background-color: #fff;
  35. padding: 15px 40px;
  36. box-sizing: border-box;
  37. border: 3px solid #ccc;
  38. font-size: 44px;
  39. font-family: Arial;
  40. color: #000;
  41. text-align: center;
  42. }
  43. input:focus {
  44. outline: 3px solid #85accc;
  45. }
  46. /* The Modal (background) */
  47. .modal {
  48. display: none;
  49. /* Hidden by default */
  50. position: fixed;
  51. /* Stay in place */
  52. z-index: 1;
  53. /* Sit on top */
  54. padding-top: 155px;
  55. /* Location of the box */
  56. left: 0;
  57. top: 0;
  58. width: 100%;
  59. /* Full width */
  60. height: 100%;
  61. /* Full height */
  62. overflow: auto;
  63. /* Enable scroll if needed */
  64. background-color: rgb(0, 0, 0);
  65. /* Fallback color */
  66. background-color: rgba(0, 0, 0, 0.4);
  67. /* Black w/ opacity */
  68. }
  69. /* Modal Content */
  70. .modal-content {
  71. background-color: #fefefe;
  72. margin: auto;
  73. padding: 20px;
  74. border: 1px solid #888;
  75. width: 50%;
  76. }
  77. /* The Close Button */
  78. .close {
  79. color: #aaaaaa;
  80. float: right;
  81. font-size: 28px;
  82. font-weight: bold;
  83. }
  84. .close:hover, .close:focus {
  85. color: #000;
  86. text-decoration: none;
  87. cursor: pointer;
  88. }
  89. </style>
  90. </head>
  91. <body>
  92. <div class="container">
  93. <div class="clearfix">
  94. </div>
  95. <div class="panel panel-primary">
  96. <div class="panel-heading">iFractions game</div>
  97. <div class="panel-body">
  98. <canvas id="iFractions-canvas"></canvas> <!-- iFractions game -->
  99. <div id="textbox" onsubmit="return false">
  100. <input type="text" id="textbox-content" value="" size="13" maxlength="36"> <!-- Textbox to get player name -->
  101. </div>
  102. <div id="myModal" class="modal"> <!-- Modal -->
  103. <div class="modal-content">
  104. <span class="close">&times;</span>
  105. <div id='infobox-content'></div> <!-- Modal content -->
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. <!-- Load all js files -->
  111. <script src="js/preMenu.js"></script>
  112. <script src="js/menu.js"></script>
  113. <script src="js/customMenu.js"></script>
  114. <script src="js/map.js"></script>
  115. <script src="js/circleOne.js"></script>
  116. <script src="js/squareOne.js"></script>
  117. <script src="js/squareTwo.js"></script>
  118. <script src="js/studentReport.js"></script> <!-- FOR MOODLE -->
  119. <script src="js/integrationFunctions.js"></script> <!-- FOR MOODLE -->
  120. <script src="js/gameMechanics.js"></script>
  121. <script src="js/globals.js"></script>
  122. <script>
  123. const defaultWidth = 900; // Default width for the Canvas
  124. const defaultHeight = 600; // Default height for the Canvas
  125. canvas = document.getElementById("iFractions-canvas");
  126. canvas.width = defaultWidth;
  127. canvas.height = defaultHeight;
  128. const context = canvas.getContext("2d");
  129. info.start();
  130. // CREATING GAME STATES
  131. game.state.add('boot', bootState);
  132. game.state.add('lang', langState);
  133. game.state.add('loadLang', loadLangState);
  134. game.state.add('name', nameState);
  135. game.state.add('menu', menuState);
  136. game.state.add('customMenu', customMenuState);
  137. game.state.add('map', mapState);
  138. game.state.add('end', endState);
  139. game.state.add('squareOne', squareOne);
  140. game.state.add('circleOne', circleOne);
  141. game.state.add('squareTwo', squareTwo);
  142. game.state.add('studentReport', studentReport); // FOR MOODLE
  143. // CALLING FIRST GAME STATE
  144. game.state.start('boot');
  145. </script>
  146. </div>
  147. </body>
  148. </html>