dimanche 30 octobre 2022

How to add a checkbox to turn and on and off my script

var color = prompt("Please type a color code below!");

(function() {
    var Properties = {
        SCRIPT_CONFIG: {
            NAME_COLOR: `${color}`, 
        },
        MENU_CONFIG: {

            COLOR_1: "#00FFF0", 
        },
    }
    function changebackgroundcolor() {

        $('.fade-box').css({
            background: 'linear-gradient(to right bottom,hsl('+Properties.COLOR_HUE+', 50%, 50%),hsl('+Properties.COLOR_HUE2+', 50%, 50%)'
        })
    }
    var { fillText } = CanvasRenderingContext2D.prototype;
    CanvasRenderingContext2D.prototype.fillText = function(text, x, y) {
        let localstorage = Properties.SCRIPT_CONFIG
        if(text == document.getElementById("nick").value) {
            this.fillStyle = localstorage.NAME_COLOR;
        }
        fillText.call(this, ...arguments);
    }
    document.addEventListener("DOMContentLoaded", ready)
})();

can you add a check box to turn and off the color say the game defualt color is white and my script makes it black i want a checkbox what i can click to go back to defualt or back to script

i tried some checkbox's multiple times but it didnt do nothing i was hoping i had a check box that turned the script on and off!




Aucun commentaire:

Enregistrer un commentaire