index.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <meta charset="utf-8">
  6. <title>圆点</title>
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  8. <meta name="apple-mobile-web-app-capable" content="yes">
  9. <meta name="full-screen" content="yes">
  10. <meta name="screen-orientation" content="portrait">
  11. <meta name="x5-fullscreen" content="true">
  12. <meta name="360-fullscreen" content="true">
  13. <style>
  14. body, canvas, div {
  15. -moz-user-select: none;
  16. -webkit-user-select: none;
  17. -ms-user-select: none;
  18. -khtml-user-select: none;
  19. -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  20. }
  21. body {
  22. margin: 0;
  23. padding: 0;
  24. background: #f6f6f6;
  25. }
  26. #gameCanvas {
  27. position: absolute;
  28. }
  29. .hint {
  30. position: absolute;
  31. left: 50%;
  32. top: 50%;
  33. margin: -165px 0 0 -170px;
  34. z-index: 100;
  35. display: none;
  36. max-width: 100%;
  37. max-height: 100%;
  38. }
  39. </style>
  40. <script type="text/javascript">
  41. window.gameLangs = ['en', 'zh', 'es', 'fr', 'it', 'pt', 'ru', 'tr'];
  42. window.gameJS = [
  43. 'http://lib.sinaapp.com/js/jquery/1.8.1/jquery.min.js'
  44. ];
  45. window.gameOnLoadScript = "startGame();";
  46. </script><script type="text/javascript" src="./assets/softgames-1.1.js"></script><script type="text/javascript" src="./assets/sg.hooks.js"></script><script>
  47. var lang, isStarted = false;
  48. var startGame = function () {
  49. lang = SG.lang; //langs
  50. SG_Hooks.setOrientationHandler(function () {
  51. });
  52. SG_Hooks.setResizeHandler(function () {
  53. });
  54. if (window.orientation != null) {
  55. checkOrientation();
  56. $(window).bind('resize', checkOrientation);
  57. } else {
  58. var s = document.createElement('script');
  59. s.src = 'main.js';
  60. document.body.appendChild(s);
  61. }
  62. };
  63. var checkOrientation = function () {
  64. var orientation = 'Portrait';
  65. var screenWidth = $(window).width();
  66. var screenHeight = $(window).height();
  67. if (screenWidth > screenHeight) {
  68. orientation = 'Landscape';
  69. }
  70. if (orientation == 'Landscape') {
  71. $('#gameCanvas').css('visibility', 'hidden');
  72. $('.hint').css('display', 'block');
  73. } else {
  74. $('#gameCanvas').css('visibility', 'visible');
  75. $('.hint').css('display', 'none');
  76. if (!isStarted) {
  77. isStarted = true;
  78. var s = document.createElement('script');
  79. s.src = 'main.js';
  80. document.body.appendChild(s);
  81. }
  82. setTimeout (function () {
  83. window.scrollTo(0, 1);
  84. }, 10);
  85. }
  86. };
  87. </script>
  88. </head>
  89. <body >
  90. <img src="res/tip_rotate.png" alt="" class="hint"><canvas id="gameCanvas" width="320" height="418"></canvas><script src="frameworks/cocos2d-html5/CCBoot.js"></script><!--<script src="main.js"></script>-->
  91. </body>
  92. </html>