您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add animation to keys-button hex on Spellsbee website when matching key is pressed.
// ==UserScript== // @name Spellsbee Animation // @namespace http://tampermonkey.net/ // @version 0.1 // @icon https://image.winudf.com/v2/image1/Y29tLnNtcGxlYS5zcGVsbGluZ2JlZV9pY29uXzE2NzIzMzQ0NDRfMDk3/icon.webp?w=280&fakeurl=1&type=.webp // @description Add animation to keys-button hex on Spellsbee website when matching key is pressed. // @author David // @match https://spellsbee.com/* // @grant GM_addStyle // ==/UserScript== (function() { 'use strict'; // Add your custom CSS animations GM_addStyle(` @keyframes pulse { 0% { transform: scale(1); background-color: transparent; } 50% { transform: scale(1.2); background-color: rgba(128, 128, 128, 0.5); } 100% { transform: scale(1); background-color: transparent; } } @keyframes fastPulse { 0% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(1.2); filter: brightness(1.5); } 100% { transform: scale(1); filter: brightness(1); } } .pulse-animation { animation: pulse 0.5s; } .fast-pulse-animation { animation: fastPulse 0.5s; } `); // Add keydown event listener to the page document.addEventListener('keydown', function(event) { const keyPressed = event.key.toLowerCase(); const hexButtons = document.querySelectorAll('.keys-button.hex, .keys-button.middle.hex'); hexButtons.forEach(button => { const buttonText = button.textContent.trim().toLowerCase(); if (keyPressed === buttonText) { if (button.classList.contains('middle')) { button.classList.add('fast-pulse-animation'); setTimeout(() => { button.classList.remove('fast-pulse-animation'); }, 200); } else { button.classList.add('pulse-animation'); setTimeout(() => { button.classList.remove('pulse-animation'); }, 200); } } }); }); })();