NitroType - Native Mega-Text

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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);

})();