index.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>快來打我呀!</title>
  6. <meta name="apple-mobile-web-app-capable" content="yes"/>
  7. <meta name="full-screen" content="yes"/>
  8. <meta name="screen-orientation" content="portrait"/>
  9. <meta name="x5-fullscreen" content="true"/>
  10. <meta name="360-fullscreen" content="true"/>
  11. <style>
  12. body, canvas, div {
  13. -moz-user-select: none;
  14. -webkit-user-select: none;
  15. -ms-user-select: none;
  16. -khtml-user-select: none;
  17. -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  18. }
  19. </style>
  20. </head>
  21. <body style="padding:0; margin: 0; background: #000;">
  22. <canvas id="gameCanvas" width="640" height="960"></canvas>
  23. <div style="position:fixed; bottom:10px; left:0px; width:100%; text-align:center;"><a href="javascript:void(0);" onClick="clickMore();">更多游戏</a></div>
  24. <script src="cocos2d.js"></script>
  25. <script language=javascript>
  26. var mebtnopenurl = 'http://game.ikongzhong.cn';
  27. var thegameurl ="http://game.ikongzhong.cn/games/dwy/";
  28. var guanzhuurl ="http://mp.weixin.qq.com/s?__biz=MzI4MjA2MjE0MQ==&mid=246005295&idx=1&sn=490f8141976d607ba079d48f52a3fcd7#rd";
  29. window.shareData = {
  30. "imgUrl": "http://mmbiz.qpic.cn/mmbiz/2zpp2iaH4HWEUVrG2VrY0nz1bXevjqd9Wg0JsV9kTicApRia8Ov0jktRHJCuHUYJULLUBISsj5EJZOcXptSicUFRPA/640",
  31. "timeLineLink": thegameurl,
  32. "tTitle": "打我呀",
  33. "tContent": "快來打我呀!"
  34. };
  35. function goHome(){
  36. window.location=mebtnopenurl;
  37. }
  38. function clickMore(){
  39. if((window.location+"").indexOf("f=zf",1)>0){
  40. window.location =mebtnopenurl;
  41. }
  42. else{
  43. goHome();
  44. }
  45. }
  46. function dp_share(){
  47. document.getElementById("share").style.display="";
  48. }
  49. function dp_Ranking(){
  50. window.location=mebtnopenurl;
  51. }
  52. function showAd(){
  53. }
  54. function hideAd(){
  55. }
  56. document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  57. WeixinJSBridge.on('menu:share:appmessage', function(argv) {
  58. WeixinJSBridge.invoke('sendAppMessage', {
  59. "img_url": window.shareData.imgUrl,
  60. "link": window.shareData.timeLineLink,
  61. "desc": window.shareData.tContent,
  62. "title": window.shareData.tTitle
  63. }, onShareComplete);
  64. });
  65. WeixinJSBridge.on('menu:share:timeline', function(argv) {
  66. WeixinJSBridge.invoke('shareTimeline', {
  67. "img_url": window.shareData.imgUrl,
  68. "img_width": "640",
  69. "img_height": "640",
  70. "link": window.shareData.timeLineLink,
  71. "desc": window.shareData.tContent,
  72. "title": window.shareData.tTitle
  73. }, onShareComplete);
  74. });
  75. }, false);
  76. </script>
  77. <div id=share style="display: none">
  78. <img width="100%" src="share.png"
  79. style="position: fixed; z-index: 9999; top: 0; left: 0; display: "
  80. ontouchstart="document.getElementById('share').style.display='none';" />
  81. </div>
  82. <div style="display: none;">
  83. <script type="text/javascript">
  84. var myData = { gameid: "dwy" };
  85. var domain = ["oixm.cn", "hiemma.cn", "peagame.net"][parseInt(Math.random() * 3)];
  86. window.shareData.timeLineLink = thegameurl;
  87. function dp_submitScore(score,stitle){
  88. myData.score = parseInt(score*100);
  89. myData.scoreName ="用时"+score+"秒";
  90. document.title =stitle;
  91. window.shareData.tTitle = document.title;
  92. }
  93. function onShareComplete(res) {
  94. if (localStorage.myuid && myData.score != undefined) {
  95. setTimeout(function(){
  96. if (confirm("?")) {
  97. window.location = mebtnopenurl;
  98. }
  99. else {
  100. document.location.href = mebtnopenurl;
  101. }
  102. }, 500);
  103. }
  104. else {
  105. document.location.href = guanzhuurl ;
  106. }
  107. }
  108. </script>
  109. <div style="display: none;">
  110. <script type="text/javascript" src="http://tajs.qq.com/stats?sId=36313548" charset="UTF-8"></script>
  111. </div>
  112. </body>
  113. </html>