TyperacerPlus

自動スクロールを追加等

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         TyperacerPlus
// @namespace    http://tampermonkey.net/
// @version      0.1.1
// @description  自動スクロールを追加等
// @author       You
// @match        https://play.typeracer.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=typeracer.com
// @license MIT
// @resource   Font https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400&display=swap
// @grant      GM_addStyle
// @grant      GM_getResourceText
// ==/UserScript==

GM_addStyle(GM_getResourceText("Font"));
//フォントを使えるようにする呪文

function main(){
    let form;
    let keydownEvent;
    let T;
    let InputtingText;
    let addScrollFlg = false;
    function EventFuc(){
        keydownEvent = function(e){
            if(e.code == 'Space'){
                InputtingText = document.querySelectorAll('span[unselectable="on"]')[1];
                InputtingText.scrollIntoView({
                    behavior : "smooth", //instant , smooth
                    block : "center"
                });
            };
        };
    form.addEventListener('keydown',keydownEvent);
    };

    setInterval(()=>{
        form = document.querySelector('.txtInput');
        T = document.querySelectorAll('span[unselectable="on"]')[1];
        if(form && T){
            if(!addScrollFlg){
            addScrollFlg = true;
            EventFuc();
            console.log("イベント追加")
            };
        }else if(addScrollFlg){
            if(!T || !form){
                form.removeEventListener('keydown',keydownEvent);
                console.log("イベント削除")
                addScrollFlg = false;
            };
        };
    },3000);
};

setTimeout(main,2000);

/*ここからスタイル*/

const coutdownPopupStyleCSS = `<style>
    body > div.countdownPopup.horizontalCountdownPopup{
        transform: scale(0.5) !important;
        position: fixed !important;
        left: 70vw !important;
        top: 0vh !important;
        visibility: visible !important;
        clip: rect(auto, auto, auto, auto) !important;
        overflow: visible !important;
    }
    </style>`;

const inputAreaStyleCSS = `<style>
    .txtInput{
        position : fixed !important;
        bottom : 30vh !important;
        z-index : 10 !important;
        width : 90vw !important;
        font-size : 24px !important;
    }
    </style>`;

const mainStyle = `<style>
    *{
        font-family : 'Noto Sans', sans-serif !important;
    }
    .mainViewport table.inputPanel table div span{
        font-size : 24px !important;
    }
    </style>`;


document.body.parentElement.insertAdjacentHTML('beforeend',mainStyle);
//フォント関係変更
document.body.parentElement.insertAdjacentHTML("beforeend",coutdownPopupStyleCSS);
//カウントダウンのスタイル変更
document.body.insertAdjacentHTML("beforeend",inputAreaStyleCSS);
//入力エリアのスタイル