您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a fading line mouse tail on top of webpages
当前为
// ==UserScript== // @name Useless Things Series: The Line // @version 1.0 // @description Adds a fading line mouse tail on top of webpages // @match *://*/* // @grant none // @license MIT // @namespace https://greasyfork.org/users/1126616 // ==/UserScript== (function() { 'use strict'; // Create the tail element const tail = document.createElement('div'); tail.style.position = 'fixed'; tail.style.top = '0'; tail.style.left = '0'; tail.style.width = '0'; tail.style.height = '4px'; tail.style.backgroundColor = 'red'; tail.style.opacity = '1'; tail.style.transition = 'width 0.3s linear, opacity 1s ease-out'; document.body.appendChild(tail); // Listen for mousemove event to update tail position document.addEventListener('mousemove', function(event) { const mouseX = event.clientX; const mouseY = event.clientY; tail.style.width = mouseX + 'px'; tail.style.opacity = '1'; }); // Smoothly fade out the tail let timeoutId; document.addEventListener('mousemove', function() { clearTimeout(timeoutId); timeoutId = setTimeout(function() { tail.style.opacity = '0'; }, 2000); }); })();