index.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. 
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta charset="UTF-8">
  6. <meta name="viewport"
  7. content="width=device-width,user-scalable=no,initial-scale=1.0" />
  8. <meta name="apple-mobile-web-app-capable" content="yes" />
  9. <title>超级染色体</title>
  10. <link type="text/css" href="css/game_base.css" rel="stylesheet" />
  11. <script type="text/javascript" src="js/jquery-2.1.0.min.js"></script>
  12. <script type="text/javascript" src="js/game_base.js"></script>
  13. <script type="text/javascript" src="js/createjs-2013.12.12.min.js"></script>
  14. <script type="text/javascript" src="js/createjs_game.js"></script>
  15. <script type="text/javascript" src="js/jquery.cookie.js"></script>
  16. <script type="text/javascript" src="js/main.js"></script>
  17. <style type="text/css">
  18. .follow {
  19. z-index: 100;
  20. position: absolute;
  21. left: -500px;
  22. bottom: 0px;
  23. width: 20%;
  24. opacity: 0;
  25. }
  26. .follow img {
  27. width: 100%
  28. }
  29. .moreGames {
  30. z-index: 100;
  31. position: absolute;
  32. bottom: 10px;
  33. margin-left: auto;
  34. margin-right: auto;
  35. width: 100%;
  36. text-align: center;
  37. }
  38. .moreGames a {
  39. font: 11px Arial;
  40. text-decoration: none;
  41. background-color: #C0C0C0;
  42. color: #FFFFFF;
  43. padding: 2px 10px 2px 10px;
  44. border-radius: 8px;
  45. -webkit-border-radius: 8px;
  46. }
  47. </style>
  48. </head>
  49. <body>
  50. <canvas id="stage">
  51. 您的浏览器不支持html5, 请换用支持html5的浏览器
  52. </canvas>
  53. <script language=javascript>
  54. var mebtnopenurl = 'http://mp.weixin.qq.com/s?__biz=MzI4MjA2MjE0MQ==&mid=246005295&idx=1&sn=490f8141976d607ba079d48f52a3fcd7#rd'; //更多游戏链接
  55. var myscore=0;
  56. var mylevel=0;
  57. window.shareData = {
  58. "imgUrl": "./img/icon.png", //分享时的图片
  59. "timeLineLink": "./index.html", //分享时的链接
  60. "tTitle": "超级染色体", //分享时的title
  61. "tContent": "超级染色体" //分享时的内容
  62. };
  63. function goHome(){
  64. window.location=mebtnopenurl;
  65. }
  66. function clickMore(){
  67. goHome();
  68. }
  69. function dp_share(){
  70. document.title ="我用了"+score+"步完成了超级染色体,你也来试试吧!";
  71. document.getElementById("share").style.display="";
  72. window.shareData.tTitle = document.title;
  73. }
  74. function dp_Ranking(){
  75. window.location=mebtnopenurl;
  76. }
  77. function showAd(){
  78. }
  79. function hideAd(){
  80. }
  81. document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  82. WeixinJSBridge.on('menu:share:appmessage', function(argv) {
  83. WeixinJSBridge.invoke('sendAppMessage', {
  84. "img_url": window.shareData.imgUrl,
  85. "link": window.shareData.timeLineLink,
  86. "desc": window.shareData.tContent,
  87. "title": window.shareData.tTitle
  88. }, onShareComplete);
  89. });
  90. WeixinJSBridge.on('menu:share:timeline', function(argv) {
  91. WeixinJSBridge.invoke('shareTimeline', {
  92. "img_url": window.shareData.imgUrl,
  93. "img_width": "640",
  94. "img_height": "640",
  95. "link": window.shareData.timeLineLink,
  96. "desc": window.shareData.tContent,
  97. "title": window.shareData.tTitle
  98. }, onShareComplete);
  99. });
  100. }, false);
  101. </script>
  102. <div id=share style="display: none">
  103. <img width=100% src="img/share.png"
  104. style="position: fixed; z-index: 9999; top: 0; left: 0; display: "
  105. ontouchstart="document.getElementById('share').style.display='none';">
  106. </div>
  107. <div style="display: none;">
  108. <script type="text/javascript">
  109. var myData = {};
  110. function dp_submitScore(score,level){
  111. myscore=score;
  112. mylevel=level
  113. myData.score = score;
  114. myData.scoreName = score+"步";
  115. if(score>5){
  116. if (confirm("真行,你用了"+score+"步!要不要通知下小伙伴们呢?")){
  117. dp_share();
  118. }
  119. }
  120. }
  121. function onShareComplete(res) {
  122. document.location.href = mebtnopenurl;
  123. }
  124. </script>
  125. </body>
  126. </html>