3D (animated) cube using only CSS (LESS).
See this demo page. There's also a live production site (WIP) using these cubes.
$ bower install cube.less
Main mixin, it has the following options:
Default: 100px
The length of a cube side.
Default: 50px
Cube depth alone the Z-axis.
Default: 0deg
Rotate the cube along the X-axis.
Default: 0deg
Rotate the cube along the Y-axis.
Default: 0deg
Rotate the cube along the Z-axis.
Default: 2500
Make canvas perspective to parent element.
No cube background, like ouline vision. apply it to cube container.
No outline, apply it to cube container.
Make all cubes unselectable, apply it to cube parent wrapper, or specific cube. Both are ok.
The following is a basic markup:
...
<div class="cube-perspective">
<span class="cube cube-01"><i></i><i></i><i></i><i></i><i></i><i></i></span>
<span class="cube cube-02 cube-border"><i></i><i></i><i></i><i></i><i></i><i></i></span>
<span class="cube cube-03 cube-borderless"><i></i><i></i><i></i><i></i><i></i><i></i></span>
<span class="cube cube-04"><i></i><i></i><i></i><i></i><i></i><i></i></span>
</div>
...
See demo.
npm install && grunt server
Tunghsiao Liu
MIT