Skip to content

Instantly share code, notes, and snippets.

@cavill cavill/thesmithify
Created May 4, 2012

Embed
What would you like to do?
@themithify an page
(function() {
var RIK_URL = 'https://twimg0-a.akamaihd.net/profile_images/24543892/me.jpg';
var rik = new Image();
rik.src = RIK_URL;
rik.style.position = 'fixed';
rik.style.top = window.innerHeight + 'px';
rik.style.webkitTransform = 'translate(0, 0px)';
rik.style.zIndex = 5000;
document.body.appendChild(rik);
var appear = function() {
rik.style.left = Math.round(Math.random() * (window.innerWidth - 200)) + 'px';
rik.style.webkitTransition = '-webkit-transform 0.333s';
rik.style.webkitTransform = 'translate(0, -140px)';
setTimeout(disappear, 1000);
}
var disappear = function() {
rik.style.webkitTransition = '-webkit-transform 0.333s';
rik.style.webkitTransform = 'translate(0, 0px)';
setTimeout(appear, 2000);
}
setTimeout(appear, 1000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.