Autohides playerlist on bullseye and add toggle icon to show it.

Click eye to show/hide bullseye playerlist(auto hidden by default)

目前为 2025-03-30 提交的版本。查看 最新版本

// ==UserScript==
// @name         Autohides playerlist on bullseye and add toggle icon to show it.
// @version      v0.0.21
// @description  Click eye to show/hide bullseye playerlist(auto hidden by default)
// @author       trausi
// @match        https://www.geoguessr.com/bullseye/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=geoguessr.com
// @license      none
// @grant        GM_xmlhttpRequest
// @namespace https://gf.qytechs.cn/users/1452061
// ==/UserScript==

const autohidden = true;


window.addEventListener('load', function () {
  const toggleBtn = document.createElement('button');
  toggleBtn.textContent = '👁'; // tiny eye emoji or you can use "≡" or "P"
  toggleBtn.title = 'Toggle Player List';


  Object.assign(toggleBtn.style, {
    position: 'absolute',
    top: '6px',
    right: '6px',
    padding: '2px 6px',
    fontSize: '12px',
    border: 'none',
    borderRadius: '4px',
    background: '#5b3b9d',
    color: '#fff',
    cursor: 'pointer',
    zIndex: 9999,
    opacity: 0.8
  });

  toggleBtn.addEventListener('mouseenter', () => {
    toggleBtn.style.opacity = 1;
  });
  toggleBtn.addEventListener('mouseleave', () => {
    toggleBtn.style.opacity = 0.8;
  });

  toggleBtn.addEventListener('click', () => {
    const playerList = document.querySelector('.game-panorama_playerList__tITUA');
    if (playerList) {
      playerList.style.display = (playerList.style.display === 'none') ? '' : 'none';
    }
  });
  setTimeout(() => {
    const targetDiv = document.querySelector('.slanted-wrapper_root__XmLse');
    if (targetDiv) {
      targetDiv.prepend(toggleBtn);
    }
    if (autohidden) {
      const playerList = document.querySelector('.game-panorama_playerList__tITUA');
      if (playerList) {
        playerList.style.display = (playerList.style.display === 'none') ? '' : 'none';
      }
    }
  }, 1000);
});



QingJ © 2025

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