index.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>挑战憋屁--空中传媒</title>
  6. <link rel="icon" type="image/GIF" href="res/favicon.ico" />
  7. <meta name="apple-mobile-web-app-capable" content="yes" />
  8. <meta name="full-screen" content="yes" />
  9. <meta name="screen-orientation" content="portrait" />
  10. <meta name="x5-fullscreen" content="true" />
  11. <meta name="360-fullscreen" content="true" />
  12. <style>
  13. body,canvas,div {
  14. -moz-user-select: none;
  15. -webkit-user-select: none;
  16. -ms-user-select: none;
  17. -khtml-user-select: none;
  18. -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  19. }
  20. </style>
  21. </head>
  22. <body style="padding: 0; margin: 0; background: #000;">
  23. <canvas id="gameCanvas" width="800" height="450"></canvas>
  24. <script src="game.min.js"></script>
  25. <script language=javascript>
  26. var mebtnopenurl = 'http://game.ikongzhong.cn';
  27. window.shareData = {
  28. "imgUrl": "http://game.ikongzhong.cn/icon/tzbp.png",
  29. "timeLineLink": "http://game.ikongzhong.cn/games/tzbp/",
  30. "tTitle": "憋屁挑战",
  31. "tContent": "憋屁挑战"
  32. };
  33. function goHome(){
  34. window.location=mebtnopenurl;
  35. }
  36. function clickMore(){
  37. if((window.location+"").indexOf("f=zf",1)>0){
  38. window.location = "http://game.ikongzhong.cn";
  39. }
  40. else{
  41. goHome();
  42. }
  43. }
  44. function dp_share(){
  45. if(myData.score){
  46. document.title ="我成功憋屁"+myData.score+"秒,获得了"+myData.title+"称号! 看你能坚持多久?"
  47. }else{
  48. document.title ="你的好友刚才在电梯里放了个屁,TA说是你放的,快去复仇吧!";
  49. }
  50. document.getElementById("share").style.display="";
  51. window.shareData.tTitle = document.title;
  52. }
  53. function dp_Ranking(){
  54. window.location=mebtnopenurl;
  55. }
  56. function showAd(){
  57. }
  58. function hideAd(){
  59. }
  60. document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  61. WeixinJSBridge.on('menu:share:appmessage', function(argv) {
  62. WeixinJSBridge.invoke('sendAppMessage', {
  63. "img_url": window.shareData.imgUrl,
  64. "link": window.shareData.timeLineLink,
  65. "desc": window.shareData.tContent,
  66. "title": window.shareData.tTitle
  67. }, onShareComplete);
  68. });
  69. WeixinJSBridge.on('menu:share:timeline', function(argv) {
  70. WeixinJSBridge.invoke('shareTimeline', {
  71. "img_url": window.shareData.imgUrl,
  72. "img_width": "640",
  73. "img_height": "640",
  74. "link": window.shareData.timeLineLink,
  75. "desc": window.shareData.tContent,
  76. "title": window.shareData.tTitle
  77. }, onShareComplete);
  78. });
  79. }, false);
  80. </script>
  81. <div id=share style="display: none">
  82. <img width=100% src="share.png"
  83. style="position: fixed; z-index: 9999; top: 0; left: 0; display: "
  84. ontouchstart="document.getElementById('share').style.display='none';" />
  85. </div>
  86. <div style="display: none;">
  87. <script type="text/javascript">
  88. var myData = { gameid: "tzbp"};
  89. // var domain = ["", "", ""][parseInt(Math.random() * 3)];
  90. //window.shareData.timeLineLink = "http://"+ parseInt(Math.random()*100000) +"."+ myData.gameid +"."+domain+"/gamecenter.html?gameid=" + myData.gameid + (localStorage.myuid ? "&uid=" + localStorage.myuid : "");
  91. function dp_submitScore(score,title){
  92. myData.score = parseInt(score);
  93. myData.scoreName ="憋了"+score+"秒";
  94. myData.title=title;
  95. if(score>0){
  96. if (confirm("恭喜您成功憋"+score+"秒,获得"+title+"称号!要不要看下小伙伴们的实力?")){
  97. dp_share();
  98. }
  99. }
  100. }
  101. function onShareComplete(res) {
  102. if (localStorage.myuid && myData.score!= undefined) {
  103. setTimeout(function(){
  104. if (confirm("要将成绩提交到9G游戏排行榜吗?")) {
  105. //window.location = "http://wx.9g.com/rank/submit2.jsp?gameid=" + myData.gameid + "&uid=" + localStorage.myuid + "&score=" + myData.score + "&scorename=" + encodeURIComponent(myData.scoreName);
  106. }
  107. else {
  108. document.location.href = mebtnopenurl;
  109. }
  110. }, 500);
  111. }
  112. else {
  113. document.location.href = mebtnopenurl;
  114. }
  115. }
  116. </script>
  117. <div style="display: none;">
  118. </div>
  119. </body>
  120. </html>