Geoguessr custom status bar and compass

Customize the color palette and fonts in the status bar from classic games and the compass image

  1. // ==UserScript==
  2. // @name Geoguessr custom status bar and compass
  3. // @version 1.0.2
  4. // @description Customize the color palette and fonts in the status bar from classic games and the compass image
  5. // @match https://www.geoguessr.com/*
  6. // @author victheturtle#5159
  7. // @license MIT
  8. // @namespace https://gf.qytechs.cn/users/967692-victheturtle
  9. // ==/UserScript==
  10.  
  11. // DEFINE YOUR GRADIENT OF COLORS FOR THE STATUS BAR BACKGROUND HERE
  12. const gradient = `
  13. #D22F2FBF 0%,
  14. #FD6E00BF 20%,
  15. #FEEE60BF 40%,
  16. #4BAD4FBF 60%,
  17. #1975D0BF 80%,
  18. #8E26AABF 100%
  19. `;
  20. // The format for colors is #rrggbbaa: red (between 00 and ff), green (between 00 and ff), blue (between 00 and ff),
  21. // opacity (00 = transparent, ff = opaque, defaults to ff if you don't write it)
  22. // If you have no idea how your favourite color is written in hex, go there: https://redketchup.io/color-picker
  23. // Percentages are from top (0%) to bottom (100%) of the progress bar.
  24. // So the color written with 0% is going to be the color at the top of the progress bar.
  25. // You can add (and remove) any number of intermediate percentages, just don't forget the coma between the lines
  26. // If you want just one color (not a gradient) you can just set the same color for both 0% and 100% and remove everything else
  27.  
  28. // COLOR OF THE "MAP", "ROUND", "SCORE"... LABELS
  29. const labelColor = `#8E26AABF`;
  30.  
  31. // COLOR OF THE OTHER TEXTS (name of the map, 1/5...)
  32. const valueColor = `#FFFFFFFF`;
  33.  
  34. // FONTS FOR THESE TEXTS
  35. const fonts = ``;
  36. // example:
  37. // const fonts = `"Comic Sans MS", "Comic Sans"`;
  38. // const fonts = ``; for keeping geoguessr's default
  39.  
  40. // COMPASS IMAGE: not necessarily an SVG, can also be a PNG etc
  41. const compassImageLink = `https://www.geoguessr.com/_next/static/images/compass-4be6c2fc7875215e0ece8a0f358585aa.svg`
  42. // geoguessr default: https://www.geoguessr.com/_next/static/images/compass-4be6c2fc7875215e0ece8a0f358585aa.svg
  43.  
  44. // COMPASS BACKGROUND IMAGE if you also want to replace the circle
  45. const compassBackground = `null`
  46. // null to go back to the geoguessr default (the circle)
  47.  
  48. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  49.  
  50.  
  51.  
  52. var style = document.createElement("style");
  53. document.head.appendChild(style);
  54. style.sheet.insertRule(`div[class*='slanted-wrapper_variantPurple__'] { --variant-background-color: linear-gradient(180deg, ${gradient});}`);
  55. style.sheet.insertRule(`div[class*='status_label__'] { color: ${labelColor}; font-family: ${fonts}, neo-sans, sans-serif }`);
  56. style.sheet.insertRule(`div[class*='status_value__'] { color: ${valueColor}; font-family: ${fonts}, neo-sans, sans-serif }`);
  57. style.sheet.insertRule(`.compass__indicator { height: 3rem; width: 3rem; left: 0%; position: absolute; top: calc(50% - 1.5rem); object-fit: contain; }`);
  58.  
  59.  
  60. function handleMutations() {
  61. const compass = document.querySelector(".compass__indicator");
  62. if (!!compass) {
  63. compass.src = compassImageLink;
  64. if (compassBackground != null && compassBackground != "null" && compass.parentNode.childElementCount == 2) {
  65. const bg = document.createElement("div");
  66. bg.innerHTML = `<img src=${compassBackground} style="height: 3rem; width: 3rem; left: 0%; position: absolute; top: calc(50% - 1.5rem); object-fit: contain;">`;
  67. compass.parentNode.insertBefore(bg, compass);
  68. compass.parentNode.children[0].style.opacity = "0%";
  69. }
  70. }
  71. }
  72.  
  73. new MutationObserver((mutations) => handleMutations()).observe(__next, { subtree: true, childList: true});

QingJ © 2025

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