Voxiom.io Code Meteor`s Client (PATCHED BY THE NEW ANTICHEAT)

A hacked client for Voxiom.io with a lot of functionalities

// ==UserScript==
// @name Voxiom.io Code Meteor`s Client (PATCHED BY THE NEW ANTICHEAT)
// @namespace http://tampermonkey.net/
// @version 1.4
// @description A hacked client for Voxiom.io with a lot of functionalities
// @author Code Meteor dev
// @author Code Meteor#7780
// @match https://voxiom.io/
// @icon https://cdn.discordapp.com/attachments/1035864664942329897/1106440177230037033/1dfe72a6ab341931
// @grant none
// @require https://unpkg.com/three@latest/build/three.min.js
// @license MIT
// ==/UserScript==



//████████╗░█████╗░  ░█████╗░██████╗░███████╗███╗░░██╗  ██████╗░██████╗░███████╗░██████╗░██████╗
//╚══██╔══╝██╔══██╗  ██╔══██╗██╔══██╗██╔════╝████╗░██║  ██╔══██╗██╔══██╗██╔════╝██╔════╝██╔════╝
//░░░██║░░░██║░░██║  ██║░░██║██████╔╝█████╗░░██╔██╗██║  ██████╔╝██████╔╝█████╗░░╚█████╗░╚█████╗░
//░░░██║░░░██║░░██║  ██║░░██║██╔═══╝░██╔══╝░░██║╚████║  ██╔═══╝░██╔══██╗██╔══╝░░░╚═══██╗░╚═══██╗
//░░░██║░░░╚█████╔╝  ╚█████╔╝██║░░░░░███████╗██║░╚███║  ██║░░░░░██║░░██║███████╗██████╔╝██████╔╝
//░░░╚═╝░░░░╚════╝░  ░╚════╝░╚═╝░░░░░╚══════╝╚═╝░░╚══╝  ╚═╝░░░░░╚═╝░░╚═╝╚══════╝╚═════╝░╚═════╝░

//██╗██╗░░░░██╗██╗██╗
//╚█║╚█║░░░██╔╝╚█║╚█║
//░╚╝░╚╝░░██╔╝░░╚╝░╚╝
//░░░░░░░██╔╝░░░░░░░░
//░░░░░░██╔╝░░░░░░░░░
//░░░░░░╚═╝░░░░░░░░░░


const THREE = window.THREE;
const geo = new THREE.EdgesGeometry(new THREE.BoxGeometry(1, 1, 1).translate(0, 0.5, 0));

Object.defineProperty(window, 'THREE', {
get() {
    return undefined;
}
});

//Dump label
let Code_Meteor = true;









//...... MODULES ......



let headVisible = true;

//Prevents items from getting dropped when detected
Object.defineProperty( window, 'THREE', {get() {return undefined;}});

function makeSquareHitbox() {
    let hitbox = new THREE.LineSegments(geo);
    hitbox.material = new THREE.RawShaderMaterial({
        vertexShader: `attribute vec3 position;uniform mat4 projectionMatrix;uniform mat4 modelViewMatrix;void main() {gl_Position = projectionMatrix*modelViewMatrix*vec4( position, 1.0 );gl_Position.z = 1.0;}`,
        fragmentShader: `precision mediump float;uniform vec3 color;void main() {gl_FragColor = vec4( color, 1.0 );}`,
        uniforms: {color: {value: new THREE.Color('red')}}
    });
    hitbox.scale.set(0.25, 0.25, 0.25);
    return hitbox;
}

let gameScene3;
WeakMap.prototype.set = new Proxy(WeakMap.prototype.set, {apply(t, args, [scene]) {
    if(scene.type === 'Scene') {
        if(scene.children.length === 9) {
            window.scene = scene;
            gameScene3 = scene;
        }
    }
    return Reflect.apply( ...arguments );
}});

