smlwiki.com - change lil logan gif

press 0 to change him (tenor gif link only

目前為 2024-11-18 提交的版本,檢視 最新版本

// ==UserScript==
// @name         smlwiki.com - change lil logan gif
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  press 0 to change him (tenor gif link only
// @author       YourName
// @match        https://smlwiki.com/index.html
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    // Add an event listener for keypress
    document.addEventListener('keydown', function (event) {
        // Check if the key pressed is "0"
        if (event.key === '0') {
            // Create a popup menu
            const gifLink = prompt('Enter the Tenor GIF link:');
            if (gifLink) {
                // Find the target span and update the image source
                const targetSpan = document.querySelector('#lillogan a img');
                if (targetSpan) {
                    targetSpan.src = gifLink;
                    alert('GIF updated successfully!');
                } else {
                    alert('Target image not found.');
                }
            }
        }
    });
})();