index.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="user-scalable=no"/>
  6. <div id='wx_pic' style='margin:0 auto;display:none;'>
  7. <img src='photo.jpg' />
  8. </div>
  9. <title>搭汉堡</title>
  10. <link rel="icon" type="image/GIF" href="res/favicon.ico"/>
  11. <meta name="apple-mobile-web-app-capable" content="yes"/>
  12. <meta name="full-screen" content="yes"/>
  13. <meta name="screen-orientation" content="portrait"/>
  14. <meta name="x5-fullscreen" content="true"/>
  15. <meta name="360-fullscreen" content="true"/>
  16. <style>
  17. body, canvas, div {
  18. -moz-user-select: none;
  19. -webkit-user-select: none;
  20. -ms-user-select: none;
  21. -khtml-user-select: none;
  22. -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  23. }
  24. </style>
  25. </head>
  26. <body style="padding:0; margin: 0; background: #000;">
  27. <canvas id="gameCanvas" width="320" height="480"></canvas>
  28. <script>
  29. var wx = {}, cc = {};
  30. cc.OrbitCamera = cc.CatmullRomBy = cc.CatmullRomTo = cc.CardinalSplineBy = cc.CardinalSplineTo = {};
  31. </script>
  32. <script src="src/engine.js"></script>
  33. <script src="src/game.min.js"></script>
  34. <script language=javascript>
  35. var mebtnopenurl = 'http://game.ikongzhong.cn';
  36. window.shareData = {
  37. "imgUrl": "http://game.ikongzhong.cn/icon/dhb.png",
  38. "timeLineLink": "http://game.ikongzhong.cn/games/dhb/",
  39. "tTitle": "搭汉堡",
  40. "tContent": "搭汉堡"
  41. };
  42. function goHome(){
  43. window.location=mebtnopenurl;
  44. }
  45. function clickMore(){
  46. if((window.location+"").indexOf("zf",1)>0){
  47. window.location = "http://game.ikongzhong.cn";
  48. }
  49. else{
  50. goHome();
  51. }
  52. }
  53. function dp_share(){
  54. document.title ="搭汉堡时,我竟然突破了"+myData.score+"个,谁敢跟我一比?";
  55. document.getElementById("share").style.display="";
  56. window.shareData.tTitle = document.title;
  57. }
  58. function dp_Ranking(){
  59. window.location=mebtnopenurl;
  60. }
  61. function showAd(){
  62. }
  63. function hideAd(){
  64. }
  65. document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  66. WeixinJSBridge.on('menu:share:appmessage', function(argv) {
  67. WeixinJSBridge.invoke('sendAppMessage', {
  68. "img_url": window.shareData.imgUrl,
  69. "link": window.shareData.timeLineLink,
  70. "desc": window.shareData.tContent,
  71. "title": window.shareData.tTitle
  72. }, onShareComplete);
  73. });
  74. WeixinJSBridge.on('menu:share:timeline', function(argv) {
  75. WeixinJSBridge.invoke('shareTimeline', {
  76. "img_url": window.shareData.imgUrl,
  77. "img_width": "640",
  78. "img_height": "640",
  79. "link": window.shareData.timeLineLink,
  80. "desc": window.shareData.tContent,
  81. "title": window.shareData.tTitle
  82. }, onShareComplete);
  83. });
  84. }, false);
  85. </script>
  86. <div id=share style="display: none">
  87. <img width=100% src="share.png"
  88. style="position: fixed; z-index: 9999; top: 0; left: 0; display: "
  89. ontouchstart="document.getElementById('share').style.display='none';" />
  90. </div>
  91. <div style="display: none;">
  92. <script type="text/javascript">
  93. var myData = { gameid: "mtl" };
  94. var domain = ["oixm.cn", "hiemma.cn", "peagame.net"][parseInt(Math.random() * 3)];
  95. //window.shareData.timeLineLink = "http://"+ parseInt(Math.random()*100000) +"."+ myData.gameid +"."+domain+"/gamecenter.html?gameid=" + myData.gameid + (localStorage.myuid ? "&uid=" + localStorage.myuid : "");
  96. function dp_submitScore(score){
  97. myData.score = score;
  98. myData.scoreName = score+"个";
  99. if(score>0){
  100. if (confirm("你搭了"+score+"个汉堡,真是了不起啊!")){
  101. dp_share();
  102. }
  103. }
  104. }
  105. function onShareComplete(res) {
  106. if (localStorage.myuid && myData.score != undefined) {
  107. setTimeout(function(){
  108. if (confirm("要将成绩提交到空中传媒排行榜吗?")) {
  109. // window.location = "http://wx.9g.com/rank/submit2.jsp?gameid=" + myData.gameid + "&uid=" + localStorage.myuid + "&score=" + myData.score + "&scorename=" + encodeURIComponent(myData.scoreName);
  110. }
  111. else {
  112. document.location.href = mebtnopenurl;
  113. }
  114. }, 500);
  115. }
  116. else {
  117. document.location.href = mebtnopenurl;
  118. }
  119. }
  120. </script>
  121. <script type="text/javascript" src="http://tajs.qq.com/stats?sId=36313548" charset="UTF-8"></script></body>
  122. </html>