window.requestAnimationFrame = new Proxy(window.requestAnimationFrame, {apply(target, args, args2){
    args2[0] = new Proxy(args2[0], {
        apply() {
            if(gameScene3 == null) { return; }

            const allEntities = gameScene3.children[5].children;
            for ( let i = 0; i < allEntities.length; i++ ) {
                const entity = allEntities[ i ];
                if (entity.children.length === 0) {
                    continue;
                }
                if (!entity.HitBox) {
                    const name = entity.children[0].name;
                    //Game scene saves name as parachute, hence can be used to recognize a player
                    if (name === 'Parachute') {
                        entity.isPlayer = true;
                        // Generates a square hitbox above the player
                        let squareHitbox = makeSquareHitbox();
                        squareHitbox.position.y = 1;
                        entity.add(squareHitbox);
                    }
                }
                if (entity.HitBox != null) {
                    entity.HitBox.visible = headVisible;
                }
            }
            return Reflect.apply( ...arguments );
        }
    });
    return Reflect.apply( ...arguments );
}});


//Chams
let wireFrame = false;

const original_push = Array.prototype.push;
Array.prototype.push = function(...args) {
  original_push.apply(this, args);
    if (args[0] && args[0].material && args[0].type == "SkinnedMesh") {
    if (wireFrame) {
      args[0].material.wireframe = true
    }
    args[0].material.alphaTest = 1;
    args[0].material.depthTest = !renderCheckbox.checked;
    args[0].material.fog = false;
    args[0].material.color.r = 1;
    args[0].material.color.g = 0;
    args[0].material.color.b = 1;
    console.log(args[0])
  }
}





//Hitbox
function makeHitbox() {
    let hitbox = new THREE.LineSegments(geo);
  const gradientColor = new THREE.Color('purple');
    const darkColor = new THREE.Color('darkviolet');
    hitbox.material = new THREE.RawShaderMaterial({
        vertexShader: `attribute vec3 position;uniform mat4 projectionMatrix;uniform mat4 modelViewMatrix;void main() {gl_Position = projectionMatrix*modelViewMatrix*vec4( position, 1.0 );gl_Position.z = 1.0;}`,
        fragmentShader: `precision mediump float;uniform vec3 startColor;uniform vec3 endColor;void main() {gl_FragColor = vec4( mix(startColor, endColor, gl_FragCoord.y / 120.0), 1.0 );}`,
    uniforms: {
        startColor: {
            value: new THREE.Color('purple')
        },
        endColor: {
            value: new THREE.Color('darkviolet')
        }
    }
    });
    hitbox.scale.set(0.4, 1.3, 0.4);
    return hitbox;
}
let gameScene;
WeakMap.prototype.set = new Proxy(WeakMap.prototype.set, {
    apply(t, args, [scene]) {
        if (scene.type === 'Scene') {
            if (scene.children.length === 9) {
window.scene = scene;
                gameScene = scene;
            }
}
        return Reflect.apply(...arguments);
    }
});

window.requestAnimationFrame = new Proxy(window.requestAnimationFrame, {
    apply(target, args, args2) {
        args2[0] = new Proxy(args2[0], {
apply() {
    if (gameScene == null) {
        return;
    }

    const allEntities = gameScene.children[5].children;
    for (let i = 0; i < allEntities.length; i++) {
      const entity = allEntities[i];
        if (entity.children.length === 0) {
            continue;
        }
        if (!entity.HitBox) {
            const name = entity.children[0].name;
            if (name === 'Parachute') {
          entity.isPlayer = true;
                let hitbox = makeHitbox();
                entity.add(hitbox);
                entity.HitBox = hitbox;
            }
        }
      if (entity.HitBox != null) {
          entity.HitBox.visible = playersVisible;
      }
    }
    return Reflect.apply(...arguments);
  }
        });
        return Reflect.apply(...arguments);
}
});






//Player Count + Notification
// Create player count element
let playerCountElement = document.createElement('div');
playerCountElement.id = 'player-count';
playerCountElement.innerHTML = 'Loading...'
document.body.appendChild(playerCountElement);

let style = document.createElement('style');
style.innerHTML = `
#player-count {
    position: fixed;
    bottom: 0;
    right: 0;
    margin-right: 20px;
    margin-bottom: 120px;
    font-size: 20px;
    color: #e3dcd7;
    border: 1px solid #6a006a;
    z-index: 999;
    background: linear-gradient(180deg, #6600ff, #000000);
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0px 0px 8px rgba(50, 0, 255, 0.7);
}
`;
document.head.appendChild(style);

