-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwtf.user.js
56 lines (52 loc) · 1.42 KB
/
wtf.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// ==UserScript==
// @name wtf.js
// @include *
// ==/UserScript==
function addJQuery(callback) {
var j =document.createElement("script");
j.setAttribute("type", "text/javascript");
j.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js");
j.addEventListener('load', function() {
var script = document.createElement("script");
script.textContent = "(" + callback.toString() + ")();";
document.body.appendChild(script);
}, false);
document.body.appendChild(j);
}
function main() {
(function($)
{
$.fn.blink = function(options)
{
var defaults = { delay:500 };
var options = $.extend(defaults, options);
return this.each(function()
{
var obj = $(this);
setInterval(function()
{
if($(obj).css("visibility") == "visible")
{
$(obj).css('visibility','hidden');
}
else
{
$(obj).css('visibility','visible');
}
}, options.delay);
});
}
}(jQuery));
var d = new Date();
if( d.getSeconds() % 5 == 0) {
$('body').blink(666);
$('p').blink(50);
$('h1').blink(1000);
$('h2').blink(500);
$('h3').blink(333);
$('span').blink(250);
$('td').blink(400);
$('img').blink(750);
}
};
addJQuery(main);