DINOcheat: hack/cheat dino google & chrome (bot,rapide,score,imortel...)

Utilisez les super fonctions pour avoir un dino sans limites !

질문, 리뷰하거나, 이 스크립트를 신고하세요.
// ==UserScript==
// @name            DINOcheat: hack/cheat dino google & chrome (bot,rapide,score,imortel...)
// @name:es         DINOcheat: hack/cheat dino google & chrome (bot, velocidad, puntaje, inmortalidad...)
// @name:en         DINOcheat: hack/cheat dino google & chrome (bot,speed,score,imortality...)
// @name:ja         DINOcheat: hack/cheat dino google & chrome (ボット、速度、スコア、不死身...)
// @name:it         DINOcheat: hack/cheat dino google & chrome (bot, velocità, punteggio, immortalità...)
// @namespace       http://tampermonkey.net/
// @version         2024-10-28-1.4.0
// @icon            https://github.com/DREwX-code/DINOcheat/blob/main/D%E2%84%9D%E2%88%83wX_image/D%E2%84%9D%E2%88%83wX_img.png?raw=true
// @description     Utilisez les super fonctions pour avoir un dino sans limites !
// @description:en  Use great features to have a dino without limits!
// @description:es  ¡Utiliza grandes características para tener un dino sin límites!
// @description:ja  特別な機能を駆使して、制限のないディノを手に入れよう!
// @description:it  Usa funzionalità fantastiche per avere un dino senza limiti!
// @author       Dℝ∃wX
// @match        *://chromedino.com/*
// @match        *://tuckercraig.com/dino/*
// @match        *://trex-runner.com/*
// @match        *://dino-chrome.com/*
// @match        *://dinorunner.com/*
// @match        *://googledino.com/*
// @grant        none
// @license      Apache-2.0
// ==/UserScript==