// Creating a notification on playerCount change
const guinp = document.createElement('div');
const titlenp = document.createElement('div');
function createRedRectangle() {
    guinp.id = 'guinp';
    guinp.style.position = 'absolute';
    guinp.style.top = '5px';
    guinp.style.left = '50%';
    guinp.style.transform = 'translateX(-50%)';
    guinp.style.padding = '15px';
    guinp.style.background = 'linear-gradient(to bottom, rgba(255, 0, 0, 0.5), rgba(31, 31, 31, 0.5))';
    guinp.style.color = '#fff';
    guinp.style.fontFamily = 'Arial';
    guinp.style.fontSize = '16px';
    guinp.style.borderRadius = '9999px';
    guinp.style.border = '1px solid #6a006a';
    guinp.style.width = '350px';
    guinp.style.textAlign = 'center';

    titlenp.style.marginBottom = '5px';
    titlenp.style.fontWeight = 'bold';
    titlenp.style.fontSize = '25px';
    titlenp.innerHTML = 'Player Detected!';
    guinp.appendChild(titlenp);
    document.body.appendChild(guinp);

    setTimeout(() => {
        document.body.removeChild(guinp);
        document.body.removeChild(titlenp);
    }, 2000);
}
// Update player count
let prevPlayerCount = 0;

function updatePlayerCount() {
  let playerCount = 0;
  let enemyCount = 0;
  const allEntities = gameScene2.children[5].children;

  for (let i = 0; i < allEntities.length; i++) {
    const entity = allEntities[i];
    if (entity.children.length === 0) {
      continue;
    }
    const name = entity.children[0].name;
    if (name === 'Parachute') {
      playerCount++;
    } else {
      enemyCount++;
    }
  }

  // Set color based on player count
  let color;
  if (playerCount === 0) {
    color = '#FF0000';
  } else if (playerCount < 5) {
    color = '#FFFF00';
  } else {
    color = '#00FF00';
  }

  playerCountElement.innerHTML = playerCount + ' Players nearby';
  playerCountElement.style.backgroundColor = color;

  // Create red rectangle on playerCount change
  if (playerCount !== prevPlayerCount) {
    createRedRectangle();
    prevPlayerCount = playerCount;
  }
}

let gameScene2;
WeakMap.prototype.set = new Proxy(WeakMap.prototype.set, {apply(t, args, [scene]) {
    if(scene.type === 'Scene') {
        if(scene.children.length === 9) {
            window.scene = scene;
            gameScene2 = scene;
            updatePlayerCount();
        }
    }
    return Reflect.apply( ...arguments );
}});
window.requestAnimationFrame = new Proxy(window.requestAnimationFrame, {apply(target, args, args2){
    args2[0] = new Proxy(args2[0], {
        apply() {
            if(gameScene2 == null) { return; }
            updatePlayerCount();
            return Reflect.apply( ...arguments );
        }
    });
    return Reflect.apply( ...arguments );
}});

//beam
const smallGeo = new THREE.EdgesGeometry(new THREE.BoxGeometry(1, 1, 1).translate(0, 0.5, 0));
//Prevents items from getting dropped when detected
Object.defineProperty(window, 'THREE', { get() { return undefined; } });

function makeSmallHitbox() {
  let smallHitbox = new THREE.LineSegments(smallGeo);
  smallHitbox.material = new THREE.RawShaderMaterial({
    vertexShader: `attribute vec3 position;uniform mat4 projectionMatrix;uniform mat4 modelViewMatrix;void main() {gl_Position = projectionMatrix*modelViewMatrix*vec4( position, 1.0 );gl_Position.z = 1.0;}`,
    fragmentShader: `precision mediump float;uniform vec3 startColor;uniform vec3 endColor;void main() {gl_FragColor = vec4( mix(startColor, endColor, gl_FragCoord.y / 120.0), 1.0 );}`,
    uniforms: {
        startColor: {
            value: new THREE.Color('purple')
        },
        endColor: {
            value: new THREE.Color('darkviolet')
        }
    }
  });
  smallHitbox.scale.set(0.0001, 1000, 0.0001);
  return smallHitbox;
}

