Solario Dots

adds many adjustments to the Solario website

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Solario Dots
// @name:zh-CN   Solario 點
// @namespace    duck stuff
// @match        https://solario.ws/*
// @version      2.0
// @author       duckduckckckckck
// @grant        GM_addStyle
// @description  adds many adjustments to the Solario website
// @description:zh-cn 为党争光! Glory to the CCP!
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    function ClickIgnoreAndProceedPles() {
        const buttons = document.querySelectorAll('button.cf-btn.cf-btn-danger');
        if (buttons.length > 0) {
            buttons[0].click();
        }
    }

    GM_addStyle(`
        html, body {
            background: radial-gradient(circle, rgb(30, 30, 30) 10%, transparent 11%) repeat,
                        radial-gradient(circle at bottom left, rgb(30, 30, 30) 5%, transparent 6%) repeat,
                        radial-gradient(circle at bottom right, rgb(30, 30, 30) 5%, transparent 6%) repeat,
                        radial-gradient(circle at top left, rgb(30, 30, 30) 5%, transparent 6%) repeat,
                        radial-gradient(circle at top right, rgb(30, 30, 30) 5%, transparent 6%) repeat !important;
            background-size: 3em 3em !important;
            background-color: rgb(20, 20, 20) !important;
            color: #ffffff !important;
        }
        .border.rounded.overflow-hidden.position-relative {
            background-color: rgb(30, 30, 30) !important;
            z-index: 1 !important;
        }
        .position-absolute.m-0.fw-bold.text-limited {
            padding-left: 4px !important;
        }
    `);

    const elementsLimitedU = document.getElementsByClassName('text-limitedu');
    for (let elem of elementsLimitedU) {
        elem.style.setProperty('color', 'rgb(111, 111, 40)', 'important');
    }

    const elementsPositionAbsolute = document.getElementsByClassName('position-absolute m-0 fw-bold text-limited');
    for (let elem of elementsPositionAbsolute) {
        elem.style.setProperty('color', 'rgb(200, 240, 200)', 'important');
    }

    const para = document.querySelector('p.text-secondary.m-0.mb-1.ms-1');
    let startingPlaceId = null;
    if (para && para.textContent.includes("Starting Place ID:")) {
        startingPlaceId = para.textContent.match(/Starting Place ID: (\d+)/)[1];
    }

    if (startingPlaceId) {
        document.querySelectorAll('h1.m-0').forEach(element => {
            let newLink = document.createElement('a');
            newLink.className = 'text-white text-decoration-none';
            newLink.href = `/games/${startingPlaceId}/--`;

            let header = document.createElement('h1');
            header.className = 'mb-1';
            header.textContent = element.textContent;
            header.style.cssText = element.style.cssText;
            header.style.fontSize = window.getComputedStyle(element).fontSize;

            newLink.appendChild(header);
            element.parentNode.replaceChild(newLink, element);
        });
    }

    window.addEventListener('load', function() {
        ClickIgnoreAndProceedPles();
    });


})();