index.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <!DOCTYPE HTML>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>戳泡泡</title>
  6. <meta name="keywords" content="games, online games, mobile games, html5 games" />
  7. <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  8. <meta name="apple-mobile-web-app-capable" content="yes" />
  9. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
  10. <link rel="stylesheet" href="css/pop.css" />
  11. <!--<link rel="stylesheet" href="fonts/fonts.css" />-->
  12. <script src="js/Stats.js"></script>
  13. <script src="js/buzz.js"></script>
  14. <style type="text/css">
  15. iframe {position: absolute; bottom: 0; left: center; }
  16. </style>
  17. <link rel="shortcut icon" href="icon.png">
  18. <link rel="icon" href="icon.png">
  19. <link type="text/css" href="css/common.css" rel="stylesheet" />
  20. <script type="text/javascript" src="js/zepto.min.js"></script>
  21. <script src="js/common.js?v=1"></script>
  22. </head>
  23. <body>
  24. <div id="SF_Game">
  25. <canvas></canvas>
  26. <div id="textLayer">
  27. <p>
  28. 火爆朋友圈
  29. </p>
  30. </div>
  31. <div id="inputBox">
  32. <a href="#" id="playAgain">
  33. 再来一次
  34. </a>
  35. <a href="#" id="shareGame">
  36. 炫耀一下
  37. </a>
  38. <a href="game.ikongzhong.cn" onClick="clickMore();">
  39. >更多游戏<
  40. </a>
  41. </div>
  42. <input id="bt-game-id" type="hidden" value="3-pop">
  43. </div>
  44. <script src="js/pop.base.js"></script>
  45. <script src="js/pop.ua.js"></script>
  46. <script src="js/pop.input.js"></script>
  47. <script src="js/pop.scoreboard.js"></script>
  48. <script src="js/pop.draw.js"></script>
  49. <script src="js/pop.collision.js"></script>
  50. <script src="js/pop.form.js"></script>
  51. <script src="js/pop.explosion.js"></script>
  52. <script src="js/pop.bubble.js"></script>
  53. <script src="js/pop.touch.js"></script>
  54. <script src="js/pop.starfish.js"></script>
  55. <script src="js/pop.router.js"></script>
  56. <script src="js/pop.init.js"></script>
  57. <script type="text/javascript">
  58. function SF_gameStart() {
  59. if (!!document.createElement('canvas').getContext === false) {
  60. document.writeln('<h1>对不起,您的浏览器不支持html5!</h1>');
  61. document.writeln('<h2>请更换浏览器继续玩游戏!</h2>');
  62. }
  63. else {
  64. POP.init();
  65. }
  66. }
  67. $(function(){
  68. $("#playAgain").on("click", function(){
  69. POP.againGame();
  70. //return false;
  71. });
  72. $("#shareGame").on("click", function(){
  73. //btGame.playShareTip();
  74. //return false;
  75. dp_share();
  76. });
  77. });
  78. btGame.onlyVScreen(false, function(count){
  79. if(count > 0){
  80. location.reload();
  81. }
  82. });
  83. btGame.resizePlayArea($("#SF_Game"), 320, 480, "center", "center");
  84. $("#SF_Game").on("resizePlayArea", function(){
  85. SF_gameStart();
  86. SF_gameStart = function(){};
  87. });
  88. </script>
  89. <script language=javascript>
  90. var mebtnopenurl = 'http://game.ikongzhong.cn';
  91. window.shareData = {
  92. "imgUrl": "http://game.ikongzhong.cn/icon/cpp.png",
  93. "timeLineLink": "http://game.ikongzhong.cn/games/cpp/",
  94. "tTitle": "戳泡泡",
  95. "tContent": "戳泡泡"
  96. };
  97. function goHome(){
  98. window.location=mebtnopenurl;
  99. }
  100. function clickMore(){
  101. if((window.location+"").indexOf("zf",1)>0){
  102. window.location = "http://game.ikongzhong.cn";
  103. }
  104. else{
  105. goHome();
  106. }
  107. }
  108. function dp_share(){
  109. document.title ="泡泡一戳即破,我拿了"+myData.score+"分,大家一起戳一把!";
  110. document.getElementById("share").style.display="";
  111. window.shareData.tTitle = document.title;
  112. }
  113. function dp_Ranking(){
  114. window.location=mebtnopenurl;
  115. }
  116. function showAd(){
  117. }
  118. function hideAd(){
  119. }
  120. document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  121. WeixinJSBridge.on('menu:share:appmessage', function(argv) {
  122. WeixinJSBridge.invoke('sendAppMessage', {
  123. "img_url": window.shareData.imgUrl,
  124. "link": window.shareData.timeLineLink,
  125. "desc": window.shareData.tContent,
  126. "title": window.shareData.tTitle
  127. }, onShareComplete);
  128. });
  129. WeixinJSBridge.on('menu:share:timeline', function(argv) {
  130. WeixinJSBridge.invoke('shareTimeline', {
  131. "img_url": window.shareData.imgUrl,
  132. "img_width": "640",
  133. "img_height": "640",
  134. "link": window.shareData.timeLineLink,
  135. "desc": window.shareData.tContent,
  136. "title": window.shareData.tTitle
  137. }, onShareComplete);
  138. });
  139. }, false);
  140. </script>
  141. <div id=share style="display: none">
  142. <img width=100% src="share.png"
  143. style="position: fixed; z-index: 9999; top: 0; left: 0; display: "
  144. ontouchstart="document.getElementById('share').style.display='none';" />
  145. </div>
  146. <div style="display: none;">
  147. <script type="text/javascript">
  148. var myData = { gameid: "cpp" };
  149. window.shareData.timeLineLink = "http://game.ikongzhong.cn/index.html" + myData.gameid + (localStorage.myuid ? "&uid=" + localStorage.myuid : "");
  150. function dp_submitScore(score){
  151. myData.score = score;
  152. myData.scoreName = "戳了"+score+"分";
  153. if(score>0){
  154. if (confirm("你就是戳泡泡达人!拿了"+score+"分,你的小伙伴知道吗?")){
  155. dp_share();
  156. }
  157. }
  158. }
  159. function onShareComplete(res) {
  160. if (localStorage.myuid && myData.score != undefined) {
  161. setTimeout(function(){
  162. if (confirm("要将成绩提交到游戏排行榜吗?")) {
  163. window.location = "http://game.ikongzhong.cn.com/index.html" + myData.gameid + "&uid=" + localStorage.myuid + "&score=" + myData.score + "&scorename=" + encodeURIComponent(myData.scoreName);
  164. }
  165. else {
  166. document.location.href = mebtnopenurl;
  167. }
  168. }, 500);
  169. }
  170. else {
  171. document.location.href = mebtnopenurl;
  172. }
  173. }
  174. </script>
  175. <div style="display: none;">
  176. </div>
  177. </body>
  178. </html>