let gameScene4;
WeakMap.prototype.set = new Proxy(WeakMap.prototype.set, {
  apply(t, args, [scene]) {
    if (scene.type === 'Scene') {
      if (scene.children.length === 9) {
        window.scene = scene;
        gameScene4 = scene;
      }
    }
    return Reflect.apply(...arguments);
  }
});

window.requestAnimationFrame = new Proxy(window.requestAnimationFrame, {
  apply(target, args, args2) {
    args2[0] = new Proxy(args2[0], {
      apply() {
        if (gameScene4 == null) { return; }

        const allEntities = gameScene4.children[5].children;
        for (let i = 0; i < allEntities.length; i++) {
          const entity = allEntities[i];
          if (entity.children.length === 0) {
            continue;
          }
          if (!entity.SmallHitBox) {
            const name = entity.children[0].name;
            //Game scene saves name as parachute, hence can be used to recognize a player
            if (name === 'Parachute') {
              entity.isPlayer = true;
              //Generates a small hitbox for the player
              let smallHitbox = makeSmallHitbox();
              entity.add(smallHitbox);
              entity.SmallHitBox = smallHitbox;
            }
          }
          if (entity.SmallHitBox != null) {
            entity.SmallHitBox.visible = beamVisible;
          }
        }
        return Reflect.apply(...arguments);
      }
    });
    return Reflect.apply(...arguments);
  }
});












//...... GUI ELEMENTS ......








//Creating Render GUI
let beamVisible = true;
let playersVisible = true;
let Chams = true
let isDraggingRender = false;
let isDraggingMisc = false;
let mouseOffsetX = 0;
let mouseOffsetY = 0;

const gui = document.createElement('div');
gui.id = 'gui';
gui.style.position = 'absolute';
gui.style.top = '50%';
gui.style.left = '30%';
gui.style.transform = 'translate(-50%, -50%)';
gui.style.padding = '10px';
gui.style.height = '300px';
gui.style.background = 'linear-gradient(to bottom, rgba(31, 31, 31, 1), rgba(95, 0, 138, 1))';
gui.style.color = '#fff';
gui.style.fontFamily = 'Arial';
gui.style.fontSize = '16px';
gui.style.display = 'none';
gui.style.cursor = 'none';
gui.style.borderRadius = '10px';
gui.style.border = '1px solid #6a006a';
gui.style.userSelect = 'none'; // Заборона виділення тексту
gui.style.zIndex = '4';

const title = document.createElement('div');
title.style.marginBottom = '10px';
title.style.fontWeight = 'bold';
title.style.fontSize = '20px';
title.innerHTML = 'Render';
title.style.zIndex = '4';
gui.appendChild(title);

const optionsWrapper = document.createElement('div');
optionsWrapper.style.display = 'flex';
optionsWrapper.style.alignItems = 'center';
optionsWrapper.style.marginBottom = '10px';
optionsWrapper.style.zIndex = '4';
gui.appendChild(optionsWrapper);

const boptionsWrapper = document.createElement('div');
boptionsWrapper.style.display = 'flex';
boptionsWrapper.style.alignItems = 'left';
boptionsWrapper.style.marginBottom = '10px';
boptionsWrapper.style.zIndex = '4';
gui.appendChild(boptionsWrapper);

const hoptionsWrapper = document.createElement('div');
hoptionsWrapper.style.display = 'flex';
hoptionsWrapper.style.alignItems = 'left';
hoptionsWrapper.style.marginBottom = '10px';
hoptionsWrapper.style.zIndex = '4';
gui.appendChild(hoptionsWrapper);

document.body.appendChild(gui);

//Creating Misc GUI
const guim = document.createElement('dive');
guim.id = 'guim';
guim.style.position = 'absolute';
guim.style.top = '50%';
guim.style.left = '70%';
guim.style.transform = 'translate(-50%, -50%)';
guim.style.padding = '10px';
guim.style.height = '300px';
guim.style.background = 'linear-gradient(to bottom, rgba(31, 31, 31, 1), rgba(95, 0, 138, 1))';
guim.style.color = '#fff';
guim.style.fontFamily = 'Arial';
guim.style.fontSize = '16px';
guim.style.display = 'none';
guim.style.cursor = 'auto';
guim.style.borderRadius = '10px';
guim.style.border = '1px solid #6a006a';
guim.style.userSelect = 'none'; // Заборона виділення тексту
guim.style.zIndex = '5';

