footer2078

Dynamic backgrounf for a footer

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/491234/1351460/footer2078.js

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

$(document).ready(function () {
    $('.brand').hover(function () {
        var dynamicBgHeight;

        if ($(this).find('.fa-microsoft').length > 0) {
            dynamicBgHeight = 410;
        } else if ($(this).find('.fa-apple').length > 0) {
            dynamicBgHeight = 250;
        } else if ($(this).find('.fa-linkedin').length > 0) {
            dynamicBgHeight = 370;
        } else if ($(this).find('.fa-discord').length > 0) {
            dynamicBgHeight = 330;
        } else if ($(this).find('.fa-facebook').length > 0) {
            dynamicBgHeight = 370;
        } else if ($(this).find('.fa-twitter').length > 0) {
            dynamicBgHeight = 330;
        } else if ($(this).find('.fa-google').length > 0) {
            dynamicBgHeight = 290;
        } else if ($(this).find('.fa-telegram').length > 0) {
            dynamicBgHeight = 370;
        } else if ($(this).find('.fa-paypal').length > 0) {
            dynamicBgHeight = 300;
        }

        if ($(this).find('.dynamic-background').length === 0) {
            var dynamicBg = $('<div class="dynamic-background"></div>').css({
                'position': 'absolute',
                'border-radius': '5px',
                'bottom': '0',
                'left': '0',
                'width': '35px',
                'height': '0',
                'background-color': 'rgba(0, 0, 0, 0.5)',
                'z-index': '-1',
                'transition': 'height 0.3s ease'
            });
            $(this).prepend(dynamicBg);
        }

        $(this).find('.dynamic-background').css('height', dynamicBgHeight + 'px');

    }, function () {
        $(this).find('.dynamic-background').css('height', '0');
    });
});