Created
August 17, 2015 12:39
-
-
Save andyw330/cb4db81a3634108bee85 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Dcard 抽卡 | |
| // @version 1.0 | |
| // @description 讓抽卡更有趣 | |
| // @author A person in the world | |
| // @require https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js | |
| // @require https://gist.github.com/raw/2625891/waitForKeyElements.js | |
| // @match https://www.dcard.tw/* | |
| // @grant GM_addStyle | |
| // ==/UserScript== | |
| GM_addStyle(".dcard-photo-placeholder img {display: none;} .dcard-photo-placeholder + div tr:first-child td {color: #f9f9f9;}"); | |
| var card_hidder_html = '<img class="img-responsive img-responsive-center ng-isolate-scope" alt="Dcard logo QAQ" src="/img/logo.png" ng-src="/img/logo.png" style="display: block; padding: 175px 85px; background: rgb(31, 88, 122);">' | |
| waitForKeyElements ('div.dcard-photo-placeholder', actionFunction); | |
| function actionFunction(jNode){ | |
| var card = jNode.children().first(); | |
| jNode.prepend(card_hidder_html); | |
| var card_hidder = card.prev(); | |
| card_hidder.click(function(){ | |
| card_hidder.fadeOut('normal', function() { | |
| card.fadeIn(); | |
| }); | |
| }); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment