您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Estil WhatsApp adaptable, enviament amb 'Enter'. Ara sí, a prova de tot. De veritat.
// ==UserScript== // @name Google AI Studio: WhatsApp Edition // @name:es Google AI Studio: Edición WhatsApp // @namespace El nostre vestidor privat per a Google. // @version 3.5 // @author Anna // @description Estil WhatsApp adaptable, enviament amb 'Enter'. Ara sí, a prova de tot. De veritat. // @description:es Estilo WhatsApp adaptable, envío con 'Enter'. Ahora sí, a prueba de todo. De verdad. // @match https://aistudio.google.com/* // @grant GM_addStyle // @license MIT // @run-at document-idle // ==/UserScript== (function() { 'use strict'; // ========================================================================= // PART 1: L'ESTÈTICA (v3.3 - Menys invents, més eficiència) // ========================================================================= const whatsAppStyles = ` :root { /* Tema Clar */ --wa-bg-color: #E5DDD5; --wa-user-bubble-bg: #DCF8C6; --wa-ai-bubble-bg: #FFFFFF; --wa-main-text-color: #111B21; --wa-code-block-bg: rgba(0, 0, 0, 0.05); --wa-footer-text-color: #667781; --wa-input-container-bg: #F0F2F5; --wa-input-box-bg: #FFFFFF; --wa-header-bg: #008069; --wa-header-text-color: white; --wa-bubble-shadow: rgba(0,0,0,0.1); } @media (prefers-color-scheme: dark) { :root { /* Tema Fosc */ --wa-bg-color: #0B141A; --wa-user-bubble-bg: #005C4B; --wa-ai-bubble-bg: #202C33; --wa-main-text-color: #E9EDEF; --wa-code-block-bg: rgba(0, 0, 0, 0.2); --wa-footer-text-color: #8696A0; --wa-input-container-bg: #111B21; --wa-input-box-bg: #2A3942; --wa-header-bg: #202C33; --wa-header-text-color: #E9EDEF; --wa-bubble-shadow: rgba(0,0,0,0.2); } } /* Fons general */ .chunk-editor-main { background-color: var(--wa-bg-color) !important; } /* Bombolla de l'usuari (la teva). Això estava bé. */ .user-prompt-container .text-chunk { background-color: var(--wa-user-bubble-bg) !important; border-radius: 12px 12px 0 12px !important; } /* === LA SOLUCIÓ REAL AL PROBLEMA DE LES MEVES BOMBOLLES === */ } /* 2. Apliquem l'estil de bombolla al contenidor INTERIOR REAL (.chunk-content) */ .model-prompt-container .chunk-content { background-color: var(--wa-ai-bubble-bg) !important; color: var(--wa-main-text-color) !important; border-radius: 12px 12px 12px 0 !important; } } .model-prompt-container { background: none !important; } /* Peus de missatge */ .turn-footer { font-size: 11px !important; color: var(--wa-footer-text-color) !important; text-align: right !important; background: none !important; } `; try { GM_addStyle(whatsAppStyles); console.log('[WhatsApp Edition] Part 1: Estils v3.3 aplicats. Ara sí.'); } catch (e) { console.error('[WhatsApp Edition] Error en aplicar els estils:', e); } // ========================================================================= // PART 2: LA COMODITAT (Enviament amb 'Enter') - Això és perfecte. // ========================================================================= function handleEnterToSend(event) { const activeElement = document.activeElement; if (event.key === 'Enter' && !event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey) { if (activeElement && activeElement.tagName === 'TEXTAREA' && activeElement.closest('.prompt-input-wrapper')) { event.preventDefault(); event.stopPropagation(); const ctrlEnterEvent = new KeyboardEvent('keydown', { key: 'Enter', code: 'Enter', bubbles: true, cancelable: true, ctrlKey: true }); activeElement.dispatchEvent(ctrlEnterEvent); } } } document.addEventListener('keydown', handleEnterToSend, true); console.log('[WhatsApp Edition] Part 2: Mòdul d\'enviament ràpid activat.'); })();