DrawariaGPT AI Chat

New DrawariaGPT ChatBot AI - Assistant

  1. // ==UserScript==
  2. // @name DrawariaGPT AI Chat
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description New DrawariaGPT ChatBot AI - Assistant
  6. // @author YouTubeDrawaria
  7. // @match https://ftac.vercel.app/*
  8. // @match https://drawaria.online/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=drawaria.online
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. // Función para inyectar estilos globales
  18. function addGlobalStyle(css) {
  19. const head = document.getElementsByTagName('head')[0];
  20. if (!head) { return; }
  21. const style = document.createElement('style');
  22. style.type = 'text/css';
  23. style.innerHTML = css;
  24. head.appendChild(style);
  25. }
  26.  
  27. // --- Código para ftac.vercel.app ---
  28. if (window.location.host.includes("ftac.vercel.app")) {
  29. window.addEventListener('load', () => {
  30. const header = document.querySelector("body > div.tac-data > h1");
  31. if (header) {
  32. header.textContent = "DrawariaGPT AI Chat 🤖🌞";
  33. }
  34. });
  35. }
  36.  
  37. // --- Código para drawaria.online ---
  38. if (window.location.host.includes("drawaria.online")) {
  39. // Creamos el contenedor modal para mostrar la página de ftac.vercel.app
  40. const container = document.createElement("div");
  41. container.id = "drawariagpt-container";
  42. container.style.position = "fixed";
  43. container.style.top = "50%";
  44. container.style.left = "50%";
  45. container.style.transform = "translate(-50%, -50%)";
  46. container.style.width = "80%";
  47. container.style.height = "80%";
  48. container.style.background = "#fff";
  49. container.style.boxShadow = "0 0 10px rgba(0,0,0,0.5)";
  50. container.style.zIndex = "10000";
  51. container.style.display = "none"; // inicialmente oculto
  52. container.style.flexDirection = "column";
  53. container.style.overflow = "hidden";
  54.  
  55. // Creamos la barra superior con el botón de cerrar
  56. const headerBar = document.createElement("div");
  57. headerBar.style.background = "#333";
  58. headerBar.style.color = "#fff";
  59. headerBar.style.padding = "10px";
  60. headerBar.style.display = "flex";
  61. headerBar.style.justifyContent = "space-between";
  62. headerBar.style.alignItems = "center";
  63.  
  64. const title = document.createElement("span");
  65. title.textContent = "DrawariaGPT Chat";
  66. headerBar.appendChild(title);
  67.  
  68. const closeButton = document.createElement("button");
  69. closeButton.textContent = "Close";
  70. closeButton.style.background = "#f00";
  71. closeButton.style.color = "#fff";
  72. closeButton.style.border = "none";
  73. closeButton.style.padding = "5px 10px";
  74. closeButton.style.cursor = "pointer";
  75. closeButton.addEventListener("click", () => {
  76. container.style.display = "none";
  77. });
  78. headerBar.appendChild(closeButton);
  79.  
  80. container.appendChild(headerBar);
  81.  
  82. // Utilizamos un elemento <object> en lugar de un <iframe>
  83. const objectEl = document.createElement("object");
  84. objectEl.data = "https://ftac.vercel.app/";
  85. objectEl.type = "text/html";
  86. objectEl.style.width = "100%";
  87. objectEl.style.height = "100%";
  88. objectEl.style.border = "none";
  89.  
  90. container.appendChild(objectEl);
  91. document.body.appendChild(container);
  92.  
  93. // Creamos el ícono flotante (draggable)
  94. const icon = document.createElement("img");
  95. icon.src = "https://www.google.com/s2/favicons?sz=64&domain=drawaria.online";
  96. icon.id = "drawariagpt-icon";
  97. icon.style.position = "fixed";
  98. icon.style.bottom = "20px";
  99. icon.style.right = "20px";
  100. icon.style.width = "50px";
  101. icon.style.height = "50px";
  102. icon.style.cursor = "pointer";
  103. icon.style.zIndex = "10001";
  104. document.body.appendChild(icon);
  105.  
  106. // Al hacer click en el ícono se abre el contenedor
  107. icon.addEventListener("click", () => {
  108. container.style.display = "flex";
  109. });
  110.  
  111. // Hacemos que el ícono sea arrastrable
  112. let isDragging = false;
  113. let offsetX, offsetY;
  114.  
  115. icon.addEventListener("mousedown", (e) => {
  116. isDragging = true;
  117. offsetX = e.clientX - icon.getBoundingClientRect().left;
  118. offsetY = e.clientY - icon.getBoundingClientRect().top;
  119. e.preventDefault();
  120. });
  121.  
  122. document.addEventListener("mousemove", (e) => {
  123. if (isDragging) {
  124. // Removemos estilos fijos de right y bottom
  125. icon.style.right = "auto";
  126. icon.style.bottom = "auto";
  127. icon.style.left = (e.clientX - offsetX) + "px";
  128. icon.style.top = (e.clientY - offsetY) + "px";
  129. }
  130. });
  131.  
  132. document.addEventListener("mouseup", () => {
  133. isDragging = false;
  134. });
  135. }
  136. })();