12ft.io Button

Adds a button to load the page with 12ft.io/

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

Advertisement:

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

Advertisement:

// ==UserScript==
// @name         12ft.io Button
// @namespace    http://tampermonkey.net/
// @version      1.0.2
// @description  Adds a button to load the page with 12ft.io/
// @author       ils94
// @match        *://*/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    function addButton() {
        if (document.getElementById('twelveFtButton')) return;

        let button = document.createElement('button');
        button.id = 'twelveFtButton';
        button.innerText = '12ft.io';
        button.style.position = 'fixed';
        button.style.bottom = '20px';
        button.style.right = '20px';
        button.style.zIndex = '9999';
        button.style.width = '60px';
        button.style.height = '60px';
        button.style.borderRadius = '50%';
        button.style.display = 'flex';
        button.style.alignItems = 'center';
        button.style.justifyContent = 'center';
        button.style.fontSize = '14px';
        button.style.fontWeight = 'bold';
        button.style.backgroundColor = '#ff9800';
        button.style.color = '#fff';
        button.style.border = 'none';
        button.style.boxShadow = '0px 4px 6px rgba(0, 0, 0, 0.2)';
        button.style.cursor = 'pointer';
        button.style.transition = 'transform 0.2s ease, box-shadow 0.2s ease';

        button.addEventListener('mouseover', function() {
            button.style.transform = 'scale(1.1)';
            button.style.boxShadow = '0px 6px 10px rgba(0, 0, 0, 0.3)';
        });

        button.addEventListener('mouseout', function() {
            button.style.transform = 'scale(1)';
            button.style.boxShadow = '0px 4px 6px rgba(0, 0, 0, 0.2)';
        });

        button.addEventListener('click', function() {
            window.location.href = 'https://12ft.io/' + window.location.href;
        });

        document.body.appendChild(button);
    }

    function waitForBody() {
        if (document.body) {
            addButton();
        } else {
            new MutationObserver((mutations, observer) => {
                if (document.body) {
                    observer.disconnect();
                    addButton();
                }
            }).observe(document.documentElement, {
                childList: true
            });
        }
    }

    if (!window.location.href.startsWith('https://12ft.io/')) {
        waitForBody();
    }
})();