Press TAB to display a map for easier navigation.
As of
// ==UserScript==
// @name [Florr.io] Map Script (TAB)
// @namespace http://tampermonkey.net/
// @version 1.1
// @description Press TAB to display a map for easier navigation.
// @author You
// @match https://florr.io
// @icon https://cdn.discordapp.com/attachments/668939882416308274/1077628635575492688/Map_12_-_Feb_21.png
// @grant none
// @license
// ==/UserScript==
const styleSheet = `
#florrMap {
display:none;
position: absolute;
top: 50%;
left: 50%;
max-width: 100vw;
max-height: 100vh;
transform: translate(-50%, -50%);
opacity:1;
pointer-events: none;
}`
// border:20px solid #100b07;
// border-radius:40px;
// https://static.wikia.nocookie.net/official-florrio/images/a/a1/Yggdrasil_%28Mythic%29.png/revision/latest?cb=20221107121812
// https://cdn.discordapp.com/attachments/668939882416308274/1077628635575492688/Map_12_-_Feb_21.png
const img = document.createElement("img");
img.src = "https://cdn.discordapp.com/attachments/668939882416308274/1077628635575492688/Map_12_-_Feb_21.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}`;
}
};
});