CSS 3D Geometry and Lighting - Spikes
lab.aerotwist.com
lab.aerotwist.com
// add on our post drag velocity
baseVec.x -= shapeVelY;
baseVec.y += shapeVelX;
// dampen it
shapeVelX *= DAMPEN;
shapeVelY *= DAMPEN;
// now rotate our shape
$shape.css({
WebkitTransform: "translateY(-55px) scale(0.7) rotateX("+(baseVec.x)+"deg) rotateY("+(baseVec.y)+"deg)"
});
// work out the shadow darkness
var shadowDarkness = .05 + Math.abs(Math.cos(baseVec.x * RADS) * .3);
for(var s = 0; s < $shadowCont.length; s++) {
var thisShadow = $($shadowCont[s]),
shadScale = thisShadow.data('scale') || 1;
thisShadow.css({
WebkitTransform: "translateZ(-150px) translateY(75px) rotateX(90deg) scale("+((.9-(shadowDarkness *.7)) * shadScale)+")",
background: "-webkit-gradient(radial, 50% 50%, 0, 50% 50%, 200, from(rgba(30,4,22,"+shadowDarkness+")), to(rgba(60,9,44,0)))"
});
}
...
source here: http://lab.aerotwist.com/css/spikes/js/CSS3Spikes.js (I cleaned this bit up a tiny bit for HN-friendly display)Impressive, but a bit (perhaps unintentionally) misleading.
I take your point, but however you choose to apply the CSS it's still CSS :)