index.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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" content="width=device-width, user-scalable=no"/>
  8. <meta name="apple-mobile-web-app-capable" content="yes"/>
  9. <meta name="full-screen" content="yes"/>
  10. <meta name="screen-orientation" content="portrait"/>
  11. <meta name="x5-fullscreen" content="true"/>
  12. <meta name="360-fullscreen" content="true"/>
  13. <style>
  14. body, canvas, div {
  15. -moz-user-select: none;
  16. -webkit-user-select: none;
  17. -ms-user-select: none;
  18. -khtml-user-select: none;
  19. -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  20. }
  21. </style>
  22. </head>
  23. <body style="padding:0; margin: 0; background: #F1C238;" >
  24. <canvas id="gameCanvas" width="420" height="600"></canvas>
  25. <script src="game.min.js"></script>
  26. <script>
  27. var VER = 9;
  28. var PREFIX = 10;
  29. function getDesc(score){
  30. var lineOne;
  31. if(score > 120*PREFIX)
  32. lineOne = "神啊!还能更高吗?!";
  33. else if(score > 90*PREFIX)
  34. lineOne = "牛人啊,你是传说中的专家吗?";
  35. else if(score > 70*PREFIX)
  36. lineOne = "哇塞!你已经逼近天才的水平了!";
  37. else if(score > 40*PREFIX)
  38. lineOne = "厉害!你已经超过大部分人了~";
  39. else if(score > 25*PREFIX)
  40. lineOne = "加油!你已经超过不少朋友了~";
  41. else if(score > 10*PREFIX)
  42. lineOne = "不错!你这么快就掌握技巧了!";
  43. else
  44. lineOne = "深呼吸,放松一下大脑,再来一次!";
  45. return lineOne;// + "\n据说真正的飞行员能拿到" + 200*PREFIX + "分";
  46. }
  47. </script>
  48. <script language=javascript>
  49. var mebtnopenurl = 'http://game.ikongzhong.cn';
  50. window.shareData = {
  51. "imgUrl": "http://game.ikongzhong.cn/icon/zqdn.png",
  52. "timeLineLink": "http://game.ikongzhong.cn/games/zqdn/",
  53. "tTitle": "最强大脑-空中传媒",
  54. "tContent": "最强大脑-空中传媒"
  55. };
  56. function goHome(){
  57. window.location=mebtnopenurl;
  58. }
  59. function clickMore(){
  60. if((window.location+"").indexOf("f=zf",1)>0){
  61. window.location = "http://game.ikongzhong.cn";
  62. }
  63. else{
  64. goHome();
  65. }
  66. }
  67. function dp_share(){
  68. document.title ="你了解自己的左右脑协调指数吗?我是"+myData.score+"分,你来试试吧!"
  69. document.getElementById("share").style.display="";
  70. window.shareData.tTitle = document.title;
  71. }
  72. function dp_Ranking(){
  73. window.location=mebtnopenurl;
  74. }
  75. function showAd(){
  76. }
  77. function hideAd(){
  78. }
  79. document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  80. WeixinJSBridge.on('menu:share:appmessage', function(argv) {
  81. WeixinJSBridge.invoke('sendAppMessage', {
  82. "img_url": window.shareData.imgUrl,
  83. "link": window.shareData.timeLineLink,
  84. "desc": window.shareData.tContent,
  85. "title": window.shareData.tTitle
  86. }, onShareComplete);
  87. });
  88. WeixinJSBridge.on('menu:share:timeline', function(argv) {
  89. WeixinJSBridge.invoke('shareTimeline', {
  90. "img_url": window.shareData.imgUrl,
  91. "img_width": "640",
  92. "img_height": "640",
  93. "link": window.shareData.timeLineLink,
  94. "desc": window.shareData.tContent,
  95. "title": window.shareData.tTitle
  96. }, onShareComplete);
  97. });
  98. }, false);
  99. </script>
  100. <div id=share style="display: none">
  101. <img width=100% src="share.png"
  102. style="position: fixed; z-index: 9999; top: 0; left: 0; display: "
  103. ontouchstart="document.getElementById('share').style.display='none';" />
  104. </div>
  105. <div style="display: none;">
  106. <script type="text/javascript">
  107. var myData = { gameid: "zqdn",score:0 };
  108. var domain = ["", "", ""][parseInt(Math.random() * 3)];
  109. //window.shareData.timeLineLink = "http://"+ parseInt(Math.random()*100000) +"."+ myData.gameid +"."+domain+"/gamecenter.html?gameid=" + myData.gameid + (localStorage.myuid ? "&uid=" + localStorage.myuid : "");
  110. function dp_submitScore(score){
  111. myData.score = score;
  112. myData.scoreName ="获得"+score+"分";
  113. if(score>0){
  114. if (confirm("经测试你获得了"+score+"分!看看小伙伴的大脑能力如何?")){
  115. dp_share();
  116. }
  117. }
  118. }
  119. function onShareComplete(res) {
  120. if (localStorage.myuid && myData.score>0) {
  121. setTimeout(function(){
  122. if (confirm("要将成绩提交到空中传媒排行榜吗?")) {
  123. // window.location = "http://wx.9g.com/rank/submit2.jsp?gameid=" + myData.gameid + "&uid=" + localStorage.myuid + "&score=" + myData.score + "&scorename=" + encodeURIComponent(myData.scoreName);
  124. }
  125. else {
  126. document.location.href = mebtnopenurl;
  127. }
  128. }, 500);
  129. }
  130. else {
  131. document.location.href = mebtnopenurl;
  132. }
  133. }
  134. </script>
  135. <div style="display: none;">
  136. </div>
  137. </body>
  138. </html>