const titlem = document.createElement('div');
titlem.style.marginBottom = '10px';
titlem.style.fontWeight = 'bold';
titlem.style.fontSize = '20px';
titlem.innerHTML = 'Exploit';
guim.appendChild(titlem);

const eoptionsWrapper = document.createElement('div');
eoptionsWrapper.style.display = 'flex';
eoptionsWrapper.style.alignItems = 'left';
eoptionsWrapper.style.marginBottom = '10px';
eoptionsWrapper.style.zIndex = '4';
guim.appendChild(eoptionsWrapper);

document.body.appendChild(guim);

//...... RENDER MODULES ......





//Show hitbox label + checkbox
const playersLabel = document.createElement('label');
playersLabel.innerHTML = 'Hitbox';
playersLabel.style.marginRight = '50px';
playersLabel.style.marginLeft = '10px';
playersLabel.style.cursor = 'pointer';
playersLabel.htmlFor = 'players-checkbox';
hoptionsWrapper.appendChild(playersLabel);

const playersCheckbox = document.createElement('input');
playersCheckbox.type = 'checkbox';
playersCheckbox.id = 'players-checkbox';
playersCheckbox.style.marginBottom = '20px';
playersCheckbox.checked = playersVisible;
playersLabel.appendChild(playersCheckbox);

//Show HEADhitbox label + checkbox
const headLabel = document.createElement('label');
headLabel.innerHTML = 'Head Hitbox';
headLabel.style.marginRight = '50px';
headLabel.style.marginLeft = '10px';
headLabel.style.cursor = 'pointer';
headLabel.htmlFor = 'head-checkbox';
optionsWrapper.appendChild(headLabel);

const headCheckbox = document.createElement('input');
headCheckbox.type = 'checkbox';
headCheckbox.id = 'head-checkbox';
headCheckbox.style.marginBottom = '20px';
headCheckbox.checked = beamVisible;
headLabel.appendChild(headCheckbox);


//Beam label + checkbox
const beamLabel = document.createElement('label');
beamLabel.innerHTML = 'Beams';
beamLabel.style.marginRight = '50px';
beamLabel.style.marginLeft = '10px';
beamLabel.style.cursor = 'pointer';
beamLabel.htmlFor = 'beam-checkbox';
boptionsWrapper.appendChild(beamLabel);

const beamCheckbox = document.createElement('input');
beamCheckbox.type = 'checkbox';
beamCheckbox.id = 'beam-checkbox';
beamCheckbox.style.marginBottom = '20px';
beamCheckbox.checked = beamVisible;
beamLabel.appendChild(beamCheckbox);







//Chams label + checkbox
const renderCheckboxContainer = document.createElement('div');
renderCheckboxContainer.classList.add('checkbox-container');
const renderCheckbox = document.createElement('input');
renderCheckbox.type = 'checkbox';
renderCheckbox.checked = true;
renderCheckbox.style.marginBottom = '10px';
renderCheckbox.onchange = () => {
};
const renderLabel = document.createElement('label');
renderLabel.innerText = 'Chams';
renderLabel.style.marginLeft = '10px';



renderCheckboxContainer.appendChild(renderLabel);
renderCheckboxContainer.appendChild(renderCheckbox);
gui.appendChild(renderCheckboxContainer);

//Chamstype label + checkbox
const wCheckboxContainer = document.createElement('div');
wCheckboxContainer.classList.add('checkbox-container');
const wCheckbox = document.createElement('input');
wCheckbox.type = 'checkbox';
wCheckbox.checked = false;
wCheckbox.style.marginBottom = '30px';
wCheckbox.onchange = () => {
};
const wLabel = document.createElement('label');
wLabel.innerText = 'Wireframe Chams';
wLabel.style.marginLeft = '30px';

wCheckbox.addEventListener('change', function() {
    if (this.checked) {
        let wireFrame = true;
    } else {
        let wireFrame = false;
    }
});



wCheckboxContainer.appendChild(wLabel);
wCheckboxContainer.appendChild(wCheckbox);
gui.appendChild(wCheckboxContainer);




//Playercount label + checkbox
const countCheckboxContainer = document.createElement('div');
countCheckboxContainer.classList.add('checkbox-container');

