// ==UserScript== // @name Digdig.IO Server Selector // @namespace http://tampermonkey.net/ // @version 0.1.1 // @description try to take over the world! // @author Zertalious (Zert) // @match *://digdig.io/* // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant unsafeWindow // @grant GM_addStyle // @grant GM_setValue // @grant GM_getValue // @downloadURL none // ==/UserScript== GM_addStyle(` .container { width: 100%; height: 100%; position: fixed; top: 0; left: 0; pointer-events: none; user-select: none; } .active { pointer-events: auto; } .btn, .modalUI { background: #aeaeae; color: #fff; font-size: 14px; font-family: Ubuntu; border: 4px solid #8f8f8f; border-radius: 6px; pointer-events: auto; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; } .btn { position: absolute; right: 10px; bottom: 10px; padding: 5px 15px; cursor: pointer; outline: 0; transition: 0.2s; } .btn-active { transform: translate(0, 0); } .container:not(.active) .btn:hover { background: #c7c7c7; } .active .btn { background: #c7c7c7; } .modalUI { position: absolute; bottom: 55px; right: 6px; padding: 10px; width: 300px; max-height: 400px; transition: 0.2s; transform: translate(0, calc(100% + 55px)); overflow: auto; } .active .modalUI { transform: translate(0, 0); } .modalUI-title { font-size: 1.6em; text-align: center; margin-top: 0; } .modalUI-close-btn { position: absolute; right: 5px; top: 7px; width: 24px; height: 24px; border-radius: 4px; background: #bb5555; border: 4px solid #974545; cursor: pointer; outline: 0; } .modalUI-close-btn:hover { background: #da6868; } .modalUI-close-btn:after, .modalUI-close-btn:before { content: ""; position: absolute; left: 51%; top: 52.5%; width: 3px; height: 100%; background: #cccccc; border-radius: 4px; } .modalUI-close-btn:after { transform: translate(-50%, -50%) rotate(45deg); } .modalUI-close-btn:before { transform: translate(-50%, -50%) rotate(-45deg); } .modalUI-element { background: rgba(0, 0, 0, 0.2); padding: 10px; border-radius: 5px; margin-bottom: 5px; cursor: pointer; } .modalUI-element:last-child { margin-bottom: 0; } .modalUI-element-active { box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.2); } .modalUI-loader { display: flex; flex-direction: column; align-items: center; padding: 10px; } .spinner { width: 40px; height: 40px; border: 10px solid rgba(0, 0, 0, 0.5); border-top-color: rgba(0, 0, 0, 0.8); border-radius: 50%; animation: spin 0.5s infinite; } .spinner-text { margin-top: 5px; font-size: 1.25em; } .modalUI-info { position: absolute; right: 30px; top: 6px; font-size: 1.20em; padding: 4px 5px; } .modalUI-info:hover .modalUI-info-content { opacity: 1; pointer-events: inherit; } .modalUI-info-content { position: absolute; bottom: 170%; right: 0; background: rgba(0, 0, 0, 0.4); border-radius: 4px; opacity: 0; padding: 8px; font-size: 0.85rem; width: 450px; transition: 0.2s; pointer-events: none; display: flex; flex-direction: row; } .modalUI-info-title { margin: 0; margin-bottom: 5px; font-size: 1.40rem; } .version-label { font-size: 0.75em; text-align: right; } .divider { width: 3px; background: rgba(0, 0, 0, 0.3); border-radius: 5px; margin: 0 10px; } .modalUI-info-content > div:not(.divider) { flex: 1; } @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } `); (async function() { const html = `