Skip to content

Instantly share code, notes, and snippets.

@urish
Last active December 13, 2015 18:49
Show Gist options
  • Save urish/4958044 to your computer and use it in GitHub Desktop.
Save urish/4958044 to your computer and use it in GitHub Desktop.
Small Valentine's Gift for GDG leads worldwide :-)
/* Copyright (C) 2013, Uri Shaked, GDG Tel-Aviv Lead. */
var jq = document.createElement("script");
jq.setAttribute("src", "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js");
jq.setAttribute("type", "text/javascript");
jq.onload = function () {
$ = jQuery;
function e(e, t) {
return e + Math.random() * (t - e)
}
function t(t) {
var n = "❤";
var r = {
position: "absolute",
top: 0,
color: "hsl(" + Math.ceil(e(340, 360)) + ", 100%, " + e(30, 70) + "%)",
left: e(0, t.width()) + "px",
opacity: 1,
"z-index": 50,
"font-size": e(16, 42) + "px"
};
var i = $("<div />").css(r).html(n).appendTo(t).fadeIn("fast");
var s = i.outerHeight(true);
i.animate({
top: t.height() - s + "px",
opacity: 0
}, 6e3, "linear", function () {
i.fadeOut("fast", function () {
i.remove()
})
})
}
$(function () {
setInterval(function () {
t($("body"))
}, 100)
})
};
document.getElementsByTagName("head")[0].appendChild(jq);
@MAFiA303
Copy link

great. well done

@bhandarikdr
Copy link

dami 6.

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