IP Dounford Scripts Styles

Centralize IP Dounford Styles

目前为 2024-08-31 提交的版本。查看 最新版本

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/506089/1438897/IP%20Dounford%20Scripts%20Styles.js

  1. // ==UserScript==
  2. // @name IP Dounford Scripts Styles
  3. // @version 1.0.1
  4. // @description Centralize IP Dounford Styles
  5. // @author Dounford
  6. // @license MIT
  7. // @match *://idle-pixel.com/login/play*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. function isNewerVersion () {
  14. const oldParts = document.getElementById('dounfordStyles').getAttribute('version').split('.')
  15. const newParts = GM_info.script.version.split('.')
  16. for (let i = 0; i < newParts.length; i++) {
  17. const a = ~~newParts[i]
  18. const b = ~~oldParts[i]
  19. if (a > b) return true
  20. if (a < b) return false
  21. }
  22. return false
  23. }
  24.  
  25. (function addStyles() {
  26. let style = document.createElement('style');
  27. style.id = "dounfordStyles"
  28. style.setAttribute('version', GM_info.script.version)
  29. const styleHTML = `
  30. /* Modal Style */
  31. dialog::backdrop {
  32. background-color: rgba(0, 0, 0, 0.855);
  33. }
  34. .dounfordModal {
  35. padding: 0;
  36. width: 600px;
  37. background-color: #e5e5e5;
  38. border-radius: 0.5rem;
  39. overflow: hidden;
  40. }
  41. .dounfordModal label {
  42. margin-left: 5px;
  43. }
  44. .dounfordModalHeader {
  45. display: flex;
  46. align-items: center;
  47. justify-content: space-between;
  48. padding: 1rem;
  49. border-bottom: 1px solid #ccc;
  50. }
  51. .dounfordModalBody {
  52. padding: 1rem;
  53. text-align: center;
  54. }
  55. .dounfordModalFooter {
  56. display: flex;
  57. align-items: center;
  58. justify-content: flex-end;
  59. padding: 0.75rem;
  60. border-top: 1px solid #ccc;
  61. }
  62. .dounfordModalFooter > * {
  63. margin: 0.25rem;
  64. }
  65. /* Blocked User Modal */
  66. .blockedUser {
  67. display: flex;
  68. justify-content: space-between;
  69. padding: 10px;
  70. border-radius: 10px;
  71. font-weight: bold;
  72. align-items: center;
  73. }
  74.  
  75. .blockedUser:hover {
  76. background-color: aliceblue;
  77. }
  78. /* Tooltips*/
  79. [dounfordTooltip] {
  80. position: relative;
  81. border-bottom: 1px dashed #000;
  82. }
  83.  
  84. [dounfordTooltip]::after {
  85. position: absolute;
  86. z-index: 10;
  87. opacity: 0;
  88. pointer-events: none;
  89. content: attr(dounfordTooltip);
  90. left: 0;
  91. top: calc(100% + 10px);
  92. border-radius: 3px;
  93. box-shadow: 0 0 5px 2px rgba(100, 100, 100, 0.6);
  94. background-color: white;
  95. padding: 5px;
  96. width: 150px;
  97. }
  98.  
  99. [dounfordTooltip]:hover::after {
  100. opacity: 1;
  101. }`;
  102.  
  103. if (document.getElementById('dounfordStyles')) {
  104. if (!isNewerVersion()) return
  105. document.getElementById('dounfordStyles').innerHTML = styleHTML
  106. document.getElementById('dounfordStyles').setAttribute('version', GM_info.script.version)
  107. } else {
  108. style.innerHTML = styleHTML
  109. document.head.appendChild(style);
  110. }
  111. })()
  112. })()

QingJ © 2025

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