Early TurboBuilder

Get TurboBuilder extension early.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Early TurboBuilder
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Get TurboBuilder extension early.
// @author       oc9x97
// @match        https://studio.penguinmod.com/editor.html
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Function to remove the specified element
    function removeElement(selector) {
        var element = document.querySelector(selector);
        if (element) {
            element.parentNode.removeChild(element);
        }
    }

    // Function to add the new element inside the library scroll grid
    function addNewElement() {
        var libraryScrollGrid = document.querySelector('.library_library-scroll-grid_1jyXm');

        if (libraryScrollGrid) {
            var newElement = document.createElement('a');
            newElement.href = 'https://turbobuilder-steel.vercel.app/';
            newElement.target = '_blank';
            newElement.rel = 'noopener noreferrer';
            newElement.style.textDecoration = 'none';
            newElement.style.color = 'inherit';

            newElement.innerHTML = `
                <div class="library-item_library-item_1DcMO library-item_featured-item_3V2-t library-item_library-item-extension_3xus9" style="height: 378px;">
                    <div class="library-item_featured-image-container_1KIHG">
                        <img class="library-item_featured-image_2gwZ6" loading="lazy" draggable="false" src="static/assets/93db39f338237e6a51790829ba22a879.png">
                    </div>
                    <button data-clearclick="true" data-activated="false" class="library-item_library-item-favorite_3N_c1">
                        <img data-usedimage="true" data-clearclick="true" src="static/assets/e28b110fa5eef35531fa271a3a7b6314.svg">
                        <img data-usedimage="false" data-clearclick="true" src="static/assets/27802141bca7404b477168369bf3475d.svg">
                    </button>
                    <div class="library-item_featured-extension-text_22A1k library-item_featured-text_2KFel">
                        <span class="library-item_library-item-name_2qMXu">TurboBuilder</span><br>
                        <span class="library-item_featured-description_MjIJw">Create your own amazing extensions using a scratch-based UI!</span>
                    </div>
                    <div class="library-item_featured-extension-metadata_3D8E8">
                        <div class="library-item_featured-extension-requirement_2u2IO"></div>
                        <div class="library-item_featured-extension-collaboration_2dGS9">
                            <div class="library-item_small-bottom-margin_2XgVk">
                                <div>Credits</div>
                                <div class="library-item_featured-extension-metadata-detail_1M9BV">Started by JeremyGamer13, continued by jwklong</div>
                            </div>
                        </div>
                    </div>
                </div>
            `;

            // Append the new element to the library scroll grid
            libraryScrollGrid.appendChild(newElement);
        }
    }

    // Function to check if the specified elements exist
    function checkForElements() {
        // Check for the "Coming Soon" element
        var comingSoonElement = document.querySelector('.library-item_coming-soon-text_30OPh');
        if (comingSoonElement) {
            // If the "Coming Soon" element is found, remove it
            removeElement('.library-item_library-item_1DcMO.library-item_featured-item_3V2-t.library-item_disabled_1-aDH.library-item_library-item-extension_3xus9');
            // Add the new element
            addNewElement();
        }

        // Keep repeating
        setTimeout(checkForElements, 100);
    }

    // Start checking for the elements
    checkForElements();
})();