GeoGuessr Ultimate Script

GeoGuessr Ultimate Script - One Script to rule them all - Work In Progress - Adding features over time - Removes Bottom, Right and Top Bar (Options) - Pimps Data - Makes for a cleaner experience - Removes Author (Optinal - For an extra challenge) - Changes flags with numbered flags - Adjust GeoGuessr Logo position - Adjusts Data position

// ==UserScript==
// @name             GeoGuessr Ultimate Script
// @version          0.4.4
// @description      GeoGuessr Ultimate Script - One Script to rule them all - Work In Progress - Adding features over time - Removes Bottom, Right and Top Bar (Options) - Pimps Data - Makes for a cleaner experience - Removes Author (Optinal - For an extra challenge) - Changes flags with numbered flags - Adjust GeoGuessr Logo position - Adjusts Data position
// @author           MrAmericanMike
// @include          /^(https?)?(\:)?(\/\/)?([^\/]*\.)?geoguessr\.com($|\/.*)/
// @grant            none
// @run-at           document-start
// @namespace        https://greasyfork.org/en/scripts/406060-geoguessr-ultimate-script
// ==/UserScript==

(function() {
"use strict";
console.log("GeoGuessrUltimateScript");

// MODULES // Set from 'true' to 'false' any module that you don't need. Example: removeTopBar = false;

// REMOVE BOTTOM WHITE BAR WHILE PLAYING A MAP
let removeBottomBar = true;

// REMOVE RIGHT WHITE BAR ON ROUND RESULTS SCREEN
let removeRightBar = true;

// MAKE A CLEANER STREETVIEW BY REMOVING TOP BAR
let removeTopBar = true;

// REPLACE FLAGS AT THE END OF A GAME WITH NUMBERED FLAGS
let replaceFlags = true;

// MAKE FLAGS AND PINS TRANSPARENT ON MOUSE OVER
let transparentPins = true;

// PIMP MY DATA
let pimpData = true;

let floatData = "RIGHT";                         // Where to place the logo on screen (Valid options "LEFT" "RIGHT")

let dataMargin = "0.5rem";                      // Horizontal margin from the side of the window [default value is "2.0rem"] (https://www.w3schools.com/cssref/css_units.asp)
let topMargin  = "0.5rem";                      // Vertical margin from top of the window [default value is "1.0rem"] (https://www.w3schools.com/cssref/css_units.asp)

let bgColor     = "rgba(255, 255, 255, 0.55)";  // RGBA COLOR (https://www.hexcolortool.com/)
let titlesColor = "#000033";                    // Titles color on the data panel in HEX
let dataColor   = "#660000";                    // Data color on the data panel in HEX

// GEOGUESSR LOGO
let adjustLogo = true;

let floatLogo     = "LEFT";      // Where to place the logo on screen (Valid options "LEFT" "CENTER" "RIGHT")
let logoTopMargin = "0.25rem";   // Margin from top of the window (https://www.w3schools.com/cssref/css_units.asp)
let logoOpacity   = "0.5";		 // Value going from 0.0 to 1.0 (0.0 represents fully transparent)

// HIDE FOOTPRINT - (This is where photospheres author would show)
let hideFootprint = true;

// HIDE COMPASS - (For an extra challenge)
let hideCompass = true;

// HIDE FLAG - (Hide the "Back to start flag" - For an extra challenge)
let hideFlag = false;

// HIDE FULLSCREEN - (For those that don't need this button)
let hideFullscreen = true;

// HIDE ZOOM - (Hide the zoom controls)
let hideZoom = true;

// HIDE TOOLTIPS - (Hide the tooltips for flag, fullscreen and zoom controls)
// Hiding an element does not hide the tooltip, so recommended leave this true
let hideTooltips = true;


// *******************************
// NO NEED TO EDIT BELOW THIS LINE
// *******************************





















// DEBUG
let debug = true;

// IMAGES
const IMAGES = [
    'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAC4jAAAuIwF4pT92AAACjUlEQVR4nO2aT4hNURzHf1cTMVn4GzWUkoWUhVIsxIYVg7KwEaYGpZCkKItBzZQkSixkMjUkCxaKrSxYyv8/G2IhiiQl8XyOc5n7NPPc7n3nfa/mfOrTu2+65/1+9/vuPfe9M6+tVqvZaKZN3YCaGIC6ATUxAHUDamIA6gbUxADUDaiJAagbUBMDUDegJnQAy3ErLsYJ+Biv4wB+CFw7F6UC4Kv0dh5WpU/PJklyI92e6Z7j6r+GzMKVeARPY5+Jgyh7BizEten2zfRxGV7BaQ3GTcT92I3H8CR+LlB/DP4oMO4PIS6Bfmt88Fkm4VHchcfNnzUfc46dj+vNn02FCRFAUmDMdOzFg3jRfIh3bfh3dzxuw8M4WKzFIap2F3CXRnfqe7yFT/Cd+Ul0gfk5Z3KzClYtgCxTzZ/iQalyAC0hBq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G9BWCEDbgLZ6fQB/AYF2gh8Ua2M5AAAAAElFTkSuQmCC'
];

setTimeout(executeRealTime, 5);
setTimeout(executeRealTime, 150);
setTimeout(executeRealTime, 300);
setTimeout(executeRealTime, 600);
setTimeout(executeRealTime, 900);
setTimeout(executeRealTime, 1200);
setTimeout(executeRealTime, 1500);

// REAL TIME
function executeRealTime(){
    if(removeBottomBar){
        doRemoveBottomBar();
    }
    if(removeRightBar){
        doRemoveRightBar();
    }
    if(removeTopBar){
        doRemoveTopBar();
    }
    if(adjustLogo){
        doAdjustLogo();
    }
}


if(pimpData){
    doPimpData();
}
if(hideFootprint){
    doHideFootprint();
}
if(hideCompass){
    doHideCompass();
}
if(hideFlag){
    doHideFlag();
}
if(hideFullscreen){
    doHideFullscreen();
}
if(hideZoom){
    doHideZoom();
}
if(hideTooltips){
    doHideTooltips();
}

if(replaceFlags){
    setTimeout(changeFlags, 1500);
    setTimeout(changeFlags, 750);        
    setTimeout(changeFlags, 600);
    setTimeout(changeFlags, 450);
    setTimeout(changeFlags, 250);
    setTimeout(changeFlags, 50);
    document.addEventListener('mouseup', (event) => {
        setTimeout(changeFlags, 750);        
        setTimeout(changeFlags, 600);
        setTimeout(changeFlags, 450);
        setTimeout(changeFlags, 250);
        setTimeout(changeFlags, 50);
    });
}

if(transparentPins){
    setTimeout(makePinsTransparent, 1500);
    setTimeout(makePinsTransparent, 750);
    setTimeout(makePinsTransparent, 600);
    setTimeout(makePinsTransparent, 450);
    setTimeout(makePinsTransparent, 250);
    setTimeout(makePinsTransparent, 50);
    document.addEventListener('mouseup', (event) => {
        setTimeout(makePinsTransparent, 750);
        setTimeout(makePinsTransparent, 600);
        setTimeout(makePinsTransparent, 450);
        setTimeout(makePinsTransparent, 250);
        setTimeout(makePinsTransparent, 50);
    });
}

// BOTTOM BAR
function doRemoveBottomBar(){
    addGlobalStyle(`
        .game-layout__in-game-ad {
            display: none;
        }
    `);
}

// RIGHT BAR
function doRemoveRightBar(){
    addGlobalStyle(`
        .result__right {
            display: none;
        }
    `);
}

// TOP BAR
function doRemoveTopBar(){
    if(window.location.pathname.includes("game") || window.location.pathname.includes("challenge")){
        addGlobalStyle(`
            .layout {
                --layout-header-height: 0rem;
            }
            .header__right{
                display: none;
            }
            .game-layout__panorama-canvas{
                height: 100%;
            }
        `);
    }
    else{
        addGlobalStyle(`
            .layout {
                --layout-header-height: 3rem;
            }
            .header__right{
                display: block;
            }
        `);
    }
}

// DATA
function doPimpData(){

    switch(floatData){
        case "LEFT":
            addGlobalStyle(`
                .game-layout__status{
                    top: ${topMargin};
                    left: ${dataMargin};
                    right: auto;
                }
            `);
            break;

        case "RIGHT":
            addGlobalStyle(`
                .game-layout__status{
                    top: ${topMargin};
                    right: ${dataMargin};
                    left: auto;
                }
            `);
            break;

        default:
            break;
    }

    addGlobalStyle(`
        .game-statuses {
            background: ${bgColor};
        }
        .game-status__heading{
            color: ${titlesColor};
        }
        .game-status__body{
            color: ${dataColor};
        }
    `);
}

// FOOTPRINT
function doHideFootprint(){
    addGlobalStyle(`
        .gmnoprint, .gm-style-cc{
            display: none;
        }
    `);
}

// COMPASS
function doHideCompass(){
    addGlobalStyle(`
        .compass{
            display: none;
        }
    `);
}

// FLAG
function doHideFlag(){
    addGlobalStyle(`
        [data-qa="return-to-start"]{
            display: none;
        }
    `);
}

// FULLSCREEN
function doHideFullscreen(){
    addGlobalStyle(`
        [data-qa="enter-fullscreen"]{
            display: none;
        }
    `);
}

// ZOOM
function doHideZoom(){
    addGlobalStyle(`
        [data-qa="pano-zoom-in"]{
            display: none;
        }
        [data-qa="pano-zoom-out"]{
            display: none;
        }
    `);
}

// HIDE TOOLTIPS
function doHideTooltips(){
    addGlobalStyle(`
        .tooltip__label{
            display: none;
        }
    `);
}

// GEOGUESSR LOGO
function doAdjustLogo(){
    if(window.location.pathname.includes("game") || window.location.pathname.includes("challenge")){
    switch(floatLogo){
        case "LEFT":
        addGlobalStyle(`
            .header__left{
                margin-left: 0;
            }
        `);
        break;

        case "CENTER":
        addGlobalStyle(`
            .header__left{
                margin-left: auto;
            }
        `);
        break;

        case "RIGHT":
        addGlobalStyle(`
            .header__left{
                margin-left: auto;
                margin-right: 0;
            }
        `);
        break;
    }

    addGlobalStyle(`
        .header__logo{
            margin-top: ${logoTopMargin};
            opacity: ${logoOpacity};
        }
    `);
    }
    else{
    addGlobalStyle(`
        .header__left{
            margin-left: 0;
        }
        .header__logo{
            margin-top: auto;
            opacity: 1;
        }
        `);
    }
}

// CHANGE FLAGS
function changeFlags(){
    let flags = document.getElementsByClassName("pin__image");
    if (flags.length >= 5) {
        Array.prototype.forEach.call(flags, (img, n) => {
            img.src = IMAGES[n];
        });
    }
    else if(flags){
        Array.prototype.forEach.call(flags, (img, n) => {
            img.src = "https://www.geoguessr.com/_next/static/images/correct-location-5bdcd0a4eabbbb9e42feb5c54e54f4a1.png";
        });      
    }
}

// TRANSPARENT FLAGS
function makePinsTransparent(){
    let pins = document.getElementsByClassName("map-pin");
    Array.prototype.forEach.call(pins, (pin, n) => {
        pin.addEventListener("mouseover", () => {
            pin.style.opacity = 0.25;
        });
        pin.addEventListener("mouseout", () => {
            pin.style.opacity = 1;
        });
    });
}

// GLOBAL STYLES INJECTOR
function addGlobalStyle(css) {
    let head;
    let style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css.replace(/;/g, ' !important;');
    head.appendChild(style);
}

// LISTEN FOR PAGE CHANGES
let currentTab = "";
let oldTab = "";

window.addEventListener("click", (event) => {    
    for (let x = 0; x < 1250; x+=250){
        setTimeout(() => {
            lookForURLChange(event);
        }, x);
    }
});

function lookForURLChange(event) {
    if(event.explicitOriginalTarget){
        currentTab = event.explicitOriginalTarget.baseURI;
    }
  	else if(event.path){
        event.path.forEach((element) => {
            if(element.hasOwnProperty("URL") && element.hasOwnProperty("location")){
                currentTab = element.location.pathname;
            }
        });
    }

    if(oldTab != currentTab){
        oldTab = currentTab;
        setTimeout(executeRealTime, 0);
    }
}

function myLog(data) {
    if(debug){
        console.log(data);
    }
}

})();