imgur animated upvote/downvote fireworks

adds an animation to upvote/downvote

目前为 2015-07-05 提交的版本。查看 最新版本

// ==UserScript==
// @name         imgur animated upvote/downvote fireworks
// @namespace    http://porath.org/
// @version      0.11
// @description  adds an animation to upvote/downvote
// @author       porath
// @match        http://imgur.com/*
// @grant        none
// ==/UserScript==

$('#mainUpArrow').append('<div id="upvote_firework" style="display: none; position: absolute"><img src="http://i.imgur.com/YEzlDPG.png" /></div>');
$('#mainDownArrow').append('<div id="downvote_firework" style="display: none; position: absolute"><img src="http://i.imgur.com/5WTwxi9.png" /></div>');

$('#mainUpArrow').on('click', function () {
    if ($('#mainUpArrow').hasClass('pushed')) {
        return;
    }
			
    $('#upvote_firework').css("top", -39);
    $('#upvote_firework').css("left", -80);
    
    $('#upvote_firework').show();
    
    window.setTimeout(function() { // wait, then hide the animation
        $('#upvote_firework').hide();
    }, 1000);
});

$('#mainDownArrow').on('click', function () {
    if ($('#mainDownArrow').hasClass('pushed')) {
        return;
    }
			
    $('#downvote_firework').css("top", -39);
    $('#downvote_firework').css("left", -39);
    
    $('#downvote_firework').show();
    
    window.setTimeout(function() { // wait, then hide the animation
        $('#downvote_firework').hide();
    }, 1000);
});

QingJ © 2025

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