index.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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="viewport"
  8. content="width=device-width, minimum-scale=1, maximum-scale=1, initial-scale=1, user-scalable=no">
  9. <meta name="apple-mobile-web-app-capable" content="yes" />
  10. <style>
  11. body,canvas,div {
  12. -moz-user-select: none;
  13. -webkit-user-select: none;
  14. -ms-user-select: none;
  15. -khtml-user-select: none;
  16. -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  17. }
  18. </style>
  19. </head>
  20. <body style="padding: 0; margin: 0; background: #000;">
  21. <canvas id="gameCanvas" width="640" height="960"></canvas>
  22. <script src="game.min.js"></script>
  23. <script language=javascript>
  24. var mebtnopenurl = 'http://game.ikongzhong.cn';
  25. var thegameurl ="http://game.ikongzhong.cn/games/njdsb/";
  26. var guanzhuurl ="http://mp.weixin.qq.com/s?__biz=MzI4MjA2MjE0MQ==&mid=246005295&idx=1&sn=490f8141976d607ba079d48f52a3fcd7#rd";
  27. window.shareData = {
  28. "imgUrl": "http://mmbiz.qpic.cn/mmbiz/2zpp2iaH4HWFX6tke5uPDQdhox50ehxKfB0qqxrhOibc6zJKic4v2Gsc9WYylmLMumlAiaUFaibdlUoGwJ8aoaZaNiag/640",
  29. "timeLineLink": thegameurl,
  30. "tTitle": "能接多少杯",
  31. "tContent": "不要以为谁都能接的住这水,看你能接多少杯!"
  32. };
  33. function goHome(){
  34. window.location=mebtnopenurl;
  35. }
  36. function clickMore(){
  37. if((window.location+"").indexOf("zf",1)>0){
  38. window.location = mebtnopenurl ;
  39. }
  40. else{
  41. goHome();
  42. }
  43. }
  44. function dp_share(){
  45. document.title ="不要以为谁都能接的住这水,我也只能接了"+myData.score+"杯水,看你能有多少本事来挑战我!";
  46. document.getElementById("share").style.display="";
  47. window.shareData.tTitle = document.title;
  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. <script type="text/javascript">
  83. var myData = { gameid: "njdsb" };
  84. var domain = ["oixm.cn", "hiemma.cn", "peagame.net"][parseInt(Math.random() * 3)];
  85. window.shareData.timeLineLink = thegameurl ;
  86. function dp_submitScore(score){
  87. myData.score = score;
  88. myData.scoreName = "接了"+score+"杯";
  89. if(score>0){
  90. if (confirm("您已成功的接了"+score+"杯水,分享到朋友圈和小伙伴们比比吧!")){
  91. dp_share();
  92. }
  93. }
  94. }
  95. function onShareComplete(res) {
  96. if (localStorage.myuid && myData.score != undefined) {
  97. setTimeout(function(){
  98. if (confirm("吗?")) {
  99. window.location = mebtnopenurl ;
  100. }
  101. else {
  102. document.location.href = mebtnopenurl;
  103. }
  104. }, 500);
  105. }
  106. else {
  107. document.location.href = guanzhuurl;
  108. }
  109. }
  110. </script>
  111. <div style="display: none;">
  112. <script type="text/javascript">
  113. var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
  114. document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F2eac95e2df0ea5d2b0aaa92e3dbbe419' type='text/javascript'%3E%3C/script%3E"));
  115. </script>
  116. </div>
  117. </body>
  118. </html>