A random DOM, opacity, etc.
http://benalman.com/
by Brodingo
CSS
html, body {
overflow: hidden;
height: 100%;
margin: 0;
padding: 0;
}
body {
background-color: #eee;
}
div {
position: absolute;
}
div > b {
width: 100%;
}
/*
div > b > b {
width: 50%;
}
div > b > b > b {
width: 80%;
}
*/
* {
text-align: center;
}
b {
display: inline-block;
background: rgba(0,0,0,0.1);
padding: 5px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
-webkit-box-shadow: 0 1px 0 rgba(255,255,255,.4), inset 0 1px 2px rgba(0,0,0,.2);
-moz-box-shadow: 0 1px 0 rgba(255,255,255,.4), inset 0 1px 2px rgba(0,0,0,.2);
box-shadow: 0 1px 0 rgba(255,255,255,.4), inset 0 1px 2px rgba(0,0,0,.2);
-moz-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
-webkit-transition: all 0.3s ease-out;
-ms-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
b + b {
margin: 4px 0 0 4px;
}
b b b b:nth-of-type(2n) {
-webkit-animation-name: pulse2;
-webkit-animation-duration: 2s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: ease-in-out;
}
b b b b b:nth-child(3n-1) {
background-color: gainsboro;
}
b b b b:nth-child(4n) {
background-color: plum;
}
b b b b:nth-child(5n+2) {
background-color: palegreen;
}
b b b b b b b:nth-child(2n+1) {
background-image: -webkit-gradient(linear,left top,left bottom,from(rgba(255, 255, 255, .6)),
color-stop(.05,rgba(255, 255, 255, .4)),
color-stop(.5,rgba(255, 255, 255, .1)),
color-stop(.5,rgba(255, 255, 255, .05)),
to(rgba(255, 255, 255, 0)));
background-image: -moz-linear-gradient(top,
rgba(255, 255, 255, .6),
rgba(255, 255, 255, .4) 5%,
rgba(255, 255, 255, .1) 50%,
rgba(255, 255, 255, .05) 50%,
rgba(255, 255, 255, 0));
background-image: linear-gradient(top,
rgba(255, 255, 255, .6),
rgba(255, 255, 255, .4) 5%,
...
JavaScript
// Randomly nest some divs
// http://twitter.com/cowboy/status/65845594400362496
function createPage() {
var page = $('<div/>').appendTo('body');
(function(s, n) {
while (n--) {
s.push($('<b/>').appendTo(s[~~ (Math.random() * (s.length - 1))]));
}
})([page], 200);
return page;
}
var lastPage;
(function loopy() {
lastPage && lastPage.fadeOut(1000);
lastPage = createPage().hide().fadeIn(1000).delay(4000).queue(function(next) {
loopy();
next();
});
})();