TW Big Map

Fullscreen Map for The West Classic

  1. // ==UserScript==
  2. // @name TW Big Map
  3. // @version 1.1
  4. // @author Johnny
  5. // @namespace Johnny
  6. // @description Fullscreen Map for The West Classic
  7. // @match https://classic.the-west.net/game.php*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. let css = '\
  13. #health_bar, #energy_bar, #experience_bar, #avatar, #current_task, #cash, #deposit, #task_time, #left_menu, #right_menu { position: fixed; } \
  14. #footer_menu_left { z-index: 42; } \
  15. #head_container { width: 100%; padding: 0; } \
  16. #border_cap { display: none; } \
  17. #left_menu { top: 0; left: 0; } \
  18. #right_menu { top: 0; right: 0; } \
  19. #head_background { margin: 0; width: 100%; } \
  20. #menus { z-index: 42; } \
  21. #character_info { margin: 0; z-index: 42; color: white; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; } \
  22. #avatar { top: 0; left: 130px; } \
  23. #health_bar, #energy_bar, #experience_bar { left: 201px; } \
  24. #health_bar { top: 6px; } \
  25. #energy_bar { top: 26px; } \
  26. #experience_bar { top: 46px; } \
  27. #current_task { top: 0; right: 130px; height: auto; } \
  28. #cash, #deposit, #task_time { right: 201px; } \
  29. #task_time { top: 7px; } \
  30. #cash { top: 33px; } \
  31. #deposit { top: 53px; } \
  32. body { padding: 0; overflow: hidden; } \
  33. #map_wrapper { top: 0; bottom: 0; left: 0; right: 0; position: fixed; width: 100%; height: 100%; z-index: 23; } \
  34. #map_place, #map, #map_mover, #fade_div { width: 100%; height: 100%; } \
  35. #minimap_container { z-index: 42; top: 45px; } \
  36. #chat { position: fixed !important; z-index: 42 !important; bottom: 0 !important; left: 0 !important; background: rgba(29, 28, 28, .8) !important; margin: 0 !important; border-top: 1px solid rgb(100, 100, 100); box-shadow: rgb(0, 0, 0) 0px 0px 10px 1px; } \
  37. .messagelist li span { color: #fff !important; } \
  38. .messagelist li span:first-of-type, .messagelist li a, .playerlist li a { color: #b7a97e !important; font-weight: bold; } \
  39. #roomselection .switchbutton:first-of-type { margin-left: 0; } \
  40. #roomselection .switchbutton { opacity: 1 !important; color: #AE9E82 !important; border: none !important; } \
  41. #roomselection .switchbutton.selected { color: #fff !important; background: rgba(0, 0, 0, .5) !important; border: 1px solid #646464 !important; border-radius: 2px; box-shadow: 0px 0px 1px 1px black; -moz-box-shadow: 0px 0px 1px 1px #000; -webkit-box-shadow: 0px 0px 1px 1px #000; } \
  42. .close_chat_button { background: url(https://westzzs.innogamescdn.com/images/chat/windowicons.png?6) no-repeat !important; background-position: -24px 0 !important; } \
  43. #send input, #send button { background: rgba(0, 0, 0, 0.3); border: 1px solid #646464; border-radius: 2px; box-shadow: 0px 0px 1px 1px black; -moz-box-shadow: 0px 0px 1px 1px #000; -webkit-box-shadow: 0px 0px 1px 1px #000; color: #fff; font-weight: bold; padding: 0 4px; } \
  44. #send input::-webkit-input-placeholder { color: #757575; } \
  45. #send input::-moz-placeholder, #send input:-moz-placeholder { color: #757575; } \
  46. .resizer { width: 24px; height: 13px; background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAEAQMAAAB1Fsd5AAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjaGAAAwADiACBhux1cwAAAABJRU5ErkJggg==") repeat; position: absolute; top: 5px; right: 5px; cursor: ns-resize; } \
  47. ';
  48. let style = document.createElement('style');
  49. style.setAttribute('type', 'text/css');
  50. style.innerHTML = css;
  51. document.getElementsByTagName('head')[0].appendChild(style);
  52.  
  53. let icons = document.getElementById('footer_menu_left');
  54. icons.style.position = 'fixed';
  55. icons.style.height = 'auto';
  56. icons.style.left = window.innerWidth / 2 - 59.5 + 'px';
  57. let map = document.getElementById('minimap_container');
  58. map.style.left = window.innerWidth / 2 - 325 + 'px';
  59.  
  60. let waitForChat = window.setInterval(function() {
  61. let chat = document.getElementById('chat');
  62. if (!chat) return;
  63. window.clearInterval(waitForChat);
  64. let chatInitHeight = localStorage.getItem('chat-height');
  65. if (chatInitHeight) chat.style.height = chatInitHeight;
  66. let resizer = document.createElement('div');
  67. resizer.className = 'resizer';
  68. chat.appendChild(resizer);
  69. resizer.addEventListener('mousedown', initDrag, false);
  70. let startY;
  71. let startHeight;
  72. function initDrag(e) {
  73. startY = e.clientY;
  74. startHeight = parseInt(document.defaultView.getComputedStyle(chat).height, 10);
  75. document.documentElement.addEventListener('mousemove', doDrag, false);
  76. document.documentElement.addEventListener('mouseup', stopDrag, false);
  77. }
  78. function doDrag(e) {
  79. let height = (startHeight - e.clientY + startY) + 'px';
  80. chat.style.height = height;
  81. localStorage.setItem('chat-height', height);
  82. }
  83. function stopDrag(e) {
  84. document.documentElement.removeEventListener('mousemove', doDrag, false);
  85. document.documentElement.removeEventListener('mouseup', stopDrag, false);
  86. }
  87. }, 100);
  88.  
  89. WMap.initialize();
  90. })();
  91.  
  92. window.addEventListener('resize', function() {
  93. let icons = document.getElementById('footer_menu_left');
  94. icons.style.left = window.innerWidth / 2 - 59.5 + 'px';
  95. let map = document.getElementById('minimap_container');
  96. map.style.left = window.innerWidth / 2 - 325 + 'px';
  97.  
  98. WMap.initialize();
  99. });

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址