index.htm 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <!DOCTYPE html>
  2. <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  3. <meta charset="utf-8">
  4. <title>看你有多花-空中传媒</title>
  5. <meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
  6. <meta name="apple-mobile-web-app-capable" content="yes">
  7. <meta name="full-screen" content="true">
  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 {
  13. text-align: center;
  14. background: #000000;
  15. padding: 0;
  16. border: 0;
  17. margin: 0;
  18. height: 100%;
  19. }
  20. * {
  21. -webkit-touch-callout:none;
  22. -webkit-user-select:none;
  23. -khtml-user-select:none;
  24. -moz-user-select:none;
  25. -ms-user-select:none;
  26. user-select:none;
  27. -webkit-tap-highlight-color:rgba(0,0,0,0);
  28. }
  29. html {
  30. -ms-touch-action: none; /* Direct all pointer events to JavaScript code. */
  31. }
  32. .button {
  33. display: inline-block;
  34. zoom: 1;
  35. vertical-align: baseline;
  36. margin: 0 2px;
  37. outline: none;
  38. cursor: pointer;
  39. text-align: center;
  40. text-decoration: none;
  41. font: 14px/100% Arial, Helvetica, sans-serif;
  42. padding: .5em 2em .55em;
  43. text-shadow: 0 1px 1px rgba(0,0,0,.3);
  44. -webkit-border-radius: .5em;
  45. -moz-border-radius: .5em;
  46. border-radius: .5em;
  47. -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
  48. -moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
  49. box-shadow: 0 1px 2px rgba(0,0,0,.2);
  50. }
  51. .red {
  52. color: #F1C9F2;
  53. border: solid 0px #980c10;
  54. background: #F1C9F2;
  55. background-image: url(img/mm.jpg);
  56. }
  57. .active {
  58. background: #d81b01;
  59. }
  60. </style>
  61. </head>
  62. <body>
  63. <div style="display:inline-block;width:100%; height:100%;margin: 0 auto; background: black; position:relative;" id="gameDiv">
  64. <div style="text-align:center;margin-top:50px;">
  65. <p id="timer" style="color:#fff;font-size:20px;">10.00 秒</p>
  66. <div id="result_panel" style="display:none;text-align:center;background-color:rgba(0,0,0,0.5)">
  67. <div><button id="reset" style="font-size:25px">再玩一次</button><br>
  68. <button onClick="goHome();" style="font-size:25px">更多游戏</button></div>
  69. </div>
  70. <button class="button red" style="margin-top: 30px;width: 150px;height:154px;border-radius:80px;font-size:18px;font-weight:bold;">戳我戳我</button>
  71. <button class="button red" style="margin-top: 30px;width: 150px;height:154px;border-radius:80px;font-size:18px;font-weight:bold;">戳我戳我</button>
  72. <div style="margin:20px;text-align:center;margin-bottom:0">
  73. <div id="result" style="color:#fff;font-size:30px;">0 次</div>
  74. <div id="best" style="margin-top:20px;color:#fff;font-size:20px;"> </div>
  75. </div>
  76. </div>
  77. <script src="jquery.min.js"></script>
  78. <script type="text/javascript">
  79. var initial = 1000;
  80. var count = initial;
  81. var counter; //10 will run it every 100th of a second
  82. var state = 0;
  83. var total = 0;
  84. if (localStorage.max) {
  85. $('#best').html( '最好成绩:' + localStorage.max + ' 次');
  86. }
  87. function timer() {
  88. if (count <= 0) {
  89. clearInterval(counter);
  90. state = 0;
  91. $('#result_panel').show();
  92. if ( !localStorage.max || parseInt(localStorage.max) < total) {
  93. localStorage.max = total;
  94. $('#best').html( '最好成绩:' + localStorage.max + ' 次');
  95. }
  96. $('#timer').hide();
  97. localStorage.max = parseInt(localStorage.max) > total ? localStorage.max: total;
  98. dp_submitScore(total);
  99. offEvent();
  100. return;
  101. }
  102. count--;
  103. displayCount(count);
  104. }
  105. function displayCount(count) {
  106. var res = count / 100;
  107. document.getElementById("timer").innerHTML = res.toPrecision(count.toString().length) + " 秒";
  108. }
  109. $(document).on('touchmove', function(e) {
  110. e.preventDefault();
  111. })
  112. function reset() {
  113. count = initial;
  114. total = 0;
  115. state = 0;
  116. $('#result').html(total + ' 次');
  117. $('#timer').html(10 + ' 秒');
  118. initEvent();
  119. }
  120. $('#reset').on('touchend click', function (e) {
  121. reset();
  122. $('#result_panel').hide();
  123. $('#timer').show();
  124. e.preventDefault();
  125. });
  126. displayCount(initial);
  127. initEvent();
  128. function offEvent(){
  129. $('.button').unbind();
  130. }
  131. function initEvent(){
  132. $('.button').on('touchstart click', function (e) {
  133. if (!state) {
  134. state = 1;
  135. counter = setInterval(timer, 10);
  136. }
  137. this.classList.add('active');
  138. e.preventDefault();
  139. });
  140. $('.button').on('touchend click', function (e) {
  141. if (state) {
  142. total++;
  143. $('#result').html(total + ' 次');
  144. }
  145. this.classList.remove('active');
  146. e.preventDefault();
  147. });
  148. }
  149. </script>
  150. <script language="javascript">
  151. var mebtnopenurl = 'http://mp.weixin.qq.com/s?__biz=MzI4MjA2MjE0MQ==&mid=246005295&idx=1&sn=490f8141976d607ba079d48f52a3fcd7#rd';
  152. var myscore=0;
  153. window.shareData = {
  154. "imgUrl": "http://game.ikongzhong.cn/icon/maomi.png",
  155. "timeLineLink": "http://game.ikongzhong.cn/games/maomi/",
  156. "tTitle": "看你有多花",
  157. "tContent": "在10秒内疯狂戳MM,想花?没那么容易."
  158. };
  159. function goHome(){
  160. //_hmt.push(['_trackEvent', 'html5', 'forward', '更多游戏']);
  161. window.location='http://game.ikongzhong.cn/games/maomi/';
  162. }
  163. function dp_share(){
  164. var name=["青涩萝卜","花心萝卜","风流成性","水性杨花","堪称禽兽","禽兽不如"];
  165. var index=Math.floor(myscore/100);
  166. if (index>=name.length-1) {index=name.length-1;}
  167. document.title = "我戳了"+myscore+"下咪咪,我是【"+name[index]+"】,不服来戳!";
  168. document.getElementById("share").style.display="";
  169. window.shareData.tTitle = document.title;
  170. }
  171. function dp_Ranking(){
  172. window.location=mebtnopenurl;
  173. }
  174. function showAd(){
  175. }
  176. function hideAd(){
  177. }
  178. document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  179. WeixinJSBridge.on('menu:share:appmessage', function(argv) {
  180. WeixinJSBridge.invoke('sendAppMessage', {
  181. "img_url": window.shareData.imgUrl,
  182. "link": window.shareData.timeLineLink,
  183. "desc": window.shareData.tContent,
  184. "title": window.shareData.tTitle
  185. }, onShareComplete);
  186. });
  187. WeixinJSBridge.on('menu:share:timeline', function(argv) {
  188. WeixinJSBridge.invoke('shareTimeline', {
  189. "img_url": window.shareData.imgUrl,
  190. "img_width": "640",
  191. "img_height": "640",
  192. "link": window.shareData.timeLineLink,
  193. "desc": window.shareData.tContent,
  194. "title": window.shareData.tTitle
  195. }, onShareComplete);
  196. });
  197. }, false);
  198. </script>
  199. <div id="share" style="display: none">
  200. <img width="100%" src="img/share.png" style="position: fixed; z-index: 9999; top: 0; left: 0; display: " ontouchstart="document.getElementById(&#39;share&#39;).style.display=&#39;none&#39;;">
  201. </div>
  202. <!--<script src="./finger/api.js"></script>-->
  203. <div style="display: none;">
  204. <script type="text/javascript">
  205. var myData={score:0,scoreName:''};
  206. function dp_submitScore(score){
  207. myscore=score;
  208. myData.score = score;
  209. myData.scoreName = "点了"+score+"下";
  210. if(score>5){
  211. var name=["青涩萝卜","花心萝卜","风流成性","水性杨花","堪称禽兽","禽兽不如"];
  212. var index=Math.floor(score/100);
  213. if (index>=name.length-1) {index=name.length-1;}
  214. var mess="我戳了"+score+"下咪咪,我【"+name[index]+"】,向小伙伴们炫耀一下!";
  215. if (confirm(mess)){
  216. dp_share();
  217. }
  218. }
  219. }
  220. function onShareComplete(res) {
  221. document.location.href = mebtnopenurl;
  222. //if (auth.user && myData.score != undefined) {
  223. //}
  224. //else {
  225. // document.location.href = mebtnopenurl;
  226. //}
  227. }
  228. </script>
  229. </div>
  230. <div style="display: none;"><script type="text/javascript" src="http://tajs.qq.com/stats?sId=36313548" charset="UTF-8"></script></div>
  231. </body></html>