Created
April 14, 2014 02:27
-
-
Save rubyonrailsworks/10611557 to your computer and use it in GitHub Desktop.
consoleTrick
This file contains 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
function consoleTrick() { | |
console.clear(); | |
var rainbowStyle = 'background-image:-webkit-gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2),color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22) );color:transparent;-webkit-background-clip: text;font-size:2em;'; | |
var msg = "来自博主的问候:欢迎来访,美图奉上 \\(^____^)/"; | |
console.log("%c", "padding:50px 300px;line-height:120px;background:url('http://wayouliu.duapp.com/img/tagsImg/youth.gif') no-repeat;"); | |
console.log('%c' + msg, rainbowStyle); | |
var picNo = getRandomInt(1, 16); | |
console.log("Print out the " + picNo + "th image."); | |
console.log("%c", "padding:165px 150px;line-height:350px;background:url('http://wayouliu.duapp.com/img/tagsImg/" + picNo + ".jpg') no-repeat;"); | |
console.log("%c 试试F5刷新", "color:green;"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment