index.html 4.5 KB

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