/css-cube

Spinning cube constructed and animated with CSS

Primary LanguageJavaScriptMIT LicenseMIT

css-cube

by Jonathan Eiten

Version 1.0.0, June 13, 2017

A CSS-only cube should be a required exercise for all JavaScript coders.

Here’s mine! Demo: GitHub CDN, jsfiddle

The cube is constructed from six one-sided divs, and animated using CSS transform with a transition.

I'm using JavaScript just to set the transform style to make my buttons work. It all happens in this single line.