(function() {
    'use strict';

    let currentLang = 'en';
    const savedLang = localStorage.getItem('selectedLang');
    if(savedLang) {
        currentLang = savedLang;
    }


    function translate(key) {
        const translations = {
            'welcome': {
                'fr': '(Dℝ∃wX) Bonjour, merci d\'avoir choisi mon script. Amusez-vous bien ! ;)',
                'en': '(Dℝ∃wX) Hello, thank you for choosing my script. Have fun! ;)',
                'it': '(Dℝ∃wX) Ciao, grazie per aver scelto il mio script. Divertiti! ;)',
                'es': '(Dℝ∃wX) Hola, gracias por elegir mi script. ¡Diviértete! ;)'
            },
            'shortcutsTitle': {
                'fr': 'Liste des raccourcis',
                'en': 'List of shortcuts',
                'es': 'Lista de atajos',
                'it': 'Elenco delle scorciatoie'
            },
            'jumpDescription': {
                'fr': 'Ajuster la hauteur de saut du dino. La hauteur normale est 10.',
                'en': 'Adjust jump height of the dino. The normal jump height is 10.',
                'es': 'Ajustar la altura de salto del dino. La altura normal es 10.',
                'it': 'Regola l\'altezza del salto del dino. L\'altezza normale è 10.'
            },
            'jumpText': {
                'fr': 'Ajustement du saut',
                'en': 'Jump adjustment',
                'es': 'Ajuste de salto',
                'it': 'Regolazione del salto'
            },
            'speedDescription': {
                'fr': 'Ajuster la vitesse du jeu. La vitesse normale est 7.',
                'en': 'Adjust the speed of the game. Normal speed is 7.',
                'es': 'Ajustar la velocidad del juego. La velocidad normal es 7.',
                'it': 'Regola la velocità del gioco. La velocità normale è 7.'
            },
            'speedText': {
                'fr': 'Ajustement de la vitesse',
                'en': 'Speed adjustment',
                'es': 'Ajuste de velocidad',
                'it': 'Regolazione della velocità'
            },
            'immortalityDescription': {
                'fr': 'Devenez invincible dans le jeu.',
                'en': 'Become invincible in the game.',
                'es': 'Conviértete en invencible en el juego.',
                'it': 'Diventa invincibile nel gioco.'
            },
            'immortalityText': {
                'fr': 'Immortalité',
                'en': 'Immortality',
                'es': 'Inmortalidad',
                'it': 'Immortalità'
            },
            'flyDescription': {
                'fr': 'Volez dans les airs sans tomber.',
                'en': 'Fly through the air without falling.',
                'es': 'Vuela por el aire sin caer.',
                'it': 'Vola attraverso l\'aria senza cadere.'
            },
            'flyText': {
                'fr': 'Marcher dans les airs',
                'en': 'Walk in the air',
                'es': 'Caminar en el aire',
                'it': 'Camminare nell\'aria'
            },
            'scoreDescription': {
                'fr': 'Sélectionnez un score manuellement. Vous pouvez avoir le meilleur score.',
                'en': 'Select a score manually. You can have the best score.',
                'es': 'Selecciona un puntaje manualmente. Puedes tener el mejor puntaje.',
                'it': 'Seleziona un punteggio manualmente. Puoi avere il punteggio migliore.'
            },
            'scoreText': {
                'fr': 'Choisir le score',
                'en': 'Choose score',
                'es': 'Elige puntaje',
                'it': 'Scegli il punteggio'
            },
            'autoJumpDescription': {
                'fr': 'Activer le saut automatique pour le dino.',
                'en': 'Activate auto-jumping for the dino.',
                'es': 'Activar el salto automático para el dino.',
                'it': 'Attiva il salto automatico per il dino.'
            },
            'autoJumpText': {
                'fr': 'BotJumpAuto',
                'en': 'BotJumpAuto',
                'es': 'BotJumpAuto',
                'it': 'BotJumpAuto'
            },
            'addScoreDescription': {
                'fr': 'Ajoutez 1000 points à votre score.',
                'en': 'Add 1000 points to your score.',
                'es': 'Agrega 1000 puntos a tu puntaje.',
                'it': 'Aggiungi 1000 punti al tuo punteggio.'
            },
            'addScoreText': {
                'fr': 'Score + 1000',
                'en': 'Score + 1000',
                'es': 'Puntaje + 1000',
                'it': 'Punteggio + 1000'
            },
            'invisibleDescription': {
                'fr': 'Rendez votre personnage invisible. Très cool !',
                'en': 'Make your character invisible. Very cool!',
                'es': 'Haz que tu personaje sea invisible. ¡Muy genial!',
                'it': 'Rendi il tuo personaggio invisibile. Molto figo!'
            },
            'invisibleText': {
                'fr': 'Invisible',
                'en': 'Invisible',
                'es': 'Invisible',
                'it': 'Invisibile'
            },
            'breakDescription': {
                'fr': 'Mettre le jeu en pause. Utile si vous ne voulez pas perdre le score.',
                'en': 'Pause the game. Useful if you don’t want to lose the score.',
                'es': 'Pausar el juego. Útil si no quieres perder el puntaje.',
                'it': 'Metti in pausa il gioco. Utile se non vuoi perdere il punteggio.'
            },
            'breakText': {
                'fr': 'Pause',
                'en': 'Break',
                'es': 'Pausa',
                'it': 'Pausa'
            },
            'menuDescription': {
                'fr': 'Ouvrir ou fermer le menu. Pour un plus grand confort.',
                'en': 'Open or close the menu. For greater comfort.',
                'es': 'Abrir o cerrar el menú. Para mayor comodidad.',
                'it': 'Apri o chiudi il menu. Per maggiore comodità.'
            },
            'menuText': {
                'fr': 'Fermer/ouvrir le menu',
                'en': 'Close/open menu',
                'es': 'Cerrar/abrir menú',
                'it': 'Chiudi/apri menu'
            },
            'invalidJumpHeigh': {
                'fr': "Entrée invalide. Veuillez entrer un nombre.",
                'en': "Invalid input. Please enter a number.",
                'it': "Input non valido. Si prega di inserire un numero.",
                'es': "Entrada no válida. Por favor, ingrese un número."
            },
            'invalidSpeed': {
                'fr': "Vitesse invalide. Veuillez entrer un nombre.",
                'en': "Invalid speed. Please enter a number.",
                'it': "Velocità non valida. Si prega di inserire un numero.",
                'es': "Velocidad no válida. Por favor, ingrese un número."
            },
            'invalidIntegerScore': {
                'fr': "Entrée invalide. Veuillez entrer un entier inférieur à 999999.",
                'en': "Invalid input. Please enter an integer less than 999999.",
                'it': "Input non valido. Si prega di inserire un intero inferiore a 999999.",
                'es': "Entrada no válida. Por favor, ingrese un número entero menor que 999999."
            },
            'runnerInstanceNotAvailable': {
                'fr': "L'instance de Runner n'est pas disponible.",
                'en': "Runner instance is not available.",
                'it': "L'istanza Runner non è disponibile.",
                'es': "La instancia de Runner no está disponible."
            },
            'enterNewJumpHeight': {
                'fr': "Entrez la nouvelle hauteur de saut :",
                'en': "Enter the new jump height:",
                'it': "Inserisci la nuova altezza del salto:",
                'es': "Ingrese la nueva altura de salto:"
            },
            'enterNewScore': {
                'fr': "Entrez le nouveau score (entier, inférieur à 999990) :",
                'en': "Enter the new score (integer, less than 999990):",
                'it': "Inserisci il nuovo punteggio (numero intero, inferiore a 999990):",
                'es': "Ingrese el nuevo puntaje (entero, menos de 999990):"
            },
            'theAir': {
                'fr': "dans les airs",
                'en': "in the air",
                'it': "nell\'aria",
                'es': "en el aire"
            },
            'theGround': {
                'fr': "sur le sol",
                'en': "on the ground",
                'it': "su il suolo",
                'es': "en el suelo"
            },
            'chooseSpeed': {
                'fr': "Choisissez la vitesse :",
                'en': "Choose the speed:",
                'it': "Scegli la velocità:",
                'es': "Elige la velocidad:"
            },
            'menu': {
                'fr': "Menu",
                'en': "Menu",
                'it': "Menù",
                'es': "Menú"
            },
            'jumpHeight': {
                'fr': "Hauteur de saut",
                'en': "Jump height",
                'it': "Altezza del salto",
                'es': "Altura del salto"
            },
            'speedAdjustment': {
                'fr': "Ajustement de la vitesse",
                'en': "Speed adjustment",
                'it': "Regolazione della velocità",
                'es': "Ajuste de velocidad"
            },
            'chooseScore': {
                'fr': "Choisir le score",
                'en': "Choose score",
                'it': "Scegli il punteggio",
                'es': "Elegir puntaje"
            },
            'immortality': {
                'fr': "Immortalité",
                'en': "Immortality",
                'it': "Immortalità",
                'es': "Inmortalidad"
            },
            'botJumpAuto': {
                'fr': "BotJumpAuto",
                'en': "BotJumpAuto",
                'it': "BotJumpAuto",
                'es': "BotJumpAuto"
            },
            'invisible': {
                'fr': "Invisible",
                'en': "Invisible",
                'it': "Invisibile",
                'es': "Invisible"
            },
            'scorePlus': {
                'fr': "Score +",
                'en': "Score +",
                'it': "Punteggio +",
                'es': "Puntaje +"
            },
            'walkIn': {
                'fr': "Marcher",
                'en': "Walk",
                'it': "Camminare",
                'es': "Caminar"
            },
            'dinoTheme': {
                'fr': "Thème Dino",
                'en': "Dino theme",
                'it': "Tema Dino",
                'es': "Tema Dino"
            },
            'optionsTitle': {
                'fr': "Options",
                'en': "Options",
                'it': "Opzioni",
                'es': "Opciones"
            },
            'shortcutsLabel': {
                'fr': "Raccourcis",
                'en': "Shortcuts",
                'it': "Scorciatoie",
                'es': "Atajos"
            },
            'breakLabel': {
                'fr': "Pause",
                'en': "Break",
                'it': "Pausa",
                'es': "Descanso"
            },
            'ratingLabel': {
                'fr': "Évaluez le script :",
                'en': "Rate the script:",
                'it': "Valuta lo script:",
                'es': "Califica el script:"
            },
            'switchLabelLang': {
                'fr': "Langue :",
                'en': "Language :",
                'it': "Lingua :",
                'es': "Idioma :"
            },
            'creditLabel': {
                'fr': "Crédit par Dℝ∃wX",
                'en': "Credit by Dℝ∃wX",
                'it': "Credito di Dℝ∃wX",
                'es': "Crédito por Dℝ∃wX"
            },
            'color': {
                'fr': "Couleur",
                'en': "Color",
                'it': "Colore",
                'es': "Color"
            },
            'mario': {
                'fr': "Mario",
                'en': "Mario",
                'it': "Mario",
                'es': "Mario"
            },
            'trump': {
                'fr': "Trump",
                'en': "Trump",
                'it': "Trump",
                'es': "Trump"
            },
            'joker': {
                'fr': "Joker",
                'en': "Joker",
                'it': "Joker",
                'es': "Joker"
            },
            'batman': {
                'fr': "Batman",
                'en': "Batman",
                'it': "Batman",
                'es': "Batman"
            },
            'night': {
                'fr': "Nuit",
                'en': "Night",
                'it': "Notte",
                'es': "Noche"
            },
            'squid_game': {
                'fr': "Squid Game",
                'en': "Squid Game",
                'it': "Squid Game",
                'es': "Squid Game"
            },
            'santa': {
                'fr': "Père Noël",
                'en': "Santa",
                'it': "Babbo Natale",
                'es': "Santa"
            },
            'halloween': {
                'fr': "Halloween",
                'en': "Halloween",
                'it': "Halloween",
                'es': "Halloween"
            },
            'wednesday': {
                'fr': "Wednesday",
                'en': "Wednesday",
                'it': "Wednesday",
                'es': "Wednesday"
            },
            'naruto': {
                'fr': "Naruto",
                'en': "Naruto",
                'it': "Naruto",
                'es': "Naruto"
            },
            'naruto2': {
                'fr': "Naruto 2",
                'en': "Naruto 2",
                'it': "Naruto 2",
                'es': "Naruto 2"
            },
            'godzilla': {
                'fr': "Godzilla",
                'en': "Godzilla",
                'it': "Godzilla",
                'es': "Godzilla"
            },
            'cat': {
                'fr': "Chat",
                'en': "Cat",
                'it': "Gatto",
                'es': "Gato"
            },
            'ninja': {
                'fr': "Ninja",
                'en': "Ninja",
                'it': "Ninja",
                'es': "Ninja"
            },
            'classic': {
                'fr': "Classique",
                'en': "Classic",
                'it': "Classico",
                'es': "Clásico"
            },
            'dontShowAgain': {
                'fr': "Ne plus afficher le message",
                'en': "Don't show this message again",
                'it': "Non mostrare più questo messaggio",
                'es': "No volver a mostrar este mensaje"
            },

        };


        return translations[key][currentLang];
    }


    if (window.location.href.startsWith("https://chromedino.com/") ||
        window.location.href.startsWith("https://tuckercraig.com/dino/")) {

        var menuFooter = document.querySelector('footer.other-versions.__wrapper ul');

        if (menuFooter) {
            var newMenuItem = document.createElement('li');
            var newLink = document.createElement('a');
            newLink.href = "#";
            newLink.innerHTML = `
    <img src="https://raw.githubusercontent.com/DREwX-code/DINOcheat/refs/heads/main/Dℝ∃wX_image/Dℝ∃wX_img.png" width="40">
    <span>${translate('menu')}</span>
`;

            newMenuItem.appendChild(newLink);
            menuFooter.appendChild(newMenuItem);

            newLink.addEventListener('click', function(e) {
                e.preventDefault();
                toggleMenuPopup();
            });
        }

    } else if (window.location.href.startsWith("https://dino-chrome.com/") ||
               window.location.href.startsWith("https://googledino.com/")) {

        var mainMenu = document.querySelector('nav.main-menu');
        if (mainMenu) {
            var divider = document.createElement('span');
            divider.className = 'divider';

            var newLink1 = document.createElement('a');
            newLink1.href = "#";
            newLink1.textContent = translate('menu');
            newLink1.style.cursor = 'pointer';

            newLink1.addEventListener('click', function(e) {
                e.preventDefault();
                toggleMenuPopup();
            });

            mainMenu.appendChild(divider);
            mainMenu.appendChild(newLink1);
        }
    } else if (window.location.href.startsWith("https://trex-runner.com/")) {

        var existingMenuDiv = document.querySelector('.menu');

        if (existingMenuDiv) {
            var menuLink = document.createElement('a');
            menuLink.href = "#";
            menuLink.innerHTML = `
                <img src="https://raw.githubusercontent.com/DREwX-code/DINOcheat/refs/heads/main/Dℝ∃wX_image/Dℝ∃wX_img.png">
                <span>${translate('menu')}</span>
            `;

            menuLink.addEventListener('click', function(e) {
                e.preventDefault();
                toggleMenuPopup();
            });

            existingMenuDiv.appendChild(menuLink);
        }
    }


    if (window.location.hostname === "dinorunner.com") {

        const style = document.createElement('style');
        style.innerHTML = `
                .super-error-popup-overlay {
                    position: fixed;
                    top: 0;
                    left: 0;
                    width: 100%;
                    height: 100%;
                    background: rgba(0, 0, 0, 0.4);
                    z-index: 9998;
                    display: none;
                    opacity: 0;
                    transition: opacity 0.3s ease;
                }
                .super-error-popup {
                    position: fixed;
                    top: 50%;
                    left: 50%;
                    transform: translate(-50%, -50%) scale(0.7);
                    width: 80%;
                    max-width: 600px;
                    padding: 20px;
                    background: rgba(255, 255, 255, 0.9);
                    border: 1px solid black;
                    border-radius: 12px;
                    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
                    z-index: 9999;
                    display: none;
                    opacity: 0;
                    transition: transform 0.3s ease, opacity 0.3s ease;
                }
                .super-error-popup.open {
                    transform: translate(-50%, -50%) scale(1);
                    opacity: 1;
                }
                .super-error-popup .close-btn {
                    position: absolute;
                    top: 10px;
                    right: 10px;
                    cursor: pointer;
                    font-size: 24px;
                    font-weight: bold;
                    color: red;
                    transition: color 0.3s ease;
                }
                .super-error-popup .close-btn:hover {
                    color: #ff4c4c;
                }
                .super-error-popup .content {
                    padding-top: 20px;
                    font-size: 20px;
                }
                .super-error-popup .content a {
                    color: #007bff;
                    text-decoration: none;
                }
                .super-error-popup .content a:hover {
                    text-decoration: underline;
                }
            `;
        document.head.appendChild(style);

        const overlay = document.createElement('div');
        overlay.className = 'super-error-popup-overlay';
        document.body.appendChild(overlay);

        const popup = document.createElement('div');
        popup.className = 'super-error-popup';
        popup.innerHTML = `
                <span class="close-btn">&times;</span>
                <div class="content">
                    (Dℝ∃wX) Hello, sorry but this script does not work on this site. I advise you to use this site <a href="https://chromedino.com/" target="_blank">https://chromedino.com/</a>
                </div>
            `;
        document.body.appendChild(popup);

        function openErrorPopup() {
            overlay.style.display = 'block';
            popup.style.display = 'block';
            setTimeout(() => {
                overlay.style.opacity = '1';
                popup.classList.add('open');
            }, 10);
        }

        function closeErrorPopup() {
            popup.classList.remove('open');
            overlay.style.opacity = '0';
            setTimeout(() => {
                overlay.style.display = 'none';
                popup.style.display = 'none';
            }, 300);
        }

        popup.querySelector('.close-btn').addEventListener('click', closeErrorPopup);
        overlay.addEventListener('click', closeErrorPopup);

        openErrorPopup();

        return;
    }


    function touche(key) {
        const keyCodes = {
            'ArrowUp': 38,
            'ArrowDown': 40,
            'ArrowLeft': 37,
            'ArrowRight': 39,
        };

        const keyCode = keyCodes[key] || key.charCodeAt(0);

        var event = new KeyboardEvent('keydown', {
            key: key,
            keyCode: keyCode,
            which: keyCode,
            bubbles: true
        });

        document.dispatchEvent(event);
    }



    function updateButtonText(newText) {
        const airWalkButton = document.getElementById('toggleAirWalkButton');

        airWalkButton.textContent = newText;
    }



    let isShortcutEnabled = false;

    let menuPopup = null;
    let windowElement = null;


    function injectDistanceCode() {
        const distanceCode = "Runner.instance_.distanceRan = Runner.instance_.distanceRan + 1000 / Runner.instance_.distanceMeter.config.COEFFICIENT";


        eval(distanceCode);
    }


    const popupStyles = document.createElement('style');
    popupStyles.innerHTML = `
                .modern-menu-popup {
                    position: fixed;
                    top: 50px;
                    left: 50px;
                    width: 300px;
                    height: auto;
                    max-height: 400px;
                    background: rgba(255, 255, 255, 0.9);
                    border: 1px solid #333;
                    border-radius: 12px;
                    padding: 20px;
                    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
                    z-index: 9999;
                    display: none;
                    opacity: 0;
                    transition: opacity 0.3s ease, transform 0.3s ease;
                }
                .modern-menu-popup.open {
                    display: block;
                    opacity: 1;
                    transform: scale(1);
                }
                .modern-menu-popup .header {
                    text-align: center;
                    font-weight: bold;
                    margin-bottom: 15px;
                    font-size: 18px;
                    color: #333;
                }
                .modern-menu-popup .content {
                    font-size: 16px;
                    color: #555;
                }
                .modern-menu-popup .content span {
                    display: block;
                    margin-bottom: 8px;
                }


                .modern-menu-popup .dropdown {
            position: relative;
            display: block;
            cursor: pointer;
            margin-top: 10px;
        }

        .modern-menu-popup .dropdown-title {
            font-weight: bold;
            cursor: pointer;
        }

        .modern-menu-popup .dropdown-content {
            display: none;
            position: absolute;
            background-color: #fff;
            margin-top: 8px;
            padding: 12px;
            border: 1px solid #ddd;
            border-radius: 10px;
            box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
            max-height: 250px;
            overflow-y: auto;
            z-index: 1000;
            transition: all 0.3s ease;
        }

        .modern-menu-popup .dropdown-content::-webkit-scrollbar {
            width: 8px;
        }

        .modern-menu-popup .dropdown-content::-webkit-scrollbar-thumb {
            background-color: #bbb;
            border-radius: 4px;
        }

        .modern-menu-popup .dropdown-content::-webkit-scrollbar-thumb:hover {
            background-color: #888;
        }

        .modern-menu-popup .theme-option {
            padding: 8px;
            display: block;
            cursor: pointer;
        }

        .modern-menu-popup .theme-option:hover {
            background-color: #ddd;

        }


                .btn-small-discreet {
                    background-color: #f0f0f0;
                    color: #555;
                    padding: 5px 10px;
                    border: 1px solid #ccc;
                    border-radius: 3px;
                    font-size: 12px;
                    cursor: pointer;
                }

                .btn-small-discreet:hover {
                    background-color: #e0e0e0;
                }

                        .input-small-discreet {
                    width: 80px;
                    padding: 5px;
                    border: 1px solid #ccc;
                    border-radius: 4px;
                }


        .menu-icon {
            width: 25px;
            height: 18px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            position: absolute;
            right: 15px;
            top: 10px;
            cursor: pointer;
            z-index: 1001;
        }

        .menu-icon .bar {
            height: 3px;
            width: 100%;
            background-color: #555;
            border-radius: 2px;
        }

        .side-panel {
            width: 0;
            height: 100%;
            position: fixed;
            top: 0;
            right: 0;
            background-color: #eaeaea;
            border-radius: 10px;
            overflow-x: hidden;
            transition: width 0.4s ease, border-radius 0.4s ease, background-color 0.4s ease;
            box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
            z-index: 1000;
        }

        .side-panel.open {
            width: 100%;
            border-radius: 10px;
            background-color: #f0f0f0;
        }

        .side-panel:hover {
            box-shadow: -6px 0 18px rgba(0, 0, 0, 0.2);
        }

        .side-panel-content {
            padding: 20px;
            opacity: 0;
            transform: translateY(10px);
            transition: opacity 0.4s ease, transform 0.4s ease;
        }

        .side-panel.open .side-panel-content {
            opacity: 1;
            transform: translateY(0);
        }


        .options-title {
            text-align: center;
            font-size: 20px;
            margin-bottom: 20px;
            color: #444;
        }

        .switch-container {
            display: flex;
            align-items: center;
            font-size: 14px;
            color: #333;
        }

        .switch-label {
            margin-right: 8px;
            color: #808080;
        }

        .discreet-switch {
            position: relative;
            display: inline-block;
            width: 40px;
            height: 20px;
        }

        .discreet-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }


        .switch-icon {
            width: 24px;
            height: 24px;
            color: #555;
            cursor: pointer;
        }

        .slider {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ddd;
            border-radius: 30px;
            cursor: pointer;
            transition: 0.4s;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 16px;
            width: 16px;
            left: 2px;
            bottom: 2px;
            background-color: white;
            transition: 0.4s;
            border-radius: 50%;
        }

        input:checked + .slider {
            background-color: #4CAF50;
        }

        input:checked + .slider:before {
            transform: translateX(20px);
        }

        .slider.round {
            border-radius: 30px;
        }

        .slider.round:before {
            border-radius: 50%;
        }

        .credits {
            position: absolute;
            bottom: 10px;
            width: 100%;
            text-align: center;
            font-size: 12px;
            color: #888;
        }

        .credits span {
            display: block;
            font-family: 'Courier New', Courier, monospace;
            letter-spacing: 1px;
        }

        .rating-container {
            margin-top: 20px;
            text-align: center;
        }

        .rating-container {
            display: flex;
            align-items: center;
            margin-top: 20px;
        }

        .rating-label {
            font-size: 14px;
            color: #333;
            margin-right: 10px;
        }

        .rating-stars {
            text-decoration: none;
            color: #f5c518;
            font-size: 20px;
            display: flex;
            align-items: center;
        }

        .rating-stars span {
            margin-right: 2px;
        }

        .icon-spacing {
        margin-right: 8px;
        }




            `;
    document.head.appendChild(popupStyles);




    let isInvisibleActive = false;

    document.addEventListener('keydown', function(event) {
        if (event.key === 'n' && isShortcutEnabled) {
            toggleInvisible();
        }
    });


    let invisibleInterval;

    function toggleInvisible() {
        if (!isInvisibleActive) {
            Runner.instance_.tRex.config.HEIGHT = -20;
            document.getElementById('toggleCheckboxInvisible').checked = true;
        } else {
            Runner.instance_.tRex.config.HEIGHT = 47;
            document.getElementById('toggleCheckboxInvisible').checked = false;
        }

        isInvisibleActive = !isInvisibleActive;
    }



    let isBotActive = false;

    document.addEventListener('keydown', function(event) {
        if (event.key === 'b' && isShortcutEnabled) {
            toggleBot();
        }
    });


    let botInterval;

    function toggleBot() {
        if (!isBotActive) {
            function dispatchKey(type, key) {
                document.dispatchEvent(new KeyboardEvent(type, { keyCode: key }));
            }

            botInterval = setInterval(function () {
                const KEY_CODE_SPACE_BAR = 32;
                const KEY_CODE_ARROW_DOWN = 40;
                const CANVAS_HEIGHT = Runner.instance_.dimensions.HEIGHT;
                const DINO_HEIGHT = Runner.instance_.tRex.config.HEIGHT;

                const obstacle = Runner.instance_.horizon.obstacles[0];
                const speed = Runner.instance_.currentSpeed;

                if (obstacle) {
                    const w = obstacle.width;
                    const x = obstacle.xPos;
                    const y = obstacle.yPos;
                    const yFromBottom = CANVAS_HEIGHT - y - obstacle.typeConfig.height;
                    const isObstacleNearby = x < 25 * speed - w / 2;

                    if (isObstacleNearby) {
                        if (yFromBottom > DINO_HEIGHT) {
                        } else if (y > CANVAS_HEIGHT / 2) {
                            dispatchKey("keyup", KEY_CODE_ARROW_DOWN);
                            dispatchKey("keydown", KEY_CODE_SPACE_BAR);
                        } else {
                            dispatchKey("keydown", KEY_CODE_ARROW_DOWN);
                        }
                    }
                }
            }, Runner.instance_.msPerFrame);

            document.getElementById('toggleCheckboxBot').checked = true;
        } else {
            clearInterval(botInterval);
            document.getElementById('toggleCheckboxBot').checked = false;
        }

        isBotActive = !isBotActive;
    }



    let isImmortal = false;

    document.addEventListener('keydown', function(event) {
        if (event.key === 'i' && isShortcutEnabled) {
            toggleImmortality()

        }
    });


    let originalGameOver = Runner.prototype.gameOver;

    function toggleImmortality() {
        if (!isImmortal) {
            Runner.prototype.gameOver = function () {};
            document.getElementById('toggleCheckboxImmortality').checked = true;
        } else {

            Runner.prototype.gameOver = originalGameOver;
            document.getElementById('toggleCheckboxImmortality').checked = false;
        }

        isImmortal = !isImmortal;
    }



    let isBreak = false;

    document.addEventListener('keydown', function(event) {
        if (event.key === 'p' && isShortcutEnabled) {
            functionBreak();
        }
    });

    function functionBreak() {
        if (Runner.instance_.paused) {
            Runner.instance_.play();
        } else {
            Runner.instance_.stop();
        }
    }



    function openShortcutsPanel() {
        let shortcutsPanel = document.getElementById('shortcutsPanel');

        if (!shortcutsPanel) {
            shortcutsPanel = document.createElement('div');
            shortcutsPanel.id = 'shortcutsPanel';
            shortcutsPanel.innerHTML = `
            <span id="closeShortcutsPanel" style="position: absolute; top: 10px; right: 15px; cursor: pointer; font-size: 20px;">&times;</span>
            <h3>${translate('shortcutsTitle')}</h3>
            <ul id="shortcutsList">
                <li data-description="${translate('jumpDescription')}">${translate('jumpText')}: <strong>"h"</strong></li>
                <li data-description="${translate('speedDescription')}">${translate('speedText')}: <strong>"v"</strong></li>
                <li data-description="${translate('immortalityDescription')}">${translate('immortalityText')}: <strong>"i"</strong></li>
                <li data-description="${translate('flyDescription')}">${translate('flyText')}: <strong>"a"</strong></li>
                <li data-description="${translate('scoreDescription')}">${translate('scoreText')}: <strong>"k"</strong></li>
                <li data-description="${translate('autoJumpDescription')}">${translate('autoJumpText')}: <strong>"b"</strong></li>
                <li data-description="${translate('addScoreDescription')}">${translate('addScoreText')}: <strong>"s"</strong></li>
                <li data-description="${translate('invisibleDescription')}">${translate('invisibleText')}: <strong>"n"</strong></li>
                <li data-description="${translate('breakDescription')}">${translate('breakText')}: <strong>"p"</strong></li>
                <li data-description="${translate('menuDescription')}">${translate('menuText')}: <strong>"t"</strong></li>
            </ul>
            <div id="descriptionPanel" style="margin-top: 10px; color: #666; display: none;"></div>
        `;

            document.body.appendChild(shortcutsPanel);

            shortcutsPanel.style.position = 'fixed';
            shortcutsPanel.style.top = '0';
            shortcutsPanel.style.right = '-350px';
            shortcutsPanel.style.width = '300px';
            shortcutsPanel.style.height = '100%';
            shortcutsPanel.style.backgroundColor = '#ffffff';
            shortcutsPanel.style.borderLeft = '1px solid #ddd';
            shortcutsPanel.style.borderRadius = '8px';
            shortcutsPanel.style.boxShadow = '-2px 0 10px rgba(0, 0, 0, 0.2)';
            shortcutsPanel.style.padding = '20px';
            shortcutsPanel.style.zIndex = '2000';
            shortcutsPanel.style.transition = 'right 0.3s ease';
            shortcutsPanel.style.display = 'none';
        }

        if (shortcutsPanel.style.display === 'none') {
            shortcutsPanel.style.display = 'block';
            setTimeout(() => {
                shortcutsPanel.style.right = '0';
            }, 10);

            document.getElementById('closeShortcutsPanel').addEventListener('click', closeShortcutsPanel);
        } else {
            closeShortcutsPanel();
        }

        const listItems = document.querySelectorAll('#shortcutsList li');
        const descriptionPanel = document.getElementById('descriptionPanel');

        listItems.forEach(item => {
            item.addEventListener('mouseover', function() {
                const description = this.getAttribute('data-description');
                descriptionPanel.innerText = description;
                descriptionPanel.style.display = 'block';
            });

            item.addEventListener('mouseout', function() {
                descriptionPanel.style.display = 'none';
            });
        });
    }

    function closeShortcutsPanel() {
        const shortcutsPanel = document.getElementById('shortcutsPanel');

        shortcutsPanel.style.right = '-350px';
        setTimeout(() => {
            shortcutsPanel.remove();
        }, 300);
    }

    function closeShortcutsPanelFast() {
        const shortcutsPanel = document.getElementById('shortcutsPanel');
        shortcutsPanel.remove();

    }



    function toggleMenuPopup() {
        if (!menuPopup) {
            menuPopup = document.createElement('div');
            menuPopup.className = 'modern-menu-popup';
            menuPopup.innerHTML = `
                    <head><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"></head>
                    <div class="header">
                    <div class="menu-icon" id="menuIcon">
                    <div class="bar"></div>
                    <div class="bar"></div>
                    <div class="bar"></div>
                    </div>${translate('menu')}</div>
                    <div class="content">
                    <span>${translate('jumpHeight')} <input type="number" id="jumpHeightInput" class="input-small-discreet" placeholder="10"></span>
                    <span>${translate('speedAdjustment')} <input type="number" id="speedInput" class="input-small-discreet" placeholder="7"></span>
                    <span>${translate('chooseScore')} <input type="number" id="scoreInput" class="input-small-discreet" placeholder="00000"></span>
                    <span>${translate('immortality')} <label> <input type="checkbox" id="toggleCheckboxImmortality"></label></span>
                    <span>${translate('botJumpAuto')} <label> <input type="checkbox" id="toggleCheckboxBot"></label></span>
                    <span>${translate('invisible')} <label> <input type="checkbox" id="toggleCheckboxInvisible"></label></span>
                    <span>${translate('scorePlus')} <button id="increaseScoreButton" class="btn-small-discreet"> 1000 </button></span>
                    <span>${translate('walkIn')} <button id="toggleAirWalkButton" class="btn-small-discreet">${translate('theAir')}</button></span>
                    <div class="dropdown">
                        <span class="dropdown-title">${translate('dinoTheme')}</span>
                              <div class="dropdown-content">
                              <span class="theme-option" data-theme="color">${translate('color')}</span>
                              <span class="theme-option" data-theme="mario">${translate('mario')}</span>
                              <span class="theme-option" data-theme="trump">${translate('trump')}</span>
                              <span class="theme-option" data-theme="joker">${translate('joker')}</span>
                              <span class="theme-option" data-theme="batman">${translate('batman')}</span>
                              <span class="theme-option" data-theme="night">${translate('night')}</span>
                              <span class="theme-option" data-theme="squid_game">${translate('squid_game')}</span>
                              <span class="theme-option" data-theme="santa">${translate('santa')}</span>
                              <span class="theme-option" data-theme="halloween">${translate('halloween')}</span>
                              <span class="theme-option" data-theme="wednesday">${translate('wednesday')}</span>
                              <span class="theme-option" data-theme="naruto">${translate('naruto')}</span>
                              <span class="theme-option" data-theme="naruto2">${translate('naruto2')}</span>
                              <span class="theme-option" data-theme="godzilla">${translate('godzilla')}</span>
                              <span class="theme-option" data-theme="cat">${translate('cat')}</span>
                              <span class="theme-option" data-theme="ninja">${translate('ninja')}</span>
                              <span class="theme-option" data-theme="classic">${translate('classic')}</span>

                            </div>
                        </div>
                    </div>

<div id="sidePanel" class="side-panel">
    <div class="side-panel-content">
        <h2 class="options-title">${translate('optionsTitle')}</h2>

        <div class="switch-container">
            <span class="switch-label">${translate('shortcutsLabel')}</span>
            <svg id="eyeIcon" class="switch-icon icon-spacing" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                <path d="M1.73 12c1.36-2.15 4.3-7 10.27-7s8.91 4.85 10.27 7c-1.36 2.15-4.3 7-10.27 7S3.09 14.15 1.73 12zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"></path>
            </svg>
            <label class="discreet-switch">
                <input type="checkbox" id="toggleShortcut">
                <span class="slider round"></span>
            </label>
        </div>

        <div class="switch-container">
            <span class="switch-label">${translate('breakLabel')}</span>
            <svg id="breakIcon" class="switch-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                <rect x="6" y="4" width="3" height="16"></rect>
                <rect x="15" y="4" width="3" height="16"></rect>
            </svg>
        </div>

        <div class="rating-container">
            <span class="rating-label">${translate('ratingLabel')}</span>
            <a href="https://greasyfork.org/en/scripts/486972-dinocheat-hack-cheat-dino-google-chrome-bot-rapide-score-imortel/feedback?locale_override=1" target="_blank" class="rating-stars">
                ⭐️ ⭐️ ⭐️ ⭐️ ⭐️
            </a>
        </div>

<div class="choice-contain">
  <span class="rating-label">${translate('switchLabelLang')}</span>
  <div id="flag-selector" class="flag-conteneur">
    <img id="selected-flag" src="https://upload.wikimedia.org/wikipedia/en/a/ae/Flag_of_the_United_Kingdom.svg" alt="Selected Flag" class="flag-selected" data-lang="en" />
    <div id="flag-list" class="flag-list">
      <img class="flag-option" src="https://upload.wikimedia.org/wikipedia/en/a/ae/Flag_of_the_United_Kingdom.svg" alt="English" data-lang="en" />
      <img class="flag-option" src="https://upload.wikimedia.org/wikipedia/en/c/c3/Flag_of_France.svg" alt="Français" data-lang="fr" />
      <img class="flag-option" src="https://upload.wikimedia.org/wikipedia/commons/9/9a/Flag_of_Spain.svg" alt="Español" data-lang="es" />
      <img class="flag-option" src="https://upload.wikimedia.org/wikipedia/en/0/03/Flag_of_Italy.svg" alt="Italiano" data-lang="it" />
    </div>
  </div>
</div>


<style>
  .choice-contain {
    z-index: 9999;
    display: flex;
    align-items: center;
    font-family: Arial, sans-serif;
    margin-top: 20px;
  }

  .flag-conteneur {
    position: relative;
    margin-left: 10px;
  }

  .flag-selected {
    width: 35px;
    height: 25px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 5px;
    border: 1px solid #ddd;
  }

  .flag-selected:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }

  .flag-list {
    position: absolute;
    width: 100%;
    top: 0; /* Aligner sur le même axe vertical que le drapeau cliqué */
    left: 50px; /* Ajuster la distance vers la droite pour placer la liste à côté */
    max-height: 100px;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    padding: 10px;
    z-index: 9999;
    display: none;
  }

  .flag-list.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
  }

  .flag-list::-webkit-scrollbar {
    width: 8px;
  }

  .flag-list::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 5px;
  }

  .flag-list::-webkit-scrollbar-thumb:hover {
    background-color: #555;
  }

  .flag-option {
    width: 35px;
    height: 25px;
    cursor: pointer;
    margin: 5px 0;
    transition: transform 0.3s ease, background-color 0.3s ease;
    border-radius: 5px;
    border: 1px solid transparent;
  }

  .flag-option:hover {
    transform: scale(1.05);
    background-color: #f9f9f9;
    border: 1px solid #ddd;
  }
</style>


    </div>

    <div class="credits">
    <span>${translate('creditLabel')}</span>
    </div>
    </div>



                `;

            document.body.appendChild(menuPopup);
            setTimeout(() => {
                menuPopup.classList.add('open');
            }, 10);


            const checkbox = document.getElementById('toggleCheckbox');
            const statusText = document.getElementById('status');
            const selectedFlag = document.getElementById('selected-flag');
            const flagList = document.getElementById('flag-list');
            const flagOptions = document.querySelectorAll('.flag-option');


            function changeLanguage(flag) {
                const newLang = flag.getAttribute('data-lang');
                const newSrc = flag.src;

                selectedFlag.src = newSrc;
                selectedFlag.setAttribute('data-lang', newLang);

                localStorage.setItem('selectedLang', newLang);

                currentLang = newLang;

                flagList.classList.remove('show');
            }


            function loadLanguage() {
                const savedLang = localStorage.getItem('selectedLang');
                if (savedLang) {
                    const flag = document.querySelector(`.flag-option[data-lang="${savedLang}"]`);
                    if (flag) {
                        selectedFlag.src = flag.src;
                        selectedFlag.setAttribute('data-lang', savedLang);
                        currentLang = savedLang;
                    }
                } else {
                    selectedFlag.src = 'https://upload.wikimedia.org/wikipedia/en/a/ae/Flag_of_the_United_Kingdom.svg';
                    selectedFlag.setAttribute('data-lang', 'en');
                    currentLang = 'en';
                }
            }

            selectedFlag.addEventListener('click', function () {
                if (flagList.classList.contains('show')) {
                    flagList.classList.remove('show');
                } else {
                    flagList.classList.add('show');
                    loadLanguage();
                }
            });

            flagOptions.forEach(function (flag) {
                flag.addEventListener('click', function () {
                    changeLanguage(flag);
                    closeMenuPopupFast();
                    setTimeout(() => {
                        toggleMenuPopup();
                    }, 20);

                    if (shortcutsPanel) {
                        closeShortcutsPanelFast();
                        setTimeout(() => {
                            openShortcutsPanel();
                        }, 2);
                    }
                });
            });

            function closeMenuPopupFast() {
                if (menuPopup) {
                    menuPopup.style.display = 'none';
                    setTimeout(() => {
                        if (document.body.contains(menuPopup)) {
                            document.body.removeChild(menuPopup);
                            menuPopup = null;
                        }
                    }, 1);
                }
            }


            document.addEventListener('click', function (e) {
                if (!document.getElementById('flag-selector').contains(e.target)) {
                    flagList.classList.remove('show');
                }
            });


            document.addEventListener('DOMContentLoaded', function () {
                loadLanguage();
            });
            loadLanguage();



            document.getElementById('toggleShortcut').addEventListener('change', function() {
                isShortcutEnabled = this.checked;
            });



            function detectEyeClick() {
                const eyeIcon = document.getElementById('eyeIcon');

                if (eyeIcon) {
                    eyeIcon.addEventListener('click', function() {
                        openShortcutsPanel();
                    });
                }
            }
            detectEyeClick();


            function detectBreakClick() {
                const breakIcon = document.getElementById('breakIcon');

                if (breakIcon) {
                    breakIcon.addEventListener('click', function() {
                        functionBreak();
                    });
                }
            }
            detectBreakClick();



            document.getElementById('toggleCheckboxBot').addEventListener('change', function() {
                if (this.checked) {
                    toggleBot()
                } else {
                    toggleBot()
                }
            });

            document.getElementById('toggleCheckboxInvisible').addEventListener('change', function() {
                if (this.checked) {
                    toggleInvisible()
                } else {
                    toggleInvisible()
                }
            });

            document.getElementById('toggleCheckboxImmortality').addEventListener('change', function() {
                if (this.checked) {
                    toggleImmortality()
                } else {
                    toggleImmortality()
                }
            });

            document.getElementById('menuIcon').addEventListener('click', function() {
                const sidePanel = document.getElementById('sidePanel');
                sidePanel.classList.toggle('open');
                const dropdownContent = document.querySelector('.dropdown-content');
                dropdownContent.style.display = 'none';
            });



            document.querySelector('.dropdown-title').addEventListener('click', function() {
                const dropdownContent = document.querySelector('.dropdown-content');
                dropdownContent.style.display = dropdownContent.style.display === 'block' ? 'none' : 'block';
            });

            document.querySelectorAll('.theme-option').forEach(option => {
                option.addEventListener('click', function() {
                    let theme = this.getAttribute('data-theme');
                    applyTheme(theme);
                });
            });



            let isDragging = false;
            let offsetX, offsetY;

            const header = menuPopup.querySelector('.header');

            document.getElementById('jumpHeightInput').addEventListener('change', function() {
                const jumpHeight = parseFloat(this.value);
                if (!isNaN(jumpHeight)) {
                    Runner.instance_.tRex.setJumpVelocity(jumpHeight);
                } else {
                    alert(translate('invalidJumpHeigh'));
                }
            });


            document.getElementById('speedInput').addEventListener('change', function() {
                const speed = parseFloat(this.value);
                if (!isNaN(speed)) {
                    Runner.instance_.setSpeed(speed);
                } else {
                    alert(translate('invalidSpeed'));
                }
            });


            document.getElementById('scoreInput').addEventListener('change', function() {
                const newScore = parseInt(this.value, 10);
                if (!isNaN(newScore) && Number.isInteger(newScore) && newScore <= 999999) {
                    Runner.instance_.distanceRan = newScore / Runner.instance_.distanceMeter.config.COEFFICIENT;
                } else {
                    alert(translate('invalidIntegerScore'));
                }
            });


            function increaseScore() {
                const scoreIncrement = 1000;
                if (Runner.instance_) {
                    Runner.instance_.distanceRan += scoreIncrement / Runner.instance_.distanceMeter.config.COEFFICIENT;
                } else {
                    alert(translate('runnerInstanceNotAvailable'));
                }
            }


            document.getElementById('increaseScoreButton').addEventListener('click', increaseScore);



            let isWalkingInTheAir = false;

            document.getElementById('toggleAirWalkButton').addEventListener('click', function() {
                if (isWalkingInTheAir) {
                    Runner.instance_.tRex.groundYPos = 93;
                    updateButtonText(translate('theAir'));
                    touche('ArrowUp');

                } else {
                    Runner.instance_.tRex.groundYPos = 0;
                    updateButtonText(translate('theGround'));
                    touche('ArrowUp');

                }

                isWalkingInTheAir = !isWalkingInTheAir;
            });

            if (window.location.href.startsWith("https://dino-chrome.com/") ||
                window.location.href.startsWith("https://googledino.com/")) {
                for (let i = 0; i < document.styleSheets.length; i++) {
                    let styleSheet = document.styleSheets[i];

                    try {
                        for (let j = 0; j < styleSheet.cssRules.length; j++) {
                            let rule = styleSheet.cssRules[j];

                            if (rule.selectorText && rule.selectorText.includes('*')) {
                                styleSheet.deleteRule(j);
                                break;
                            }
                        }
                    } catch (e) {
                    }
                }

                let elements = document.querySelectorAll('.rating-stars');

                elements.forEach(element => {
                    element.style.textDecoration = 'none';
                });
            }



            header.addEventListener('mousedown', function(event) {
                isDragging = true;
                offsetX = event.clientX - menuPopup.offsetLeft;
                offsetY = event.clientY - menuPopup.offsetTop;
                header.style.cursor = 'grabbing';
            });

            document.addEventListener('mousemove', function(event) {
                if (isDragging) {
                    menuPopup.style.left = event.clientX - offsetX + 'px';
                    menuPopup.style.top = event.clientY - offsetY + 'px';
                }
            });

            document.addEventListener('mouseup', function() {
                if (isDragging) {
                    isDragging = false;
                    header.style.cursor = 'move';
                }
            });

        } else {
            menuPopup.classList.remove('open');
            setTimeout(() => {
                if (menuPopup && document.body.contains(menuPopup)) {
                    document.body.removeChild(menuPopup);
                    menuPopup = null;
                }
            }, 300);
        }
    }


    document.addEventListener('keydown', function(event) {
        if (event.key === 'h' && isShortcutEnabled) {
            const userInput = prompt(translate('enterNewJumpHeight'));
            const jumpHeight = parseFloat(userInput);
            if (!isNaN(jumpHeight)) {
                Runner.instance_.tRex.setJumpVelocity(jumpHeight);
                document.getElementById('jumpHeightInput').value = jumpHeight;
            } else {
                alert(translate('invalidJumpHeigh'));
            }
        }
    });

    function applyTheme(theme) {
        if (theme === 'color') {
            document.getElementById('offline-resources-1x').src = 'https://chromedino.com/assets/chromedino_coloured-1x.png';
            document.getElementById('offline-resources-2x').src = 'https://chromedino.com/assets/chromedino_coloured-2x.png';
            document.body.style.backgroundColor = '#f7f7f7';
        } else if (theme === 'mario') {
            document.getElementById('offline-resources-1x').src = 'https://chromedino.com/assets/offline-sprite-1x-mario.png';
            document.getElementById('offline-resources-2x').src = 'https://chromedino.com/assets/offline-sprite-2x-mario.png';
            document.body.style.backgroundColor = '#75a6fa';
        } else if (theme === 'trump') {
            document.getElementById('offline-resources-1x').src = 'https://dino-chrome.com/trumpino-game/trump1x.png';
            document.getElementById('offline-resources-2x').src = 'https://dino-chrome.com/trumpino-game/trump2x.png';
            document.body.style.backgroundColor = '#f7f7f7';
        }
        else if (theme === 'joker') {
            document.getElementById('offline-resources-1x').src = 'https://chromedino.com/assets/joker1x.png';
            document.getElementById('offline-resources-2x').src = 'https://chromedino.com/assets/joker2x.png';
            document.body.style.backgroundColor = '#f7f7f7';
        }
        else if (theme === 'batman') {
            document.getElementById('offline-resources-1x').src = 'https://chromedino.com/assets/batman1x.png';
            document.getElementById('offline-resources-2x').src = 'https://chromedino.com/assets/batman2x.png';
            document.body.style.backgroundColor = '#000000';
        }
        else if (theme === 'night') {
            document.getElementById('offline-resources-1x').src = 'https://chromedino.com/assets/offline-sprite-1x-black.png';
            document.getElementById('offline-resources-2x').src = 'https://chromedino.com/assets/offline-sprite-2x-black.png';
            document.body.style.backgroundColor = '#000000';
        }
        else if (theme === 'squid_game') {
            document.getElementById('offline-resources-1x').src = 'https://dinorunner.com/static/images/squid-game/squid_game1x.png';
            document.getElementById('offline-resources-2x').src = 'https://dinorunner.com/static/images/squid-game/squid_game2x.png';
            document.body.style.backgroundColor = '#f7f7f7';
        }
        else if (theme === 'santa') {
            document.getElementById('offline-resources-1x').src = 'https://dinorunner.com/static/images/santa/offline-sprite-1x-santa.png';
            document.getElementById('offline-resources-2x').src = 'https://dinorunner.com/static/images/santa/offline-sprite-2x-santa.png';
            document.body.style.backgroundColor = '#f7f7f7';
        }
        else if (theme === 'halloween') {
            document.getElementById('offline-resources-1x').src = 'https://dinorunner.com/static/images/halloween/offline-sprite-1x-halloween.png';
            document.getElementById('offline-resources-2x').src = 'https://dinorunner.com/static/images/halloween/offline-sprite-2x-halloween.png';
            document.body.style.backgroundColor = '#584766';
        }
        else if (theme === 'wednesday') {
            document.getElementById('offline-resources-1x').src = 'https://dinorunner.com/static/images/wednesday/wednesday1x.png';
            document.getElementById('offline-resources-2x').src = 'https://dinorunner.com/static/images/wednesday/wednesday2x.png';
            document.body.style.backgroundColor = '#f7f7f7';
        }
        else if (theme === 'naruto') {
            document.getElementById('offline-resources-1x').src = 'https://dinorunner.com/static/images/naruto/offline-sprite-1x-naruto.png';
            document.getElementById('offline-resources-2x').src = 'https://dinorunner.com/static/images/naruto/offline-sprite-2x-naruto.png';
            document.body.style.backgroundColor = '#f7f7f7';
        }
        else if (theme === 'naruto2') {
            document.getElementById('offline-resources-1x').src = 'https://trex-runner.com/img/offline-sprite-1x-naruto.png';
            document.getElementById('offline-resources-2x').src = 'https://trex-runner.com/img/offline-sprite-2x-naruto.png';
            document.body.style.backgroundColor = '#e1f7fa';
        }
        else if (theme === 'godzilla') {
            document.getElementById('offline-resources-1x').src = 'https://dinorunner.com/static/images/godzilla/godzilla.png';
            document.getElementById('offline-resources-2x').src = 'https://dinorunner.com/static/images/godzilla/godzillax2.png';
            document.body.style.backgroundColor = '#2e2e2e';

        }
        else if (theme === 'cat') {
            document.getElementById('offline-resources-1x').src = 'https://dinosaur-game.io/game/nyancat/img/cat.png';
            document.getElementById('offline-resources-2x').src = 'https://dinosaur-game.io/game/nyancat/img/catx2.png';
            document.body.style.backgroundColor = '#000000';
        }
        else if (theme === 'ninja') {
            document.getElementById('offline-resources-1x').src = 'https://t-rex-runner.com/t-rex/assets/offline-sprite-1x.png';
            document.getElementById('offline-resources-2x').src = 'https://t-rex-runner.com/t-rex/assets/offline-sprite-2x.png';
            document.body.style.backgroundColor = '#f7f7f7';
        }
        else if (theme === 'classic') {
            document.getElementById('offline-resources-1x').src = 'https://dino-chrome.com/static/images/1.png';
            document.getElementById('offline-resources-2x').src = 'https://dino-chrome.com/static/images/2.png';
            document.body.style.backgroundColor = '#f7f7f7';
        }
    }

    document.addEventListener('keydown', function(event) {
        if (event.key === 't' && isShortcutEnabled) {
            toggleMenuPopup();
        }
    });



    const style = document.createElement('style');
    style.innerHTML = `
                .super-itck-popup-overlay {
                    position: fixed;
                    top: 0;
                    left: 0;
                    width: 100%;
                    height: 100%;
                    background: rgba(0, 0, 0, 0.4);
                    z-index: 9998;
                    display: none;
                    opacity: 0;
                    transition: opacity 0.3s ease;
                }
                .super-itck-popup {
                    position: fixed;
                    top: 50%;
                    left: 50%;
                    transform: translate(-50%, -50%) scale(0.7);
                    width: 80%;
                    max-width: 600px;
                    padding: 20px;
                    background: rgba(255, 255, 255, 0.9);
                    border: 1px solid black;
                    border-radius: 12px;
                    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
                    z-index: 9999;
                    display: none;
                    opacity: 0;
                    transition: transform 0.3s ease, opacity 0.3s ease;
                }
                .super-itck-popup.open {
                    transform: translate(-50%, -50%) scale(1);
                    opacity: 1;
                }
                .super-itck-popup .close-btn {
                    position: absolute;
                    top: 10px;
                    right: 10px;
                    cursor: pointer;
                    font-size: 24px;
                    font-weight: bold;
                    color: red;
                    transition: color 0.3s ease;
                }
                .super-itck-popup .close-btn:hover {
                    color: #ff4c4c;
                }
                .super-itck-popup .content {
                    padding-top: 20px;
                    font-size: 20px;
                }

                .dont-show-again {
                 display: flex;
                align-items: center;
                font-size: 12px; /* Petite taille de police */
                color: #555; /* Couleur de texte discrète */
                margin-top: 10px; /* Un peu d'espace au-dessus */
                }

                .dont-show-again input[type="checkbox"] {
                margin-right: 5px; /* Espacement entre la case à cocher et le texte */
                }

                .dont-show-again label {
                cursor: pointer; /* Curseur survolant le texte */
                color: #777; /* Couleur de texte encore plus discrète */
                }

                .dont-show-again label:hover {
                color: #000; /* Couleur plus visible au survol */
                }

            `;
    document.head.appendChild(style);


    const overlay = document.createElement('div');
    overlay.className = 'super-itck-popup-overlay';
    document.body.appendChild(overlay);

    const popup = document.createElement('div');
    popup.className = 'super-itck-popup';
    popup.innerHTML = `
    <span class="close-btn">&times;</span>
    <div class="content">
        ${translate('welcome')}
        <div class="dont-show-again">
            <label>
                <input type="checkbox" id="hidePopupCheckbox">
                ${translate('dontShowAgain')}
            </label>
        </div>
    </div>
`;

    document.body.appendChild(popup);

    function openPopup() {
        if (localStorage.getItem('hidePopup') === 'true') {
            toggleMenuPopup();
            return;
        }

        overlay.style.display = 'block';
        popup.style.display = 'block';
        setTimeout(() => {
            overlay.style.opacity = '1';
            popup.classList.add('open');
        }, 10);
    }

    function closePopup() {
        popup.classList.remove('open');
        overlay.style.opacity = '0';

        const hidePopup = document.getElementById('hidePopupCheckbox').checked;
        if (hidePopup) {
            localStorage.setItem('hidePopup', 'true');
        }

        setTimeout(() => {
            overlay.style.display = 'none';
            popup.style.display = 'none';
            toggleMenuPopup();
        }, 300);
    }

    popup.querySelector('.close-btn').addEventListener('click', closePopup);
    overlay.addEventListener('click', closePopup);

    openPopup();




    document.addEventListener('keydown', function(event) {
        if (event.key === 'v' && isShortcutEnabled) {
            const userInput = prompt(translate('chooseSpeed'));
            const speed = parseFloat(userInput);
            if (!isNaN(speed)) {
                Runner.instance_.setSpeed(speed);
                document.getElementById('speedInput').value = speed;
            } else {
                alert(translate('invalidSpeed'));
            }
        }
    });


    let isWalkingInTheAir = false;


    document.addEventListener('keydown', function(event) {
        if (event.key === 'a' && isShortcutEnabled) {

            if (isWalkingInTheAir) {
                Runner.instance_.tRex.groundYPos = 93;
                updateButtonText(translate('theAir'));
                touche('ArrowUp');
            } else {
                Runner.instance_.tRex.groundYPos = 0;
                updateButtonText(translate('theGround'));
                touche('ArrowUp');
            }

            isWalkingInTheAir = !isWalkingInTheAir;
        }
    });


    document.addEventListener('keydown', function(event) {
        if (event.key === 'k' && isShortcutEnabled) {
            const userInput = prompt(translate('enterNewScore'));
            const newScore = parseInt(userInput, 10);
            if (!isNaN(newScore) && Number.isInteger(newScore) && newScore < 999990) {
                Runner.instance_.distanceRan = newScore / Runner.instance_.distanceMeter.config.COEFFICIENT;
                document.getElementById('scoreInput').value = newScore;
            } else {
                alert(translate('invalidIntegerScore'));
            }
        }
    });


    document.addEventListener('keydown', function(event) {
        if (event.key === 's' && isShortcutEnabled) {
            injectDistanceCode();
        }
    });


})();