FV - Daily Wheel

Add a link to the Daily Wheel on the Daily Streak page.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         FV - Daily Wheel
// @version      1.1.2
// @description  Add a link to the Daily Wheel on the Daily Streak page.
// @author       msjanny (#7302)
// @match        https://www.furvilla.com/dailies*
// @match        https://www.furvilla.com/wheel*
// @grant        none
// @namespace https://greasyfork.org/users/319295
// ==/UserScript==

(function() {
    'use strict';
  /* globals $:false */

    $('document').ready( function() {
        var url = window.location.href;
        if (url.includes('furvilla.com/dailies')) {
            $('h2').eq(0).append($('<a href="https://www.furvilla.com/wheel" class="btn">Daily Wheel</a>'));

            if ($('.btn[value="Claim Reward"]').length) {
                var elemTop = $('.btn[value="Claim Reward"]').last().offset().top;
                var elemBottom = elemTop + $('.btn[value="Claim Reward"]').last().height();

                // add 'scroll down' indicator
                var btn = $('<i class="fas fa-arrow-circle-down"></i>');
                btn.css({'font-size': '50px','position': 'fixed','bottom': '20px','right': '20px','z-index': '3','cursor':'pointer'});
                $('.left-column').append(btn);

                if ($(window).scrollTop() + $(window).height() >= elemTop)
                    btn.hide();

                btn.click(function() {
                    $('html, body').animate({scrollTop:elemBottom-$(window).height()}, '300');
                });

                // check if unclaimed rewards at bottom of screen
                $(window).scroll(function() {
                    if ($(window).scrollTop() + $(window).height() >= elemTop)
                        btn.hide();
                    else
                        btn.show();
                });
            }
        }
        else
            $('.header-right-toolbar-buttons').append($('<a href="https://www.furvilla.com/inventory?type=is_openable&sort=new_old" class="btn">Inventory</a>'));

    });
})();