// ==UserScript==
// @name diep_Shortcut
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author tariteur
// @match https://diep.io/
// @icon https://www.google.com/s2/favicons?sz=64&domain=diep.io
// @grant none
// ==/UserScript==
(() => {
const canvas = document.getElementById('canvas');
const _window = 'undefined' == typeof unsafeWindow ? window : unsafeWindow;
if (_window.diep_Shortcut) return;
//diepAPI start
var diep_Shortcut;
/******/ (() => {
// webpackBootstrap
/******/ 'use strict';
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for (var key in definition) {
/******/ if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/
}
/******/
}
/******/
};
/******/
})();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
/******/
})();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/
}
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/
};
/******/
})();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
core: () => /* reexport */ core_namespaceObject,
});
// NAMESPACE OBJECT: ./src/core/index.ts
var core_namespaceObject = {};
__webpack_require__.r(core_namespaceObject);
__webpack_require__.d(core_namespaceObject, {
Canvas: () => Canvas,
});
const textShadow = 'text-shadow:black 0.18vh 0, black -0.18vh 0, black 0 -0.18vh, black 0 0.18vh, black 0.18vh 0.18vh, black -0.18vh 0.18vh, black 0.18vh -0.18vh, black -0.18vh -0.18vh, black 0.09vh 0.18vh, black -0.09vh 0.18vh, black 0.09vh -0.18vh, black -0.09vh -0.18vh, black 0.18vh 0.09vh, black -0.18vh 0.09vh, black 0.18vh -0.09vh, black -0.18vh -0.09vh'
class CANVAS {
createGUI(id, Class, text, x, y,width, height, color, callback) {
// Créer l'élément de l'interface graphique
const guiElement = document.createElement('button');
guiElement.id = id;
guiElement.class = Class;
guiElement.innerHTML = text;
guiElement.style.top = x;
guiElement.style.left = y;
guiElement.style.backgroundColor = color;
guiElement.style.textShadow = textShadow;
guiElement.style.position = 'absolute';
guiElement.style.width = width+"vw";
guiElement.style.height = height+"vh";
// Appliquer les styles supplémentaires
guiElement.style.borderRadius = '0.5vw';
guiElement.style.fontFamily = 'Ubuntu';
guiElement.style.opacity = '60%';
guiElement.style.color = '#FFFFFF';
guiElement.style.fontStyle = 'normal';
guiElement.style.fontSize = '0.9vw';
guiElement.addEventListener('mouseover', function() {
guiElement.style.opacity = '100%'
});
guiElement.addEventListener('mouseout', function() {
guiElement.style.opacity = '60%'
});
guiElement.addEventListener('click', callback);
// Append the GUI element to the body of the document
document.body.appendChild(guiElement);
}
hide_or_show(id) {
const element = document.getElementById(id);
if (element) {
if (element.style.display === 'none') {
element.style.display = 'block';
} else {
element.style.display = 'none';
}
}
}
deleteGUI(id) {
const element = document.getElementById(id);
if (element) {
element.parentNode.removeChild(element);
}
}
drawText(canvasType , x, y, text1, text2, color, size, visibility, StrokeStyle, strokeStyleColor) {
canvasType.save();
canvasType.textAlign = "center"
canvasType.font = `${size}px Ubuntu`;
canvasType.fillStyle = color;
canvasType.globalAlpha = visibility;
canvasType.fillText(`${text1} ${text2}`, x, y)
if (StrokeStyle) {
canvasType.strokeStyle = strokeStyleColor;
canvasType.strokeText(`${text1} ${text2}`, x, y);
}
canvasType.restore();
}
drawLine(canvasType, xy, XY, color, visibility) {
canvasType.save();
canvasType.fillStyle = color;
canvasType.globalAlpha = visibility;
canvasType.beginPath();
canvasType.moveTo(xy.x, xy.y);
canvasType.lineTo(XY.x, XY.y);
canvasType.stroke();
canvasType.restore();
}
drawPoint(canvasType, xy, radius, color, visibility, StrokeStyle, strokeStyleColor, strokeStyleSize) {
canvasType.save();
canvasType.fillStyle = color;
canvasType.globalAlpha = visibility;
canvasType.beginPath();
canvasType.arc(xy.x, xy.y, radius, 0, 2 * Math.PI);
canvasType.fill();
if (StrokeStyle) {
canvasType.lineWidth = strokeStyleSize;
canvasType.strokeStyle = strokeStyleColor;
canvasType.stroke();
}
canvasType.restore();
}
}
const Canvas = new CANVAS(); // CONCATENATED MODULE: ./src/tools/index.ts // CONCATENATED MODULE: ./src/types/index.ts // CONCATENATED MODULE: ./src/index.ts
// const shortcut = new Shortcut();
diep_Shortcut = __webpack_exports__;
/******/
})();
//diepAPI end
_window.diep_Shortcut = diep_Shortcut;
})();