const countCheckbox = document.createElement('input');
countCheckbox.type = 'checkbox';
countCheckbox.checked = true;
countCheckbox.style.marginBottom = '10px';
countCheckbox.onchange = () => {
};

const countLabel = document.createElement('label');
countLabel.innerText = 'Player Count';
countLabel.style.marginLeft = '10px';

countCheckbox.addEventListener('change', function() {
    if (this.checked) {
        playerCountElement.style.display = 'block';
    } else {
        playerCountElement.style.display = 'none';
    }
});


countCheckboxContainer.appendChild(countLabel);
countCheckboxContainer.appendChild(countCheckbox);
gui.appendChild(countCheckboxContainer);




//Playernotification label + checkbox
const nCheckboxContainer = document.createElement('div');
nCheckboxContainer.classList.add('checkbox-container');

const nCheckbox = document.createElement('input');
nCheckbox.type = 'checkbox';
nCheckbox.checked = true;
nCheckbox.style.marginBottom = '30px';
nCheckbox.onchange = () => {
};

const nLabel = document.createElement('label');
nLabel.innerText = 'Player Notification';
nLabel.style.marginLeft = '30px';

nCheckbox.addEventListener('change', function() {
    if (this.checked) {
        guinp.style.display = 'block';
    } else {
        guinp.style.display = 'none';
    }
});

nCheckboxContainer.appendChild(nLabel);
nCheckboxContainer.appendChild(nCheckbox);
gui.appendChild(nCheckboxContainer);

//...... MISC MODULES ......

//Unfocus

const uCheckboxContainer = document.createElement('div');
uCheckboxContainer.classList.add('checkbox-container');

const uCheckbox = document.createElement('input');
uCheckbox.type = 'checkbox';
uCheckbox.checked = true;
uCheckbox.style.marginBottom = '0px';
uCheckbox.style.marginTop = '30px';
uCheckbox.style.marginRight = '0px';
uCheckbox.style.marginLeft = '0px';
uCheckbox.onchange = () => {
};

const uLabel = document.createElement('label');
uLabel.innerText = 'Force Unfocus';
uLabel.style.marginLeft = '0px';
uLabel.style.marginRight = '0px';
uLabel.style.marginBottom = '50px';
uLabel.style.marginTop = '50px';

uCheckbox.addEventListener('change', function() {
    if (this.checked) {
        Code_Meteor = true;
    } else {
        Code_Meteor = true;
    }
});

uCheckboxContainer.appendChild(uLabel);
uCheckboxContainer.appendChild(uCheckbox);
guim.appendChild(uCheckboxContainer);

//Name exploit
let Code_Meteor2
const naCheckboxContainer = document.createElement('div');
naCheckboxContainer.classList.add('checkbox-container');

const naCheckbox = document.createElement('input');
naCheckbox.type = 'checkbox';
naCheckbox.checked = true;
naCheckbox.style.marginBottom = '30px';
naCheckbox.style.marginTop = '60px';
naCheckbox.style.marginLeft = '0px';
naCheckbox.onchange = () => {
};

const naLabel = document.createElement('label');
naLabel.innerText = 'Name Exploit';
naLabel.style.marginLeft = '0px';

naCheckbox.addEventListener('change', function() {
    if (this.checked) {
        Code_Meteor2 = true;
    } else {
        Code_Meteor2 = true;
    }
});

naCheckboxContainer.appendChild(naLabel);
naCheckboxContainer.appendChild(naCheckbox);
guim.appendChild(naCheckboxContainer);


//Open|Close and making Dragaclick GUI


