Gartic Phone Auto Draw + Music Player + Random Fruit

Adds a GUI for auto-drawing, image upload, drag & drop, sound effects, a music player, and a random fruit drawer.

目前为 2025-03-26 提交的版本,查看 最新版本

// ==UserScript==
// @name         Gartic Phone Auto Draw + Music Player + Random Fruit
// @namespace    https://greasyfork.org/en/users/fdslalkad
// @version      2.3
// @description  Adds a GUI for auto-drawing, image upload, drag & drop, sound effects, a music player, and a random fruit drawer.
// @author       fdslalkad
// @match        *://garticphone.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    let selectedImage = null;

    // Create and Display GUI
    let gui = document.createElement('div');
    gui.id = 'customGui';
    gui.style.position = 'fixed';
    gui.style.top = '10px';
    gui.style.right = '10px';
    gui.style.background = 'rgba(0,0,0,0.8)';
    gui.style.color = 'white';
    gui.style.padding = '10px';
    gui.style.borderRadius = '5px';
    gui.style.zIndex = '10000';
    gui.style.display = 'block';
    gui.innerHTML = `
        <button id="autoDrawBtn">Auto Draw</button><br>
        <input type="file" id="uploadImage" accept="image/*"><br>
        <input type="text" id="imageUrl" placeholder="Image URL">
        <button id="loadImageBtn">Load Image</button><br>
        <button id="playMusicBtn">Play Random Music</button>
        <button id="pauseMusicBtn">Pause</button>
        <button id="resumeMusicBtn">Play</button>
        <button id="nextMusicBtn">Next</button>
        <button id="prevMusicBtn">Previous</button>
        <button id="stopMusicBtn">Stop</button>
        <button id="changeSongBtn">Change Song</button>
        <button id="randomFruitBtn">Random Fruit</button>
        <p id="statusMessage" style="color: lime; font-family: Sans-Serif; display: none;"></p>
        <p id="nowPlaying"></p>
    `;
    document.body.appendChild(gui);

    // Toggle GUI with 'Q' Key
    document.addEventListener('keydown', (e) => {
        if (e.key.toLowerCase() === 'q') {
            gui.style.display = gui.style.display === 'none' ? 'block' : 'none';
        }
    });

})();