share.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. function w596_rank(x){
  2. var s ='';
  3. var t ='神奇蜘蛛侠 变态版';
  4. var x1=''; // 部门
  5. var x2=''; // 公职
  6. var y=''; // 人数
  7. var z=''; // 百分比
  8. var arr ='';
  9. if(x>10000){
  10. x2='超凡蜘蛛侠';
  11. z='99';
  12. y=Math.floor( + Math.random() * 713);
  13. }
  14. else if(x>3000){ // 特攻队
  15. arr= "王牌蜘蛛侠 钢铁蜘蛛侠 超级蜘蛛侠 人气蜘蛛侠".split(" ");
  16. x2=arr[Math.floor(Math.random() * arr.length)];
  17. z=myRnd(55,98);
  18. y=Math.floor( + Math.random() * 97596);
  19. }
  20. else if(x>1000){ // 陆战队
  21. arr= "奇葩蜘蛛侠 红人蜘蛛侠 得瑟蜘蛛侠 天朝蜘蛛侠".split(" ");
  22. x2=arr[Math.floor(Math.random() * arr.length)];
  23. z=myRnd(20,55);
  24. y=Math.floor( + Math.random() * 998899);
  25. }
  26. else if(x>500){ // 文艺兵
  27. arr= "屌丝蜘蛛侠 普通蜘蛛侠 山寨蜘蛛侠".split(" ");
  28. x2=arr[Math.floor(Math.random() * arr.length)];
  29. z=myRnd(5,20);
  30. y=Math.floor( + Math.random() * 72568899);
  31. }
  32. else{ // 预备役
  33. x2='失败蜘蛛侠';
  34. z=myRnd(1,5);
  35. if(e==0){z=1;}
  36. y=Math.floor( + Math.random() * 895968899);
  37. }
  38. title = "在"+t+"我获得了 "+x2+"称号,看看你能玩多大?";
  39. dp_submitScore(x);
  40. return '<div id="weixin-share"></div><div id="weixin-text"><div id="j"><div id="txt">'+x2+'</div><div id="rank">排名 '+y+' 位 <br/>击败了 ' + z+ '% 玩家</div></div></div></div>';
  41. }
  42. function myRnd(min,max){
  43. return Math.floor(min+Math.random()*(max-min));
  44. }
  45. var isTouch = ('ontouchstart' in window);
  46. var touchStartEvent = isTouch ? "touchstart" : "mousedown";
  47. var touchEndEvent = isTouch ? "touchend" : "mouseup";
  48. document.addEventListener(touchStartEvent, function () {
  49. try {
  50. event.stopPropagation();
  51. }
  52. catch (err) {
  53. }
  54. }, false);
  55. document.addEventListener(touchEndEvent, function () {
  56. event.stopPropagation();
  57. }, false);
  58. function bodyClick(dom) {
  59. dom.addEventListener(touchStartEvent, function () {
  60. try {
  61. event.stopPropagation();
  62. }
  63. catch (err) {
  64. }
  65. }, false);
  66. dom.addEventListener(touchEndEvent, function () {
  67. var linkbtn = document.getElementById("linkbtn");
  68. if (linkbtn && linkbtn.length) {
  69. linkbtn.style.display = "none";
  70. }
  71. event.stopPropagation();
  72. }, false);
  73. };
  74. var bodyx = document.getElementById("hs");
  75. bodyClick(bodyx);