Image Uploader Drawaria Online

Adds your image without allow (NOBODY SEE IT!)

// ==UserScript==
// @name         Image Uploader Drawaria Online
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Adds your image without allow (NOBODY SEE IT!)
// @author       DehMaster
// @match        *://drawaria.online/*
// @match        *://*.drawaria.online/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    // Создание панели
    const panel = document.createElement('div');
    panel.style.position = 'fixed';
    panel.style.top = '10px';
    panel.style.right = '10px';
    panel.style.width = '200px';
    panel.style.backgroundColor = '#2d2d2d';
    panel.style.borderRadius = '8px';
    panel.style.padding = '10px';
    panel.style.boxShadow = '0 4px 6px rgba(0, 0, 0, 0.1)';
    panel.style.zIndex = '10000';
    panel.style.color = '#fff';
    panel.style.fontFamily = 'Arial, sans-serif';

    // Кнопка "Upload image"
    const uploadButton = document.createElement('button');
    uploadButton.innerText = 'Upload image';
    uploadButton.style.width = '100%';
    uploadButton.style.padding = '8px';
    uploadButton.style.marginBottom = '10px';
    uploadButton.style.backgroundColor = '#444';
    uploadButton.style.color = '#fff';
    uploadButton.style.border = 'none';
    uploadButton.style.borderRadius = '4px';
    uploadButton.style.cursor = 'pointer';

    // Элемент для загрузки изображения
    const fileInput = document.createElement('input');
    fileInput.type = 'file';
    fileInput.accept = 'image/*';
    fileInput.style.display = 'none';

    // Контейнер для изображения
    const imageContainer = document.createElement('div');
    imageContainer.style.display = 'none';
    imageContainer.style.flexDirection = 'column';
    imageContainer.style.gap = '10px';

    // Элемент для отображения изображения
    const imgElement = document.createElement('img');
    imgElement.style.maxWidth = '100%';
    imgElement.style.borderRadius = '4px';

    // Элементы для изменения размеров
    const widthInput = document.createElement('input');
    widthInput.type = 'number';
    widthInput.placeholder = 'Width';
    widthInput.style.padding = '4px';
    widthInput.style.borderRadius = '4px';
    widthInput.style.border = '1px solid #666';

    const heightInput = document.createElement('input');
    heightInput.type = 'number';
    heightInput.placeholder = 'Height';
    heightInput.style.padding = '4px';
    heightInput.style.borderRadius = '4px';
    heightInput.style.border = '1px solid #666';

    // Кнопка "Lock"
    const lockButton = document.createElement('button');
    lockButton.innerText = 'Lock';
    lockButton.style.width = '100%';
    lockButton.style.padding = '8px';
    lockButton.style.backgroundColor = '#444';
    lockButton.style.color = '#fff';
    lockButton.style.border = 'none';
    lockButton.style.borderRadius = '4px';
    lockButton.style.cursor = 'pointer';

    // Добавление элементов в панель
    panel.appendChild(uploadButton);
    panel.appendChild(fileInput);
    panel.appendChild(imageContainer);
    imageContainer.appendChild(imgElement);
    imageContainer.appendChild(widthInput);
    imageContainer.appendChild(heightInput);
    imageContainer.appendChild(lockButton);

    // Добавление панели на страницу
    document.body.appendChild(panel);

    // Обработчик для кнопки "Upload image"
    uploadButton.addEventListener('click', () => {
        fileInput.click(); // Открываем окно выбора файла
    });

    // Обработчик для выбора файла
    fileInput.addEventListener('change', (event) => {
        const file = event.target.files[0];
        if (file) {
            const reader = new FileReader();
            reader.onload = (e) => {
                imgElement.src = e.target.result; // Устанавливаем изображение
                imageContainer.style.display = 'flex'; // Показываем контейнер с изображением
            };
            reader.readAsDataURL(file);
        }
    });

    // Обработчик для изменения размеров изображения
    widthInput.addEventListener('input', () => {
        imgElement.style.width = `${widthInput.value}px`;
    });

    heightInput.addEventListener('input', () => {
        imgElement.style.height = `${heightInput.value}px`;
    });

    // Обработчик для кнопки "Lock"
    lockButton.addEventListener('click', () => {
        const canvas = document.getElementById('canvas'); // Основной холст Drawaria
        if (canvas) {
            const ctx = canvas.getContext('2d');
            const tempCanvas = document.createElement('canvas');
            const tempCtx = tempCanvas.getContext('2d');

            // Устанавливаем размеры временного холста
            tempCanvas.width = imgElement.width;
            tempCanvas.height = imgElement.height;

            // Рисуем изображение на временном холсте
            tempCtx.drawImage(imgElement, 0, 0, tempCanvas.width, tempCanvas.height);

            // Переносим изображение на основной холст
            ctx.drawImage(tempCanvas, 0, 0, canvas.width, canvas.height);

            // Скрываем контейнер с изображением
            imageContainer.style.display = 'none';
        }
    });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址