Vols and Jezuzifier for GeoGuessr

Become just like user Vols and Jezuz by using their tweaks and style preferences

目前為 2025-04-24 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Vols and Jezuzifier for GeoGuessr
// @namespace    volsandjezuz
// @version      1.0.5
// @description  Become just like user Vols and Jezuz by using their tweaks and style preferences
// @author       Vols and Jezuz
// @license      MIT
// @match        https://www.geoguessr.com/*
// @grant        GM_addStyle
// @run-at       document-start
// ==/UserScript==

/* ------------------------------------ NOTES ------------------------------------
   Each tweak or style change is individually commented below.
   Ones that do not suit your taste can be independently removed or commented out.

   Credit to Alien Perfect for many of the CSS alterations.
   I highly recommend also using their 'Faster Minimap (Geoguessr)' userscript.
   However, their 'Better GUI (Geoguessr)' userscript will cause conflicts.
   The CSS alterations of the userscript which runs last will be enforced.
   The order of userscript execution can be changed in your userscript manager.
   ------------------------------------------------------------------------------- */

(function() {
  `use strict`;

  GM_addStyle(`
    /* Remove map opening and closing animations for snappier response. */
    [data-qa="guess-map"] {transition:opacity 0s ease,width 0s ease,height 0s ease !important}

    /* Make biggest map size a bit wider so that entire map is initially visible without panning. */
    [class*="guess-map_size4__"] {--active-width:80vw !important}

    /* Change second biggest map size to default size of biggest map (useful when the wider map blocks signs you want to keep visible while scanning). */
    [class*="guess-map_size3__"] {--active-width:65vw !important}

    /* Remove transparent red border that appears when an opponent guesses, which can alter perception of colors near the border. */
    [class*="stress-indicator_container__"] {display:none !important}

    /* Make new compass more transparent and slightly alter its color to match other GUI elements. */
    [class*="compassContainer"] {background-color:var(--ds-color-black-60) !important}

    /* Hide zoom controls since all scrolling is done with the mouse's scroll wheel. */
    [class*="styles_controlGroup__"] {display:none !important}
    [class*="guess-map_zoomControls__"] {display:none !important}

    /* On mouseover, make map pins transparent after a small wait so that map text hidden behind them can be read. */
    [class*="map-pin_mapPin"]:hover {opacity:.15; transition-delay:.4s}
    [class*="map-pin_clickable"]:hover {transition:0s ease; transition-delay:.4s}

    /* Add transparency to the GeoGuessr logo that is rendered in the upper left corner in Singleplayer rounds, to match other GUI elements. */
    [class*="game_inGameLogos__"] {opacity:.4 !important}

    /* Add transparency to the map status bar that is rendered in the upper right corner in Singleplayer rounds, to match other GUI elements. */
    [class*="slanted-wrapper_start__"] {opacity:.4 !important}
    [class*="slanted-wrapper_end__"] {opacity:.4 !important}

    /* Skip the 'Loading location...' animation that briefly plays at the start of each round in Singleplayer. */
    [class*="fullscreen-spinner"] {display:none !important}
  `);

  /* Redirect the Duels 'PLAY' button to the old UI (geoguessr.com/matchmaking), which has much better performance. */
  function redirectPlayButton() {
    if (location.pathname !== `/multiplayer`) {
      return;
    }

    let b = document.getElementsByClassName(`button_button__aR6_e button_variantPrimary__u3WzI`)[0];

    if (b && !b.dataset.clickListenerAdded) {
      b.addEventListener(`click`, function(event) {
        event.preventDefault();
        event.stopImmediatePropagation();
        window.location.href = `https://www.geoguessr.com/matchmaking`;
      }, true);

      b.dataset.clickListenerAdded = true;
    }
  }

  function startMutationObserver() {
    new MutationObserver(() => {
      redirectPlayButton();
    }).observe(document.body, { childList: true, subtree: true });

    redirectPlayButton();
  }

  if (document.body) {
    startMutationObserver();
  } else {
    document.addEventListener(`DOMContentLoaded`, () => {
      if (document.body) {
        startMutationObserver();
      }
    }, { once: true });
  }
})();