Last active
August 29, 2015 14:02
-
-
Save toshinarin/3b722cdd6d65d73bdce4 to your computer and use it in GitHub Desktop.
Hex clockを高速化するブックマークレット http://www.jacopocolo.com/hexclock/
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(diff){ | |
var current = new Date().getTime(); | |
$('#tweet').remove(); | |
function refreshData2() | |
{ | |
var d = new Date(current += diff); | |
var h = d.getHours(); | |
var m = d.getMinutes(); | |
var s = d.getSeconds(); | |
if (h<=9) {h = '0'+h}; | |
if (m<=9) {m = '0'+m}; | |
if (s<=9) {s = '0'+s}; | |
var color = '#'+h+m+s; | |
$("div.background").css("background-color", color ); | |
$("p#hex").text(color); | |
setTimeout(refreshData2, 1); | |
} | |
refreshData2(); | |
}(1000); |
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(diff){var current=(new Date).getTime();$("#tweet").remove();function refreshData2(){var d=new Date(current+=diff);var h=d.getHours();var m=d.getMinutes();var s=d.getSeconds();if(h<=9){h="0"+h}if(m<=9){m="0"+m}if(s<=9){s="0"+s}var color="#"+h+m+s;$("div.background").css("background-color",color);$("p#hex").text(color);setTimeout(refreshData2,1)}refreshData2()}(1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hex clockを開いているタブのアドレスバーにlightning-hex-clock.min.jsのソースコードを貼り付け、
javascript:を頭につけてEnterキーを押してください。
行末の1000のところを変えるとスピードが変わります。