Created
March 2, 2010 15:57
-
-
Save tetsuharuohzeki/319600 to your computer and use it in GitHub Desktop.
0時を過ぎると「もう寝ろよ」と優しくabout:blankに書き出してくれるUserScript
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 Do Sleep | |
// @namespace http://gist.github.com/saneyuki | |
// @include about:blank | |
// @developper saneyuki | |
// ==/UserScript== | |
(function(){ | |
var sleep = 0; | |
var wakeup = 5; | |
var now = (new Date()).getHours(); | |
if (sleep <= now && now < wakeup) { | |
var neroyo = document.createTextNode("もう寝ろよ"); | |
var wrapNeroyo = document.createElement("div"); | |
wrapNeroyo.appendChild(neroyo); | |
// Text style | |
wrapNeroyo.style.fontWeight = "bold"; | |
wrapNeroyo.style.fontSize = "5em"; | |
// box style | |
wrapNeroyo.style.height = "1em"; | |
wrapNeroyo.style.width = "5em"; | |
wrapNeroyo.style.position = "absolute"; | |
wrapNeroyo.style.top = "50%"; | |
wrapNeroyo.style.left = "50%"; | |
wrapNeroyo.style.marginTop = "-0.5em"; | |
wrapNeroyo.style.marginLeft = "-2.5em"; | |
document.getElementsByTagName("body")[0].appendChild(wrapNeroyo); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment