index.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. 
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  6. <meta charset="UTF-8">
  7. <meta name="viewport"
  8. content="width=device-width initial-scale=1.0 maximum-scale=1.0 user-scalable=yes" />
  9. <title>超级马里奥</title>
  10. <link rel="shortcut icon" href="icon.png">
  11. <script type="text/javascript" src="js/zepto.min.js"></script>
  12. <link type="text/css" href="style/index.css" rel="stylesheet" />
  13. <script type="text/javascript" src="js/index.js?v1"></script>
  14. <style type="text/css">
  15. .gamebtn{
  16. margin-top:15px;
  17. font-size:40px;
  18. }
  19. </style>
  20. </head>
  21. <body class="body">
  22. <canvas id="gamescene"></canvas>
  23. <div id="mask" class="hide"></div>
  24. <div id="cover" class="hide"></div>
  25. <div id="game_div" class="">
  26. <div id="ctrboard">
  27. <div id="start" class="boards hide">
  28. <div class="logo"></div>
  29. <div class="title"></div>
  30. <a class="startgame" href="###" alt="开始游戏"></a>
  31. <a class="moregame" onclick="clickMore();" alt="更多游戏"></a>
  32. </div>
  33. <div id="play" class="boards hide">
  34. <div class="score_title">分数</div>
  35. <div class="score">0</div>
  36. </div>
  37. <div id="end" class="boards hide">
  38. <div>得分</div>
  39. <div class="score">0</div>
  40. <div class="history">历史最佳: <span class="bestScore">0</span></div>
  41. <div class="gameover"></div>
  42. <div id="resetgame" class="gamebtn" style="margin-top:40px;">重新开始</div>
  43. <div id="showgame" class="gamebtn" onclick="dp_share();">炫耀一下</div>
  44. <div id="moregame" class="gamebtn" onclick="clickMore();">更多游戏</div>
  45. </div>
  46. </div>
  47. <div id="footer" class="hide">
  48. </div>
  49. </div>
  50. <script type="text/javascript">
  51. window.onerror = function(e) {
  52. // alert(e);
  53. }
  54. </script>
  55. <input id="bt-game-id" type="hidden" value="8-supermario">
  56. <script language=javascript>
  57. var mebtnopenurl = 'http://game.ikongzhong.cn/';
  58. var thegameurl ="http://game.ikongzhong.cn/games/cjmla/";
  59. var guanzhuurl ="http://mp.weixin.qq.com/s?__biz=MzI4MjA2MjE0MQ==&mid=246005295&idx=1&sn=490f8141976d607ba079d48f52a3fcd7#rd";
  60. window.shareData = {
  61. "imgUrl": "http://mmbiz.qpic.cn/mmbiz/2zpp2iaH4HWEj5ShYvicEVgvTpeYHxEjibq5Zlia2Hm5ISG5aibD2TQ5KT7kQicdJBXI9MaF5IIReATAbF5ulY4BHAuw/640",
  62. "timeLineLink": thegameurl,
  63. "tTitle": "超级马里奥",
  64. "tContent": "超级马里奥"
  65. };
  66. function goHome(){
  67. window.location=mebtnopenurl;
  68. }
  69. function clickMore(){
  70. if((window.location+"").indexOf("f=zf",1)>0){
  71. window.location =mebtnopenurl;
  72. }
  73. else{
  74. goHome();
  75. }
  76. }
  77. function dp_share(){
  78. document.getElementById("share").style.display="";
  79. }
  80. function dp_Ranking(){
  81. window.location=mebtnopenurl;
  82. }
  83. function showAd(){
  84. }
  85. function hideAd(){
  86. }
  87. document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  88. WeixinJSBridge.on('menu:share:appmessage', function(argv) {
  89. WeixinJSBridge.invoke('sendAppMessage', {
  90. "img_url": window.shareData.imgUrl,
  91. "link": window.shareData.timeLineLink,
  92. "desc": window.shareData.tContent,
  93. "title": window.shareData.tTitle
  94. }, onShareComplete);
  95. });
  96. WeixinJSBridge.on('menu:share:timeline', function(argv) {
  97. WeixinJSBridge.invoke('shareTimeline', {
  98. "img_url": window.shareData.imgUrl,
  99. "img_width": "640",
  100. "img_height": "640",
  101. "link": window.shareData.timeLineLink,
  102. "desc": window.shareData.tContent,
  103. "title": window.shareData.tTitle
  104. }, onShareComplete);
  105. });
  106. }, false);
  107. </script>
  108. <div id=share style="display: none">
  109. <img width="100%" src="share.png"
  110. style="position: fixed; z-index: 9999; top: 0; left: 0; display: "
  111. ontouchstart="document.getElementById('share').style.display='none';" />
  112. </div>
  113. <script type="text/javascript">
  114. var myData = { gameid: "cjmla" };
  115. var domain = ["oixm.cn", "hiemma.cn", "peagame.net"][parseInt(Math.random() * 3)];
  116. window.shareData.timeLineLink =thegameurl ;
  117. function dp_submitScore(score){
  118. myData.score = parseInt(score);
  119. myData.scoreName ="越过"+score+"个障碍物";
  120. document.title = window.shareData.tTitle = "我带领马里奥越过" + score + "个障碍物,快来玩变态版超级玛丽!";
  121. }
  122. function onShareComplete(res) {
  123. if (localStorage.myuid && myData.score != undefined) {
  124. setTimeout(function(){
  125. if (confirm("?")) {
  126. window.location =mebtnopenurl ;
  127. }
  128. else {
  129. document.location.href = mebtnopenurl;
  130. }
  131. }, 500);
  132. }
  133. else {
  134. document.location.href = guanzhuurl ;
  135. }
  136. }
  137. </script>
  138. <div style="display: none;">
  139. </div>
  140. </body>
  141. </html>