function toggleGui() {
  if (gui.style.display === 'none') {
    gui.style.display = 'block';
    gui.style.cursor = 'auto';
    guiLLL.style.width = '350px';
    guiLLL.style.left = '50%';
    guiLLL.style.borderRadius = '5px';
    guiLLL.style.padding = '15px';
    titleLLL.style.fontSize = '25px';
    titleLLL.style.marginBottom = '30px';
    optionsWrapper.style.display = 'flex'; // Додати цей рядок
    firstButton.style.display = 'block'; // Додати цей рядок
    optionsWrapper.style.display = 'flex'; // Додати цей рядок
    secondButton.style.display = 'block'; // Додати цей рядок
    guim.style.display = 'flex';
    guim.style.cursor = 'auto';
  } else {
    gui.style.display = 'none';
    gui.style.cursor = 'none';
    guiLLL.style.width = '50px';
    guiLLL.style.left = '95%';
    guiLLL.style.borderRadius = '360px';
    guiLLL.style.padding = '8px';
    titleLLL.style.fontSize = '7px';
    titleLLL.style.marginBottom = '0px';
    optionsWrapper.style.display = 'none'; // Додати цей рядок
    firstButton.style.display = 'none'; // Додати цей рядок
    optionsWrapper.style.display = 'none'; // Додати цей рядок
    secondButton.style.display = 'none'; // Додати цей рядок
    guim.style.display = 'none';
    guim.style.cursor = 'none';
  }
}
function updatePlayersVisible() {
playersVisible = playersCheckbox.checked;
}

function updateBeamVisible() {
beamVisible = beamCheckbox.checked;
}

function updateHeadVisible() {
headVisible = headCheckbox.checked;
}

playersCheckbox.addEventListener('change', updatePlayersVisible);
headCheckbox.addEventListener('change', updateHeadVisible);
beamCheckbox.addEventListener('change', updateBeamVisible);

document.addEventListener('keydown', function(event) {
if (event.code === 'Slash') {
toggleGui();
}
});


//Drag render
gui.addEventListener('mousedown', function(event) {
if (event.button === 0) { // Ліва кнопка миші
isDraggingRender = true;
mouseOffsetX = event.clientX - gui.offsetLeft;
mouseOffsetY = event.clientY - gui.offsetTop;
}
});

document.addEventListener('mouseup', function(event) {
if (event.button === 0) {
isDraggingRender = false;
}
});

document.addEventListener('mousemove', function(event) {
if (isDraggingRender) {
gui.style.left = (event.clientX - mouseOffsetX) + 'px';
gui.style.top = (event.clientY - mouseOffsetY) + 'px';
}
});

//Drag misc
guim.addEventListener('mousedown', function(event) {
if (event.button === 0) { // Ліва кнопка миші
isDraggingMisc = true;
mouseOffsetX = event.clientX - guim.offsetLeft;
mouseOffsetY = event.clientY - guim.offsetTop;
}
});

document.addEventListener('mouseup', function(event) {
if (event.button === 0) {
isDraggingMisc = false;
}
});

document.addEventListener('mousemove', function(event) {
if (isDraggingMisc) {
guim.style.left = (event.clientX - mouseOffsetX) + 'px';
guim.style.top = (event.clientY - mouseOffsetY) + 'px';
}
});






//Water mark
const guiLLL = document.createElement('div');
guiLLL.id = 'gui-lll';
guiLLL.style.position = 'absolute';
guiLLL.style.top = '5px';
guiLLL.style.left = '50%';
guiLLL.style.transform = 'translateX(-50%)';
guiLLL.style.padding = '15px';
guiLLL.style.background = 'linear-gradient(to bottom, rgba(95, 0, 128, 1), rgba(31, 31, 31, 1))';
guiLLL.style.color = '#fff';
guiLLL.style.fontFamily = 'Arial';
guiLLL.style.fontSize = '16px';
guiLLL.style.borderRadius = '5px';
guiLLL.style.border = '1px solid #6a006a';
guiLLL.style.width = '350px';
guiLLL.style.textAlign = 'center';
guiLLL.style.zIndex = '2';

const titleLLL = document.createElement('div');
titleLLL.style.marginBottom = '30px';
titleLLL.style.fontWeight = 'bold';
titleLLL.style.fontSize = '25px';
titleLLL.innerHTML = 'Code Meteor`s Client';
guiLLL.appendChild(titleLLL);

document.body.appendChild(guiLLL);









//Buttons
const codepenLink = 'https://discord.gg/bgyYkxFdqT';
const buttonWrapper = document.createElement('div');
buttonWrapper.style.position = 'absolute';
buttonWrapper.style.top = '50px'; // змінено на 30px
buttonWrapper.style.left = '50%'; // змінено left на 50%
buttonWrapper.style.transform = 'translateX(-50%)'; // додано цей стиль для центрування по горизонталі
buttonWrapper.style.display = 'flex';
buttonWrapper.style.zIndex = '3';

