Suno - Highlight Now Playing

Make now playing more obvious

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Suno - Highlight Now Playing
// @namespace    http://tampermonkey.net/
// @version      2024-12-05
// @description  Make now playing more obvious
// @author       trus0und
// @match        https://suno.com/create
// @icon         https://www.google.com/s2/favicons?sz=64&domain=suno.com
// @grant        GM_addStyle
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Inject CSS for the static #ff13f0 solid border
    GM_addStyle(`
        .css-efn502 {
            border: 2px solid #ff13f0; /* Solid pink border */
            border-radius: 4px; /* Optional: Add rounded corners */
        }
    `);

    // Function to apply the class to all .css-efn502 elements
    function applySolidBorder() {
        const elements = document.querySelectorAll('.css-efn502');
        elements.forEach(element => {
            if (!element.classList.contains('solid-border-applied')) {
                element.classList.add('solid-border-applied');
                element.classList.add('css-efn502');
            }
        });
    }

    // Initial application
    applySolidBorder();

    // Set up a MutationObserver to watch for dynamically added elements
    const observer = new MutationObserver(mutations => {
        mutations.forEach(mutation => {
            mutation.addedNodes.forEach(node => {
                if (node.nodeType === Node.ELEMENT_NODE && node.matches('.css-efn502')) {
                    applySolidBorder();
                }
            });
        });
    });

    // Start observing the entire document for changes
    observer.observe(document.body, { childList: true, subtree: true });

    console.log("Static #ff13f0 border script initialized and actively observing .css-efn502 elements.");
})();