12ft.io Button

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

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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();
    }
})();