Open HugoBarjot opened 2 years ago
edit : i notice i need to do a reload after each round so that it work well currently, need some adjustment yet :)
That looks good, but I wanted the map to close only when pressing the mouse button on the canvas, do you want to make a competing script because I think players may like your script as an alternative option.
ah okay in that case work intented then 👍 competing ? what do you mean :)
yeah, i try make it really reactive open and close at mouseover, i feel there is a delay to close the map bit useless in the game 👍
i fix the issue to make it works without any reload, i put a function loop into a function loop, not sure that's the best way to do but work 👍
`// ==UserScript== // @name Geoguessr fastermap opener/closer // @namespace geoguessr user scripts // @version 1.0 // @description Open and Close the minimap on mouseover and mouseleave in a faster way ! // @author Base work from echandler / Edit from HugoBarjot // @match https://www.geoguessr.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=geoguessr.com // @grant none // ==/UserScript==
setInterval(() => { const url = location.href; if (url.startsWith("https://www.geoguessr.com/game/") || url.startsWith("https://www.geoguessr.com/battle-royale/")|| url.startsWith("https://www.geoguessr.com/duels/")|| url.startsWith("https://www.geoguessr.com/team-duels/")|| url.startsWith("https://www.geoguessr.com/challenge/")|| url.startsWith("https://www.geoguessr.com/live-challenge/")) { (function () { "use strict";
let int = setInterval(() => { let sticky_element = document.querySelector(".guess-map__control--sticky"); let map = document.body.querySelectorAll(".guess-map"); clearInterval(int); map.forEach((canvas) => { canvas.addEventListener("mouseleave", function (e) { if ( sticky_element.matches(".guess-map__control--sticky-active") === true ) { document .querySelector(".guess-map") .classList.add("guess-map--active"); } else { document .querySelector(".guess-map") .classList.remove("guess-map--active"); } }); }); map.forEach((canvas) => { canvas.addEventListener("mouseover", function (e) { document.querySelector(".guess-map").classList.add("guess-map--active"); }); }); }, 1000); })(); } }, 500);
`
Hello, It was not working well i found for me, so i make a other version so that it be really reactive on mouseover and on mouseleave on the minimap, i did this code below using your work base :)
image below :
code below : // ==UserScript== // @name Geoguess better map closer. // @namespace geoguessr user scripts // @version 1.0 // @description Better map closer. // @author echandler / HugoBarjot // @match https://www.geoguessr.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=geoguessr.com // @updateURL https://github.com/echandler/Geoguessr-better-guess-map-closer/raw/main/GeoguessrBetterGuessMapCloser.user.js // @grant none // ==/UserScript==
(function () { "use strict";
})();