妖火论坛勋章加载器(紫薇版)

*://yaohuo.me/*

目前為 2025-08-29 提交的版本,檢視 最新版本

// ==UserScript==
// @name         妖火论坛勋章加载器(紫薇版)
// @namespace    https://yaohuo-me/
// @version      1.0
// @description  *://yaohuo.me/*
// @match        *://yaohuo.me/*
// @match        *://*.yaohuo.me/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // 勋章数据集 - 尺寸优化版
    const premiumBadges = [
        {
            title: "F1跑车",
            src: "/XinZhang/upload/1000/1000_0700400.gif",
            animation: "f1-gentlespin"
        },
        {
            title: "超级金牌",
            src: "bbs/medal/%E4%B8%AD%E5%9B%BD%E5%88%B6%E9%80%A0.gif",
            animation: "gold-subtleglow"
        },
        {
            title: "财运来",
            src: "XinZhang/upload/1000/1000_1501480.gif",
            animation: "dragon-softpulse"
        },
        {
            title: "百万派币",
            src: "bbs/medal/%E7%99%BE%E4%B8%87%E6%B4%BE%E5%B8%81.gif",
            animation: "money-subtlevibrance"
        },
        {
            title: "屌",
            src: "/bbs/medal/%E5%B1%8C.gif",
            animation: "icon-softtwinkle"
        }
    ];

    // 创建更柔和的动画关键帧
    const animationStyles = `
        @keyframes f1-gentlespin {
            0%, 100% { transform: rotateY(0deg); }
            50% { transform: rotateY(15deg); }
        }
        @keyframes gold-subtleglow {
            0%, 100% { filter: brightness(1); }
            50% { filter: brightness(1.2); }
        }
        @keyframes dragon-softpulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }
        @keyframes money-subtlevibrance {
            0% { filter: hue-rotate(0deg); }
            100% { filter: hue-rotate(20deg); }
        }
        @keyframes icon-softtwinkle {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.9; }
        }
    `;

    // 创建更自然的悬停效果
    const hoverStyles = `
        .compact-badge:hover {
            transform: scale(1.1);
            z-index: 100;
            transition: transform 0.3s ease;
        }
    `;

    // 创建样式元素
    const styleTag = document.createElement('style');
    styleTag.textContent = animationStyles + hoverStyles;
    document.head.appendChild(styleTag);

    // 查找并更新勋章容器
    const badgeContainer = document.querySelector('.xunzhangtupian');
    if (badgeContainer) {
        // 创建文档片段
        const fragment = document.createDocumentFragment();

        premiumBadges.forEach(badge => {
            const badgeElement = document.createElement('img');
            badgeElement.className = 'compact-badge';
            badgeElement.src = badge.src;
            badgeElement.alt = badge.title;
            badgeElement.title = badge.title;
            badgeElement.style.cssText = `
                width: 25px;
                height: 25px;
                margin: 0 1px;
                animation: ${badge.animation} 6s infinite linear;
                cursor: pointer;
                position: relative;
                transition: all 0.3s ease;
                object-fit: contain;
            `;

            fragment.appendChild(badgeElement);
        });

        // 批量插入到容器顶部
        badgeContainer.insertBefore(fragment, badgeContainer.firstChild);

        // 添加点击效果(更简约)
        document.addEventListener('click', function(e) {
            if (e.target.classList.contains('compact-badge')) {
                const badge = e.target;
                const originalAnim = badge.style.animation;
                badge.style.animation = 'none';

                setTimeout(() => {
                    badge.style.animation = originalAnim;
                }, 300);
            }
        });
    }
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址