OnlyFakes easy prompt copy

Simply click on the images to copy the prompt

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name            OnlyFakes easy prompt copy
// @namespace       Violentmonkey Scripts
// @match           https://uncensoredai.io/*
// @grant           none
// @version         0.1.1
// @author          vipprograms
// @description     Simply click on the images to copy the prompt
// @grant           GM_addStyle
// ==/UserScript==
GM_addStyle(`
:root{
  --offwhite:color: hsl(0, 0%, 98%);
}
p{  white-space: pre;}

.oepc_popup{position:absolute; top:0; left:0; transform:translate(-50%,-50%); padding:10px 20px; background-color:hsla(0,0%,0%,70%);
  color:var(--offwhite); border-radius:5px; z-index:1000; backdrop-filter:blur(20px);
}
`);

const showPopup = (text) => {
  const popup = document.createElement('div');
  popup.innerHTML = `<div class="oepc_popup">${text}</div>`;
  document.body.appendChild(popup);

  // Get the current mouse position
  const mouseX = window.innerWidth / 2;
  const mouseY = window.innerHeight / 2;

  // Set the position of the popup immediately
  const scrollY = window.scrollY;
  popup.firstChild.style.position = 'absolute';
  popup.firstChild.style.left = `${mouseX}px`;
  popup.firstChild.style.top = `${mouseY + scrollY}px`;

  setTimeout(() => {
    const innerDiv = popup.firstChild;
    innerDiv.style.transition = 'opacity 0.5s';
    innerDiv.style.opacity = '0';
    setTimeout(() => {
      popup.remove();
    }, 600);
  }, 1000);
};



const copyPrompt = async (prompt) => {
  await navigator.clipboard.writeText(prompt);
};

const processImages = () => {
  document.querySelectorAll('img[alt^="Image made with A"]:not([data-listener-added])').forEach(img => {
    img.setAttribute('data-listener-added', 'true');
    img.addEventListener('click', () => {
      const prompt = img.alt.split('Prompt: ')[1];
      if (!prompt) return;
      copyPrompt(prompt);

      let text = `Copied!<br><br>Prompt:<br>${prompt}`;

      showPopup(text);

    });
  });
};

document.addEventListener('DOMContentLoaded', processImages);
window.addEventListener('scroll', processImages);