[Florr.io] Map Script (TAB)

Press TAB to display a map for easier navigation.

目前為 2023-02-20 提交的版本,檢視 最新版本

// ==UserScript==
// @name         [Florr.io] Map Script (TAB)
// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  Press TAB to display a map for easier navigation.
// @author       You
// @match        https://florr.io
// @icon         https://static.wikia.nocookie.net/official-florrio/images/a/a1/Yggdrasil_%28Mythic%29.png/revision/latest?cb=20221107121812
// @grant        none
// @license
// ==/UserScript==

const styleSheet = `
#florrMap {
    display:none;
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: 95vw;
    max-height: 95vh;
    transform: translate(-50%, -50%);
   	border:20px solid #100b07;
    border-radius:40px;
    opacity:1;
    pointer-events: none;
}`


const img = document.createElement("img");
img.src = "https://cdn.discordapp.com/attachments/668939882416308274/1077260992372809839/Map_11_-_Feb_20.png";
img.id = "florrMap";
document.body.appendChild(img);
let s = document.createElement('style');
s.type = "text/css";
s.innerHTML = styleSheet;
(document.head || document.documentElement).appendChild(s);

let mapOpen = false;
let opacity = 1;
window.addEventListener('load', function() {
  document.onkeydown = function(evt) {
    evt = evt || window.event;
    if (evt.keyCode == '9' && mapOpen === false) {
   	mapOpen = true;
    document.getElementById("florrMap").style.display = "inline";
    } else if (evt.keyCode == '9' && mapOpen === true) {
    mapOpen = false;
    document.getElementById("florrMap").style.display = "none";
    }

    if (evt.keyCode == 189 && opacity > 0.2) {
    opacity -= 0.1;
    document.getElementById("florrMap").style.opacity = `${opacity}`;
    }
    if (evt.keyCode == 187) {
    opacity += 0.1;
    document.getElementById("florrMap").style.opacity = `${opacity}`;
    }
  };
});

QingJ © 2025

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