Eternity smarTower

Improve Eternity Tower's webgame display

  1. // ==UserScript==
  2. // @name Eternity smarTower
  3. // @namespace etsmartower
  4. // @description Improve Eternity Tower's webgame display
  5. // @description:fr Améliore l'affichage du jeu web Eternity Tower
  6. // @author oliezekat
  7. // @include https://www.eternitytower.net/*
  8. // @version 2
  9. // @grant GM_addStyle
  10. // @grant GM_log
  11. // ==/UserScript==
  12.  
  13. // Unique object
  14. if (!ETsmarTower) var ETsmarTower = {};
  15.  
  16. ETsmarTower =
  17. {
  18. /* Requires modules */
  19. Log: {},
  20. Renders: {}
  21. };
  22. ETsmarTower.Init = function()
  23. {
  24. /* Init Log */
  25. this.Log.Init(this);
  26. this.Log._Enabled = false;
  27. this.Log.Add('Start...');
  28.  
  29. this.Renders.Init(this);
  30. // Common features
  31. this.Renders.Set_NoVisualEffects_Styles();
  32. this.Renders.Set_Patches_Styles();
  33. this.Renders.Set_Compact_Styles();
  34. this.Log.Add('End.');
  35. };
  36. ETsmarTower.Log =
  37. {
  38. _Parent: null,
  39. _Enabled: false
  40. };
  41. ETsmarTower.Log.Init = function(parent)
  42. {
  43. this._Parent = parent;
  44. };
  45. ETsmarTower.Log.Add = function(msg)
  46. {
  47. if (this._Enabled == true)
  48. {
  49. GM_log(msg);
  50. }
  51. };
  52. ETsmarTower.Renders =
  53. {
  54. _Parent: null
  55. };
  56. ETsmarTower.Renders.Init = function(parent)
  57. {
  58. this._Parent = parent;
  59. };
  60. ETsmarTower.Renders.Set_NoVisualEffects_Styles = function()
  61. {
  62. var default_style = '\
  63. * {\
  64. border-radius:none !important;\
  65. border-bottom-left-radius: 0 !important;\
  66. border-bottom-right-radius: 0 !important;\
  67. border-top-left-radius: 0 !important;\
  68. border-top-right-radius: 0 !important;\
  69. box-shadow: none !important;\
  70. text-shadow: none !important;\
  71. --transform: none !important;\
  72. transition: none !important;\
  73. }\
  74. ';
  75. GM_addStyle(default_style);
  76. };
  77. ETsmarTower.Renders.Set_Patches_Styles = function()
  78. {
  79. var default_style = '\
  80. body {\
  81. overflow-x: hidden !important;\
  82. }\
  83. ';
  84. GM_addStyle(default_style);
  85. };
  86. ETsmarTower.Renders.Set_Compact_Styles = function()
  87. {
  88. var default_style = '\
  89. /* Global */\
  90. div.item-icon-container {\
  91. background-color: #fff;\
  92. border-width: 1px 2px 2px 1px !important;\
  93. border-style: solid !important;\
  94. }\
  95. div.item-icon-container.small {\
  96. width: 3.58rem !important;\
  97. height: 3.58rem !important;\
  98. margin: 0.12rem 0.1rem;\
  99. padding: 0 !important;\
  100. }\
  101. div.item-icon-container.small img.item-icon {\
  102. width: 1.95rem !important;\
  103. height: 1.95rem !important;\
  104. margin-top: -0.25rem !important;\
  105. }\
  106. div.item-icon-container .item-amount-bubble {\
  107. right: 0.18rem;\
  108. font-size: 0.8rem;\
  109. border: none;\
  110. text-align: right;\
  111. padding: 0.12rem 0.24rem;\
  112. max-height: none;\
  113. height: auto;\
  114. left: auto;\
  115. top: auto !important;\
  116. background-color: transparent !important;\
  117. bottom: 0.16rem !important;\
  118. color: #555 !important;\
  119. font-style: normal !important;\
  120. overflow: hidden;\
  121. width: 2.4rem;\
  122. }\
  123. div.item-icon-container.small .item-amount-bubble {\
  124. font-size: 0.7rem;\
  125. right: 0;\
  126. bottom: 0.05rem !important;\
  127. }\
  128. .item-icon-container .item-quality-bubble {\
  129. right: auto !important;\
  130. color: #444 !important;\
  131. width: auto;\
  132. border-color: rgba(0,0,0,0.2);\
  133. height: auto;\
  134. max-height: none;\
  135. left: -0.25rem;\
  136. padding: 0.2rem 0.15rem;\
  137. font-size: 0.8rem !important;\
  138. top: -0.25rem !important;\
  139. font-style: normal !important;\
  140. border-width: 1px 2px 2px 1px !important;\
  141. }\
  142. .item-icon-container.small .item-quality-bubble {\
  143. font-size: 0.6rem !important;\
  144. padding: 0.1rem 0.15rem;\
  145. top: -0.15rem !important;\
  146. left: -0.15rem;\
  147. }\
  148. div.item-icon-container:hover {\
  149. background-color: #f7f7f9;\
  150. }\
  151. table.table-bordered.table-centered td {\
  152. padding: 0.1rem 0.5rem;\
  153. font-size: 0.8rem;\
  154. }\
  155. table.table-bordered.table-centered td:first-child {\
  156. text-align: left;\
  157. font-size: 1rem;\
  158. }\
  159. table.table-bordered.table-centered .ore-icon {\
  160. height: 3rem !important;\
  161. width: auto !important;\
  162. background-color: #fff;\
  163. padding: 2px;\
  164. }\
  165. table.table-bordered.table-centered td div.required-items-container {\
  166. justify-content: right !important;\
  167. }\
  168. table.table-bordered.table-centered td div.required-items-container span.mr-3.ml-1 {\
  169. min-width: 3.3rem;\
  170. text-align: right;\
  171. }\
  172. table.table-bordered.table-centered .btn {\
  173. padding: 0.1rem 0.5rem;\
  174. }\
  175. table.table-bordered.table-centered tr:hover {\
  176. background-color: #fff;\
  177. }\
  178. table.table-bordered.table-centered tr:hover td:first-child {\
  179. text-decoration: underline;\
  180. }\
  181. .my-tooltip-inner {\
  182. border-color:#333 !important;\
  183. border-width: 1px 2px 2px 1px !important;\
  184. }\
  185. /* Summary List */\
  186. .summaryList {\
  187. padding: 0.5rem !important;\
  188. }\
  189. .summaryList h6 {\
  190. margin-bottom: 0.2rem !important;\
  191. }\
  192. .summaryList .mt-3 {\
  193. margin-top: 0.2rem !important;\
  194. }\
  195. .summary-mining .mine-pit-container {\
  196. max-width: none !important;\
  197. }\
  198. .summary-crafting {\
  199. max-width: none !important;\
  200. }\
  201. .summary-inscription {\
  202. max-width: none !important;\
  203. }\
  204. /* Battle */\
  205. .lobby-container > div {\
  206. margin-top: 0.5rem !important;\
  207. }\
  208. .lobby-container .lobby-units-container {\
  209. margin-bottom: 2.5rem !important;\
  210. }\
  211. button.forfeit-battle {\
  212. position:fixed;\
  213. bottom:1rem;\
  214. }\
  215. /* Mine Prospectors */\
  216. table.table-bordered.table-centered .prospector-row .ore-icon {\
  217. height: 1.5rem !important;\
  218. }\
  219. table.table-bordered.table-centered .prospector-row td div.required-items-container span.mr-3.ml-1 {\
  220. min-width: 2.5rem;\
  221. font-size: 1rem;\
  222. }\
  223. ';
  224. GM_addStyle(default_style);
  225. };
  226.  
  227. ETsmarTower.Init();