Reposition replay stats script

moves replay stats to the left

目前為 2019-07-10 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Reposition replay stats script
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.30
  5. // @description moves replay stats to the left
  6. // @author Oki
  7. // @match https://*.jstris.jezevec10.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. /******************************
  12. Reposition replay stats script
  13. ******************************/
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. window.addEventListener('load', function(){
  19.  
  20. var website = "jstris.jezevec10.com"
  21. var url = window.location.href
  22. var parts = url.split("/")
  23.  
  24. if(parts[3]=="replay" && parts[2].endsWith(website) && parts.length>4){
  25.  
  26. if(parts[4]!="1v1"){
  27.  
  28.  
  29. var stat1 = document.querySelector("#stats table")
  30. var stat2 = document.querySelector(".moreStats")
  31.  
  32. var wrapper = document.createElement('div');
  33. wrapper.id = "bothStats"
  34.  
  35. stat1.parentNode.insertBefore(wrapper, stat1);
  36. stat2.parentNode.insertBefore(wrapper, stat2);
  37. wrapper.appendChild(stat1);
  38. wrapper.appendChild(stat2);
  39.  
  40. var vertPos = 400
  41. var horPos = -200
  42.  
  43. bothStats.style.position = "absolute"
  44. bothStats.style.left = horPos + "px"
  45. bothStats.style.top = vertPos + "px"
  46.  
  47.  
  48.  
  49. }
  50. }
  51.  
  52.  
  53. });
  54. })();