index.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>打破皮纳塔</title>
  8. <meta name="keywords" content="打破皮纳塔,打破皮纳塔html5游戏" />
  9. <meta name="description" content="打破皮纳塔html5游戏,打破皮纳塔手机在线游戏" />
  10. <link rel="apple-touch-icon" href="icon.png" />
  11. <link rel="shortcut icon" href="icon.png" />
  12. <link rel="icon" href="icon.png" />
  13. <meta id="viewport" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  14. <meta name="apple-mobile-web-app-capable" content="yes">
  15. <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
  16. <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
  17. <script type="text/javascript" src="./lib/soundjs.min.js"></script>
  18. <script type="text/javascript" src="./Pinata.js"></script>
  19. <script type="text/javascript">
  20. function HTML5API_levelStarted() { window.HTML5API && HTML5API.levelStarted && HTML5API.levelStarted(); }
  21. function HTML5API_levelEnded() { window.HTML5API && HTML5API.levelEnded && HTML5API.levelEnded(); }
  22. function HTML5API_preloaderStarted() { window.HTML5API && HTML5API.preloaderStarted && HTML5API.preloaderStarted(); }
  23. function HTML5API_preloaderEnded() { window.HTML5API && HTML5API.preloaderEnded && HTML5API.preloaderEnded(); }
  24. function HTML5API_showStartButton() { return window.HTML5API && HTML5API.showStartButton && HTML5API.showStartButton(); }
  25. function HTML5API_getUserId() { if(window.HTML5API && HTML5API.getUserId) return HTML5API.getUserId(); }
  26. function HTML5API_isAdPlaying() { if(window.HTML5API && HTML5API.isAdPlaying) return HTML5API.isAdPlaying(); }
  27. function HTML5API_onAdStart(func) { return window.HTML5API && HTML5API.onAdStart && HTML5API.onAdStart(func); }
  28. function HTML5API_onAdComplete(func) { return window.HTML5API && HTML5API.onAdComplete && HTML5API.onAdComplete(func); }
  29. function HTML5API_showMidroll() { return window.HTML5API && HTML5API.showMidroll && HTML5API.showMidroll(); }
  30. function HTML5API_setWidgetState(params) { window.HTML5API && HTML5API.setWidgetState && HTML5API.setWidgetState(params); }
  31. </script>
  32. <script>
  33. window.addEventListener ("touchmove", function (event) { event.preventDefault (); }, false);
  34. if (typeof window.devicePixelRatio != 'undefined' && window.devicePixelRatio > 2) {
  35. var meta = document.getElementById ("viewport");
  36. meta.setAttribute ('content', 'width=device-width, initial-scale=' + (2 / window.devicePixelRatio) + ', user-scalable=0');
  37. }
  38. </script>
  39. <style>
  40. html,body { margin: 0; padding: 0; height: 100%; }
  41. #openfl-content { background: #000000; width: 100%; height: 100%; z-index: 1; overflow: visible;}
  42. canvas { display: inherit; margin: 0 auto !important;}
  43. </style>
  44. </head>
  45. <body>
  46. <div id="openfl-content"></div>
  47. <script type="text/javascript">
  48. // Embed application, fit to best window size
  49. var getSize = function() {
  50. var orientation = "portrait";
  51. var element = document.getElementById("openfl-content");
  52. var clientWidth = element.clientWidth;
  53. var clientHeight = element.clientHeight;
  54. var minWidth = 320 ;
  55. var minHeight = 480 ;
  56. var finalWidth = minWidth;
  57. var finalHeight = minHeight;
  58. if (orientation == "portrait")
  59. {
  60. var currRatio = clientHeight / clientWidth;
  61. var minRatio = minHeight / finalWidth;
  62. var maxHeight = 568 ;
  63. if (maxHeight == null) maxHeight = finalHeight;
  64. var maxRatio = maxHeight / finalWidth;
  65. if (currRatio <= minRatio)
  66. {
  67. finalHeight = minHeight;
  68. }
  69. else if (currRatio >= maxRatio)
  70. {
  71. finalHeight = maxHeight;
  72. }
  73. else
  74. {
  75. finalHeight = Math.floor(finalWidth * currRatio);
  76. }
  77. }
  78. else if (orientation == "landscape")
  79. {
  80. var currRatio = clientWidth / clientHeight;
  81. var minRatio = minWidth / finalHeight;
  82. var maxWidth = null ;
  83. console.log(maxWidth);
  84. if (maxWidth == null) maxWidth = finalWidth;
  85. var maxRatio = maxWidth / finalHeight;
  86. if (currRatio <= minRatio)
  87. {
  88. finalWidth = minWidth;
  89. }
  90. else if (currRatio >= maxRatio)
  91. {
  92. finalWidth = maxWidth;
  93. }
  94. else
  95. {
  96. finalWidth = Math.floor(finalHeight * currRatio);
  97. }
  98. }
  99. return {width: finalWidth, height: finalHeight};
  100. }
  101. var size = getSize();
  102. lime.embed ("openfl-content", size.width, size.height, "000000");
  103. // Resize document width to fix Samsung Galaxy stock-browser render freeze on touch bug:
  104. if (/Android/.test(navigator.userAgent) && !(/Chrome/.test(navigator.userAgent)))
  105. {
  106. var ds = document.documentElement.style;
  107. var origW = ds.width;
  108. ds.width = "101%";
  109. setTimeout(function() { ds.width = origW; }, 500);
  110. }
  111. </script>
  112. <script type="text/JavaScript">
  113. window.shareData={
  114. 'title':'打破皮纳塔',
  115. 'link':'http://game.ikongzhong.cn/games/dapopinata/',
  116. 'imgurl':'http://game.ikongzhong.cn/games/dapopinata/icon.png'
  117. }
  118. window.shareFriendData={
  119. 'title':'打破皮纳塔',
  120. 'content':'关注空中传媒网络,更多好玩的游戏等着你。',
  121. 'link':'http://game.ikongzhong.cn/games/dapopinata/',
  122. 'imgurl':'http://game.ikongzhong.cn/games/dapopinata/icon.png'
  123. }
  124. </script>
  125. <script type="text/JavaScript" src="http://gc.veiying.cn/code"></script>
  126. </body>
  127. </html>