Resizable Textarea from prompts and negative promts

Hacer que el textarea de prompts y negative prompts redimensionables uwu

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Resizable Textarea from prompts and negative promts
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Hacer que el textarea de prompts y negative prompts redimensionables uwu
// @author       Abejita
// @match        https://pixai.art/generator/image
// @match        https://pixai.art/*
// @grant        none
// @license MIT
// ==/UserScript==
(function() {
    'use strict';
    function makeResizableVertical(selector, maxHeight) {
        const checkExist = setInterval(function() {
            const elements = document.querySelectorAll(selector);
            if (elements.length > 0) {
                elements.forEach(el => {
                    el.style.resize = 'vertical';
                    el.style.overflow = 'auto';
                    el.style.maxHeight = maxHeight;
                });
                clearInterval(checkExist);
            }
        }, 100);
        setTimeout(function() {
            clearInterval(checkExist);
        }, 10000);
    }
   window.addEventListener('load', function() {
        makeResizableVertical('.sc-iTFTee.sc-dwnOUR.lfbXAG.iIeQrX.MuiInputBase-input.MuiOutlinedInput-input.MuiInputBase-inputMultiline', '300px');
        makeResizableVertical('textarea.w-full.min-h-\\[3em\\].max-h-\\[9em\\].dense\\:max-h-\\[5em\\].bg-transparent.outline-none.resize-none', '500px');
    });
})();