index.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport"
  6. content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
  7. <meta name="apple-mobile-web-app-capable" content="yes">
  8. <meta name="full-screen" content="true">
  9. <meta name="screen-orientation" content="portrait">
  10. <meta name="x5-fullscreen" content="true">
  11. <meta name="360-fullscreen" content="true">
  12. <title>最强电灯泡</title>
  13. <style type="text/css">
  14. .btn {
  15. border: 1px solid #ccc;
  16. border-radius: 4px;
  17. padding: 12px;
  18. transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
  19. background-color: #3498db;
  20. color: #fff;
  21. display:inline;
  22. margin-right:10px;
  23. }
  24. .result-container {
  25. display: none;
  26. }
  27. .result-container {
  28. display: none;
  29. position: absolute;
  30. top: 0;
  31. left: 0;
  32. width: 100%;
  33. height: 100%;
  34. text-align: center;
  35. background: rgba(0, 0, 0, 0.9);
  36. color: #fff;
  37. padding-top: 50px;
  38. }
  39. .result-container>p {
  40. margin: 20px 0 40px 0;
  41. font-size: 18px;
  42. }
  43. .play-again {
  44. background-color: #1abc9c;
  45. }
  46. .title {
  47. color: #fff;
  48. font-size: 13px;
  49. }
  50. #switchBtn {
  51. background: #1abc9c;
  52. }
  53. .rcontainer{
  54. position:relative;
  55. top:20%;
  56. width:80%;
  57. margin:auto;
  58. }
  59. </style>
  60. <script type="text/javascript" src="js/game.js"></script>
  61. </head>
  62. <body bgcolor=#AABBCC>
  63. <div ALIGN=center>
  64. <div style="font-weight: bold; color: #3498db;">
  65. <span id="movecount">0</span> 步 </div>
  66. <h1 class="title">
  67. 把所有电灯泡都点亮吧!
  68. </h1>
  69. <table border=4 cellpadding=0 cellspacing=2 bgcolor=#CCCCCC
  70. id="table">
  71. </table>
  72. <br>
  73. <table>
  74. <tr>
  75. <td>
  76. <div class="btn play-again" onclick="javascript:Init(true)">
  77. 重新开始
  78. </div>
  79. </td>
  80. <td>
  81. <div class="btn" onclick="clickMore();">更多福利</div>
  82. </td>
  83. </tr>
  84. </table>
  85. <div class="result-container" id="result_container" style="display:block;">
  86. <div class="rcontainer">
  87. <p id="result"></p>
  88. <div class="btn play-again" onclick="Init(true)">
  89. 再来一盘
  90. </div>
  91. <div class="btn" onclick="clickMore();">更多福利</div>
  92. </div>
  93. </div>
  94. </div>
  95. <script language=javascript>
  96. var mebtnopenurl = 'http://mp.weixin.qq.com/s?__biz=MzI4MjA2MjE0MQ==&mid=246005295&idx=1&sn=490f8141976d607ba079d48f52a3fcd7#rd';
  97. window.shareData = {
  98. "imgUrl": "./img/icon.png",
  99. "timeLineLink": "http://game.ikongzhong.cn/games/zqdp/",
  100. "tTitle": "最强电灯泡",
  101. "tContent": "最强电灯泡"
  102. };
  103. function goHome(){
  104. window.location=mebtnopenurl;
  105. }
  106. function clickMore(){
  107. if((window.location+"").indexOf("zf",1)>0){
  108. window.location = "http://game.ikongzhong.cn/";
  109. }
  110. else{
  111. goHome();
  112. }
  113. }
  114. function dp_share(){
  115. document.title ="点亮你的智商!我用了"+myData.score+"步,点亮了所有电灯,你也来试试吧!";
  116. document.getElementById("share").style.display="";
  117. window.shareData.tTitle = document.title;
  118. }
  119. function dp_Ranking(){
  120. window.location=mebtnopenurl;
  121. }
  122. function showAd(){
  123. }
  124. function hideAd(){
  125. }
  126. document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  127. WeixinJSBridge.on('menu:share:appmessage', function(argv) {
  128. WeixinJSBridge.invoke('sendAppMessage', {
  129. "img_url": window.shareData.imgUrl,
  130. "link": window.shareData.timeLineLink,
  131. "desc": window.shareData.tContent,
  132. "title": window.shareData.tTitle
  133. }, onShareComplete);
  134. });
  135. WeixinJSBridge.on('menu:share:timeline', function(argv) {
  136. WeixinJSBridge.invoke('shareTimeline', {
  137. "img_url": window.shareData.imgUrl,
  138. "img_width": "640",
  139. "img_height": "640",
  140. "link": window.shareData.timeLineLink,
  141. "desc": window.shareData.tContent,
  142. "title": window.shareData.tTitle
  143. }, onShareComplete);
  144. });
  145. }, false);
  146. </script>
  147. <div id=share style="display: none">
  148. <img width=100% src="./img/share.png"
  149. style="position: fixed; z-index: 9999; top: 0; left: 0; display: "
  150. ontouchstart="document.getElementById('share').style.display='none';" />
  151. </div>
  152. <script src="js/jquery.min.js"></script>
  153. <script src="js/api.js"></script>
  154. <div style="display: none;">
  155. <script type="text/javascript">
  156. var auth = new Auth9G("zqddp");
  157. auth.order = "asc";
  158. var myData = {};
  159. auth.identify = function() {
  160. if (auth.user) {
  161. window.shareData.timeLineLink += ((window.shareData.timeLineLink.indexOf("?") == -1 ? "?" : "&") + "uid=" + auth.myuid);
  162. }
  163. }
  164. function dp_submitScore(score){
  165. myData.score = score;
  166. myData.scoreName = score+"步";
  167. if(score>0){
  168. if (confirm("真行,你用了"+score+"步点亮了所有的灯!要不要通知下小伙伴们呢?")){
  169. dp_share();
  170. }
  171. }
  172. }
  173. function onShareComplete(res) {
  174. if (auth.user && myData.score != undefined) {
  175. setTimeout(function(){
  176. if (confirm("要将成绩提交到游戏排行榜吗?")) {
  177. auth.submit(myData.score, myData.scoreName, function(){
  178. auth.gotoRank("24h");
  179. });
  180. }
  181. else {
  182. document.location.href = mebtnopenurl;
  183. }
  184. }, 500);
  185. }
  186. else {
  187. document.location.href = mebtnopenurl;
  188. }
  189. }
  190. </script>
  191. <script language="JavaScript">
  192. draw();
  193. Init(true);
  194. </script>
  195. <div style='display:none'>
  196. </div>
  197. </body>
  198. </html>