Visible Copy Confirmation Feedback

Provides a visual feedback when you copy text using Ctrl+C.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Visible Copy Confirmation Feedback
// @namespace    http://tampermonkey.net/
// @version      1.0.1
// @description  Provides a visual feedback when you copy text using Ctrl+C.
// @author       Donff Roodus
// @match        *://*/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    document.addEventListener('keydown', function(e) {
        if (e.ctrlKey && e.key === 'c') {
            showCopyFeedback();
        }
    });

    function showCopyFeedback() {
        // Create the feedback element
        let feedbackElement = document.createElement('div');
        feedbackElement.textContent = 'Copied to clipboard!';
        document.body.appendChild(feedbackElement);

        // Style the feedback element
        Object.assign(feedbackElement.style, {
            position: 'fixed',
            top: '20px',
            right: '20px',
            backgroundColor: '#4CAF50',
            color: 'white',
            padding: '15px',
            borderRadius: '5px',
            zIndex: '9999',
            fontSize: '16px',
            opacity: '0',
            transition: 'opacity 0.5s'
        });

        // Animate the feedback
        setTimeout(() => {
            feedbackElement.style.opacity = '1';
        }, 10);

        // Remove the feedback element after a few seconds
        setTimeout(() => {
            feedbackElement.style.opacity = '0';
            setTimeout(() => {
                document.body.removeChild(feedbackElement);
            }, 500);
        }, 2000);
    }
})();