Skip to content

Instantly share code, notes, and snippets.

@koyumeishi
Last active December 2, 2016 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koyumeishi/65f6efb0206b8cc0590623362808302a to your computer and use it in GitHub Desktop.
Save koyumeishi/65f6efb0206b8cc0590623362808302a to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name YukicoderRainbowColor
// @namespace YukicoderRainbowColor
// @description 解いた問題の色を虹色にするスクリプト
// @include http://yukicoder.me/*
// @include https://yukicoder.me/*
// @version 2
// @grant none
// ==/UserScript==
(
function(){
var key_frame = "" +
" 0% {background: #e0faea;}" +
" 16% {background: #e5f5ef;}" +
" 33% {background: #eaf0ea;}" +
" 50% {background: #eff5e5;}" +
" 66% {background: #eafae0;}" +
" 83% {background: #e5ffe5;}" +
" 100% {background: #e0faea;}";
var key_frame_hover = "" +
" 0% {background: #c0caea;}" +
" 16% {background: #c5c5ff;}" +
" 33% {background: #eac0ea;}" +
" 50% {background: #ffc5c5;}" +
" 66% {background: #eaeac0;}" +
" 83% {background: #c5ffc5;}" +
" 100% {background: #c0caea;}";
var new_css = "" +
" tr.solved:nth-child(3n+0) {" +
" animation : rainbow 1s -0s linear infinite !important;" +
" -moz-animation : rainbow 1s -0s linear infinite !important;" +
" -webkit-animation : rainbow 1s -0s linear infinite !important;" +
" }"+
" tr.solved:nth-child(3n+1) {" +
" animation : rainbow 1s -0.33s linear infinite !important;" +
" -moz-animation : rainbow 1s -0.33s linear infinite !important;" +
" -webkit-animation : rainbow 1s -0.33s linear infinite !important;" +
" }" +
" tr.solved:nth-child(3n+2) {" +
" animation : rainbow 1s -0.67s linear infinite !important;" +
" -moz-animation : rainbow 1s -0.67s linear infinite !important;" +
" -webkit-animation : rainbow 1s -0.67s linear infinite !important;" +
" }" +
" @keyframes rainbow {" + key_frame + "}" +
" @-moz-keyframes rainbow {" + key_frame + "}" +
" @-webkit-keyframes rainbow {" + key_frame + "}" +
" tr.solved:hover {" +
" animation : rainbow-hover 0.5s 0s linear infinite !important;" +
" -moz-animation : rainbow-hover 0.5s 0s linear infinite !important;" +
" -webkit-animation : rainbow-hover 0.5s 0s linear infinite !important;" +
" }" +
" @keyframes rainbow-hover {" + key_frame_hover + "}" +
" @-moz-keyframes rainbow-hover {" + key_frame_hover + "}" +
" @-webkit-keyframes rainbow-hover {" + key_frame_hover + "}" +
"";
var node = document.createElement('style');
node.type = "text/css";
var txt = document.createTextNode(new_css);
node.appendChild(txt);
document.head.appendChild(node);
})();
@koyumeishi
Copy link
Author

Greasemonkey / Tampermonkey 等をブラウザにインストールした状態で、右上にある [Raw] をクリックしてインストールしてください。
ライセンスは NYSL でお願いします。 http://www.kmonos.net/nysl/

@koyumeishi
Copy link
Author

パワーアップしました。 gradient も使おうかと思いましたが、面倒なのでやめました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment