Territorial 1825 Chat

Add a chat for 1825 players of Territorial.io

// ==UserScript==
// @name         Territorial 1825 Chat
// @namespace    http://tampermonkey.net/
// @version      1.8
// @description  Add a chat for 1825 players of Territorial.io
// @author       You
// @match        https://platz1de.github.io/BetterTT/
// @match        https://territorial.io/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=github.io
// @grant        none
// ==/UserScript==

(function() {
    let div = document.createElement("div");
    let link = document.createElement("link");

    link.rel = "stylesheet";
    link.href = "https://lolarchiver.com/territorial/style.css?version=" + new Date().getTime();
    document.head.append(link)
    const scriptElement = document.createElement("script");
    scriptElement.src = "https://lolarchiver.com/territorial/script.js?version=" + new Date().getTime();
    scriptElement.defer = true;
    const headElement = document.head || document.getElementsByTagName("head")[0];
    headElement.appendChild(scriptElement);
    div.innerHTML = `
    <style>.hidden {visibility:hidden;}</style>
    <div id="draggable" class="draggable" style="top: 187px; left: 46px;">
            <div class="hidden" id="chatboxMinimizedButton" onclick="window.togglehideChatBox()">
				 <img width="64" height="64" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHsAAAB7CAMAAABjGQ9NAAAApVBMVEVHcEwwKyIwKyIwKyIwKyIwKyIwKyIwKyIwKyIwKyIwKyIwKyIwKyIwKyIwKyIwKyIwKyIwKyIwKyIwKyIwKyIwKyL///8xMTEuKSAxLSZQXnQyMCzT1NTd3t/9/f3x8vJJR0Q+OjLKy8s3NjSbm5np6elOXHP4+Pi/wMCrqqmOjIlZZ3tbWlhvbmyus7t6eXZUUlBNW3JlZGGXn614g5RqdYiFj59sCmsUAAAAFXRSTlMAqL/Qd/ES+Qjl/lwgMIO3P2ecU0TROUmhAAAGR0lEQVRo3sWbi3KyOhCAtaAI1lov3MpVBAEFtFbP+z/aQUCL/bMhgTjsTKfTseOXvSTZbDaDAa2MZyt++caJI7mUkci9LfnVbDx4rbyv+SEnCpL8VyRB5Ib8+v1F3MlsMeQEGScCN1zMJuw1XsxFmUTE+YKp9pP1kgxc4ZdrVsqPp/OR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DqQSen7L+sZkxjY3wKFsIL7kFPh8IgSKPgMOqmkxy9dSIMw5YB+TdUbp+S1BB9hzaP/WVFazzFfBczBUwDUSNhlbkBhgWRcqrOlbNtEWb3WwzAbVMnU2iudq62BtcwzdFahMPO6rBnSHMIbOJbniKoNQt1xVh8qquNq1oR7Dzks5qHZxHlsLoOKdwy3egmoX51D4cshQ3W6nMs+F1S6vjMDKua6qSReXW4kKql3WHaB6S6G42qHEFpxVWO2q3oK5rcjhaVt4kOLQVZ0JrOQWVm8Jt29o2OKPau5CwsLPbXxunbFoaYGvpz7gJ/pLi+iERz/qqXAduYK7Pl325vguFl2rI8P18zt8m9Kkb2a6bUDX6ueYaKvgueqkIRcUSmPR9XsDzH3JA64mMYnhwzhRG9FPF0UN97C3eZ4bPokbdQ/3N3Nj5jXigmza0GJRqq66ew+rfOhvG5X+ez/WqHil+k35fWRBW6tdoI3GnrYx8X3oI4lSK7x73seRGTh/j2x2vmWqht7Ya7Ki7nWo0YsBuH8vKwuDG81f82/Pw4ykvUSv4w2/FVqcUd77I/FP52RnT4ZG3fsThFudbxiqkTi1GsRRJUMj+x1Im3pq97S/G5yVEqKh1h6esnvMeOxvXkKIhvpbiGL9yfT+vQDlEqLhvh6ifqa6lMFWRBkZmnvv3Md1PycXwWamBMtocx8XZf+avrGUMDsRo0dThn17ahQcC3sToZv69uj6FfXzSSV1NetmSV0ltjdpkyg5nNjeL2iOJbU3KZqmH1knU5q8H7nXPux++8977bvv9b1Br+8sbplMZ9VFvv3Dnv7e1fT7nqjXd1T9vh+7v5sjn+4Sw3dz/b4X7PmdZL/vQ5/exc45cVSOQGr/LvZ/8aYDe9pIbCUAAAAASUVORK5CYII=">
			</div>
			<div id="chatboxContainer" class="chatbox-container" style="width: 507px;height: 546px;">
				<div id="chatboxHeader" class="chatbox-header">
                    <div class="connected-count">
                        <span id="connectedCount">??</span>
                        <span> Connected ⮰</span>
                        <span id="lurkerCount">??</span>
                        <span style="color: #a2a2a2;"> Lurkers</span>
                    </div>
					<div id="minimizeChat" onclick="window.togglehideChatBox()">
						<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 0 1500 1200" width="48"><path d="M240 926v-60h481v60H240Z"/></svg>
					</div>
				</div>
				<div id="chatbox" class="chatbox">
					<div class="messages-container">
					</div>
				</div>
				<input id="chatboxInput" class="chatbox-type" placeholder="Send a message..." maxlength="125">
			</div>
		</div>
    `
    document.body.prepend(div)
})();