const firstButton = document.createElement('a');
firstButton.href = codepenLink;
firstButton.target = '_blank';
firstButton.style.marginLeft = '5px';
firstButton.style.marginRight = '5px';
firstButton.style.padding = '10px 20px';
firstButton.style.borderRadius = '20px';
firstButton.style.background = 'linear-gradient(to bottom, rgba(95, 0, 128, 1), rgba(31, 31, 31, 1))';
firstButton.style.color = '#fff';
firstButton.style.fontFamily = 'Arial';
firstButton.style.fontSize = '16px';
firstButton.style.textDecoration = 'none';
firstButton.innerHTML = 'Join Discord';
firstButton.style.zIndex = '3';
firstButton.style.border = '1px solid #6a006a';

const secondButton = document.createElement('a');
secondButton.href = codepenLink;
secondButton.target = '_blank';
secondButton.style.marginLeft = '5px';
secondButton.style.marginRight = '5px';
secondButton.style.padding = '10px 20px';
secondButton.style.borderRadius = '20px';
secondButton.style.background = 'linear-gradient(to bottom, rgba(95, 0, 128, 1), rgba(31, 31, 31, 1))';
secondButton.style.color = '#fff';
secondButton.style.fontFamily = 'Arial';
secondButton.style.fontSize = '16px';
secondButton.style.textDecoration = 'none';
secondButton.innerHTML = 'Buy Full';
secondButton.style.zIndex = '3';
secondButton.style.border = '1px solid #6a006a';

buttonWrapper.appendChild(firstButton);
buttonWrapper.appendChild(secondButton);

document.body.appendChild(buttonWrapper);

// ...... SNOWFALL .......


(() => {
    'use strict';

    // Create a canvas element and append it to the body
    var canvas = document.createElement('canvas');
    canvas.style.position = 'fixed';
    canvas.style.top = '0';
    canvas.style.left = '0';
    canvas.style.pointerEvents = 'none';
    canvas.style.zIndex = '1'; // Set z-index to 1
    document.body.appendChild(canvas);

    // Set the canvas size to the window size
    canvas.width = window.innerWidth;
    canvas.height = window.innerHeight;

    // Get the 2D rendering context
    var ctx = canvas.getContext('2d');

    // Array to store the circles
    var circles = [];

    // Function to generate a random number within a range
    function getRandom(min, max) {
        return Math.random() * (max - min) + min;
    }

    // Function to create a circle object
    function createCircle() {
        var circle = {};
        circle.x = getRandom(0, canvas.width);
        circle.y = 0;
        circle.radius = getRandom(5, 15);
        circle.speed = getRandom(2, 4); // Generate speed in the range of 2 to 4
        return circle;
    }

    // Function to update the circles' positions and draw them on the canvas
    function updateCircle() {
        // Clear the canvas
        ctx.clearRect(0, 0, canvas.width, canvas.height);

        // Generate a new circle with a certain probability
        if (Math.random() < 0.1 && isSnowEnabled) { // Increased probability to generate circles
            var newCircle = createCircle();
            circles.push(newCircle);
        }

        // Update and draw the circles
        for (var i = 0; i < circles.length; i++) {
            var circle = circles[i];
            circle.y += circle.speed;

            ctx.beginPath();
            ctx.arc(circle.x, circle.y, circle.radius, 0, 2 * Math.PI);
            ctx.fillStyle = '#ffffff'; // White color
            ctx.fill();

            // Remove circles that are out of the screen
            if (circle.y - circle.radius > canvas.height) {
                circles.splice(i, 1);
                i--;
            }
        }
    }

    var isSnowEnabled = false;

    function toggleSnowfall() {
        isSnowEnabled = !isSnowEnabled;
    }

    // Add event listener to toggle snowfall on Insert key press
    document.addEventListener('keydown', function(event) {
        if (event.keyCode === 191) { // Insert key
            toggleSnowfall();
        }
    });

    // Remove the existing interval if it exists
    clearInterval(window.intervalId);

    // Set the interval for updating the circle
    window.intervalId = setInterval(updateCircle, 1); // Call updateCircle every 16 milliseconds
})();