NitroType - Native Mega-Text

Enlarges the native race text so only 1-2 words fit in the box at a time.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         NitroType - Native Mega-Text
// @namespace    http://tampermonkey.net/
// @version      23.0
// @description  Enlarges the native race text so only 1-2 words fit in the box at a time.
// @author       Electric
// @match        *://*.nitrotype.com/race
// @match        *://*.nitrotype.com/race/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    // 1. CSS to transform the existing game area
    const style = document.createElement('style');
    style.innerHTML = `
        /* Make the dashboard area taller to hold the massive text */
        .dash-copyContainer {
            height: 250px !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            overflow: hidden !important; /* Hide words that spill out */
            background: rgba(0,0,0,0.9) !important;
            border-radius: 15px;
            border: 2px solid #333;
        }

        /* The actual word container */
        .dash-copy {
            width: 100% !important;
            text-align: center !important;
            position: relative !important;
            top: 0 !important;
            left: 0 !important;
        }

        /* Make ALL words big, but the current one huge */
        .dash-word {
            font-size: 60px !important; /* Size of upcoming words */
            margin: 0 20px !important;
            transition: all 0.1s ease !important;
            opacity: 0.2 !important; /* Dim the others */
            display: inline-block !important;
        }

        /* THE CURRENT WORD: Massive, White, and Centered */
        .dash-word.is-current {
            font-size: 130px !important; /* Massive size */
            opacity: 1 !important; /* Full brightness */
            color: #ffffff !important;
            text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
            font-weight: 900 !important;
        }

        /* Hide the cursor which might flicker at this scale */
        .dash-cursor {
            display: none !important;
        }

        /* Hide ads and headers to keep the box centered */
        .race-header, .race-v3-ui-ads {
            display: none !important;
        }
    `;
    (document.head || document.documentElement).appendChild(style);

    // 2. Auto-scroll logic to keep the current word in the middle
    function centerCurrentWord() {
        const current = document.querySelector('.is-current');
        const container = document.querySelector('.dash-copyContainer');
        
        if (current && container) {
            // This ensures the current word stays within the visual frame
            current.scrollIntoView({ behavior: "smooth", block: "center", inline: "center" });
        }
    }

    // Run centering frequently to handle rapid bursts
    setInterval(centerCurrentWord, 50);

})();