Greasy Fork

Super Duolingo 1.0

08:31:06 25/7/2024

目前为 2024-07-25 提交的版本。查看 最新版本

// ==UserScript==
// @name        Super Duolingo 1.0
// @namespace   Violentmonkey Scripts
// @match       https://www.duolingo.com/*
// @grant       none
// @version     1.0
// @author      -
// @description 08:31:06 25/7/2024
// ==/UserScript==
javascript:(function() {
    var container = document.createElement('div');
    container.style.textAlign = 'center';
    container.style.border = '2px dotted #00bfff';
    container.style.padding = '20px';
    container.style.backgroundColor = 'white';
    container.style.borderRadius = '15px';
    container.style.width = '300px';
    container.style.position = 'fixed';
    container.style.top = '20px';
    container.style.right = '20px';
    container.style.zIndex = '1000';
    container.style.display = 'none'; // Initially hidden
    container.style.cursor = 'move'; // Change cursor to move

    var titleContainer = document.createElement('div');
    titleContainer.style.display = 'flex';
    titleContainer.style.alignItems = 'center';
    titleContainer.style.justifyContent = 'center';
    titleContainer.style.marginBottom = '20px';

    var title = document.createElement('div');
    title.style.fontSize = '24px';
    title.style.marginRight = '10px';
    title.innerHTML = 'Type: <span style="font-weight: bold;">BASIC</span>';
    titleContainer.appendChild(title);

    var toggleButton = document.createElement('img');
    toggleButton.src = 'https://link-to-eye-closed-image.png'; // Eye closed image (initially closed)
    toggleButton.style.width = '30px';
    toggleButton.style.height = '30px';
    toggleButton.style.cursor = 'pointer';
    titleContainer.appendChild(toggleButton);

    container.appendChild(titleContainer);

    function createButton(text, color, url) {
        var button = document.createElement('button');
        button.innerText = text;
        button.style.display = 'block';
        button.style.width = '100%';
        button.style.padding = '10px';
        button.style.margin = '10px 0';
        button.style.fontSize = '18px';
        button.style.border = 'none';
        button.style.borderRadius = '5px';
        button.style.cursor = 'pointer';
        button.style.color = 'white';
        button.style.backgroundColor = color;
        button.onclick = function() {
            window.location.href = url;
        };
        container.appendChild(button);
    }

    createButton('Nhận Super Duolingo', '#800080', 'https://link4m.com/NuSazPwh');
    createButton('Đăng Kí Tài Khoản', '#008000', 'https://www.duolingo.com/register');
    createButton('Đăng Nhập Tài Khoản', '#0000ff', 'https://www.duolingo.com/?isLoggingIn=true');

    document.body.appendChild(container);

    toggleButton.onclick = function() {
        if (container.style.display === 'none') {
            container.style.display = 'block';
            toggleButton.src = 'https://link-to-eye-open-image.png'; // Eye open image
        } else {
            container.style.display = 'none';
            toggleButton.src = 'https://link-to-eye-closed-image.png'; // Eye closed image
        }
    };

    var offset = [0, 0];
    var isDown = false;

    container.addEventListener('mousedown', function(e) {
        isDown = true;
        offset = [
            container.offsetLeft - e.clientX,
            container.offsetTop - e.clientY
        ];
    }, true);

    document.addEventListener('mouseup', function() {
        isDown = false;
    }, true);

    document.addEventListener('mousemove', function(event) {
        event.preventDefault();
        if (isDown) {
            var mousePosition = {
                x: event.clientX,
                y: event.clientY
            };
            container.style.left = (mousePosition.x + offset[0]) + 'px';
            container.style.top = (mousePosition.y + offset[1]) + 'px';
        }
    }, true);
})();