index.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <title>DNF爱的守护者 跳圈圈</title>
  5. <meta name="viewport" content="width=device-width,user-scalable=no"/>
  6. <meta charset="utf-8"/>
  7. <meta name="author" content="tg"/>
  8. </head>
  9. <style>
  10. html, body { background-color:#80D4FF;margin:0; padding:0;width:100%;height:100%; text-align: center}
  11. #loadicon{margin-top: 250px; }
  12. #orient{margin-top:50px;}
  13. p{color:#FFFFFF; font-size: 24}
  14. </style>
  15. <script src="js/Base64Images.js"></script>
  16. <body onload="complete();">
  17. <div class="orient" id="orient" style="display:none"><p>请在竖屏情况下使用</p></div>
  18. <div id="loadicon"><img id="img1"/><br/><img id="img2"/><br/><img id="img3"/></div>
  19. <canvas id="gameCanvas" width="640" height="1008"></canvas>
  20. <!--<div id="cou" style="width:320px;margin: 0 auto;"></div>3C2F3C" #191919 -->
  21. <script src="http://pingjs.qq.com/ping_tcss_ied.js"></script>
  22. <script>
  23. if(typeof(pgvMain) == 'function') pgvMain();
  24. //横屏提示
  25. function orientationChange(){
  26. if(window.orientation==90||window.orientation==-90){
  27. document.getElementById("gameCanvas").style.display="none"
  28. document.getElementById("orient").style.display="block"
  29. }else{
  30. document.getElementById("gameCanvas").style.display="block"
  31. document.getElementById("orient").style.display="none"
  32. }
  33. }
  34. orientationChange();
  35. window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", orientationChange, false);
  36. function trace(v){
  37. console.log(v)
  38. }
  39. var ccConfig={
  40. "debugMode" : 0,
  41. "showFPS" : false,
  42. "frameRate" : 40,
  43. "id" : "gameCanvas",
  44. "renderMode" : 1,
  45. "engineDir":"./../",
  46. "modules" : ["cocos2d"],
  47. "jsList" : [
  48. ]
  49. }
  50. document["ccConfig"]=ccConfig;
  51. //document.getElementById("img1").src=cc._loaderImage;
  52. document.getElementById("img2").src=cc._loadingImage;
  53. document.getElementById("img3").src=cc.tgideasLogo;
  54. var GD={}
  55. GD.GETNUM=0;
  56. GD.SCORE=0;
  57. GD.SOUND=true
  58. GD.MAXHITUM=0;
  59. GD.MAXTIME=60;
  60. GD.USETIME=0;
  61. function complete(){
  62. orientationChange();
  63. document.getElementById("loadicon").style.display="none";
  64. cc.game.run();
  65. }
  66. function onBridgeReady() {
  67. //转发朋友圈
  68. WeixinJSBridge.on("menu:share:timeline", function(e) {
  69. var url = 'http://dnf.qq.com/act/a20140925horsegame/index.html';
  70. var data = {
  71. img_url: "http://dnf.qq.com/act/a20140925horsegame/logo.png",
  72. img_width: "315",
  73. img_height: "315",
  74. link: url,
  75. //desc这个属性要加上,虽然不会显示,但是不加暂时会导致无法转发至朋友圈,
  76. title:"剑与盾,DNF爱的守护者降临,仰天啸,跳圈圈,怒跳火圈"+GD.NUM+"个,还有奖励领!",
  77. desc: "DNF爱的守护者 跳圈圈 "
  78. };
  79. WeixinJSBridge.invoke("shareTimeline", data, function(res) {
  80. if(pgvSendClick&&typeof(pgvSendClick) == 'function') pgvSendClick({hottag:'h5game.horsegame.shareTimeline'});
  81. // pgvSendClick({hottag:'act.a20140721hds.shareTimeline'});
  82. WeixinJSBridge.log(res.err_msg);
  83. });
  84. });
  85. //同步到微博
  86. WeixinJSBridge.on("menu:share:weibo", function() {
  87. var url = 'http://dnf.qq.com/act/a20140925horsegame/index.html';
  88. WeixinJSBridge.invoke("shareWeibo", {
  89. "content":"剑与盾,DNF爱的守护者降临,仰天啸,跳圈圈,怒跳"+GD.NUM+"火圈,还有奖励领!",
  90. "url": url
  91. }, function(res) {
  92. if(pgvSendClick&&typeof(pgvSendClick) == 'function') pgvSendClick({hottag:'h5game.horsegame.shareweibo'});
  93. WeixinJSBridge.log(res.err_msg);
  94. });
  95. });
  96. //分享给朋友
  97. WeixinJSBridge.on('menu:share:appmessage', function(argv) {
  98. var url = 'http://dnf.qq.com/act/a20140925horsegame/index.html';
  99. WeixinJSBridge.invoke("sendAppMessage", {
  100. img_url: "http://dnf.qq.com/act/a20140925horsegame/logo.png",
  101. img_width: "315",
  102. img_height: "315",
  103. link: url,
  104. title:"DNF爱的守护者 跳圈圈",
  105. desc: "剑与盾,DNF爱的守护者降临,仰天啸跳圈圈,怒跳"+GD.NUM+"火圈,还有奖励领!"
  106. }, function(res) {
  107. if(pgvSendClick&&typeof(pgvSendClick) == 'function') pgvSendClick({hottag:'h5game.horsegame.sharemessage'});
  108. // pgvSendClick({hottag:'act.a20140721hds.sharemessage'});
  109. WeixinJSBridge.log(res.err_msg)
  110. });
  111. });
  112. };
  113. try{
  114. document.addEventListener('WeixinJSBridgeReady', function() {
  115. onBridgeReady();
  116. });
  117. }catch(e){}
  118. </script>
  119. <!--<script src="http://tgideas.qq.com/flash/h5/fight/co/lib/cocos2dtgme.js"></script>-->
  120. <script src="js/resource.js"></script>
  121. <script src="js/cocos2dtgme.js"></script>
  122. <script src="js/app2.js"></script>
  123. </body>
  124. </html><!--[if !IE]>|xGv00|623d9e983d91e99d6d5b202a0b0dd9fb<![endif]-->