Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div id="contenedor">
  <ul class="cube">
    <li class="cara">

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
   width="50px" height="50px" viewBox="0 0 50 50" xml:space="preserve">
<g>
  <polygon fill="#FFFFFF" points="12.199,22.777 12.199,27.223 15.523,25 	"/>
	<polygon fill="#FFFFFF" points="23.672,19.549 23.672,13.353 13.263,20.292 17.913,23.402 	"/>
	<polygon fill="#FFFFFF" points="36.737,20.292 26.329,13.353 26.329,19.549 32.088,23.402 	"/>
	<polygon fill="#FFFFFF" points="13.263,29.708 23.672,36.646 23.672,30.45 17.913,26.599 	"/>
	<polygon fill="#FFFFFF" points="26.329,30.45 26.329,36.646 36.737,29.708 32.088,26.599 	"/>
	<polygon fill="#FFFFFF" points="25,21.857 20.302,25 25,28.143 29.699,25 	"/>
	<g>
		<path fill="#FFFFFF" d="M25,0C11.193,0,0,11.192,0,25s11.193,25,25,25c13.808,0,25-11.192,25-25S38.808,0,25,0 M40.458,29.71
			c0,0.059-0.004,0.116-0.012,0.174c-0.003,0.019-0.008,0.038-0.011,0.057c-0.007,0.038-0.014,0.075-0.023,0.111
			c-0.006,0.022-0.014,0.043-0.021,0.064c-0.011,0.032-0.021,0.065-0.034,0.098c-0.009,0.022-0.02,0.043-0.029,0.064
			c-0.015,0.03-0.029,0.06-0.046,0.089c-0.012,0.02-0.024,0.04-0.037,0.061c-0.019,0.027-0.036,0.055-0.057,0.081
			c-0.015,0.02-0.029,0.038-0.046,0.058c-0.021,0.024-0.043,0.049-0.065,0.071c-0.018,0.018-0.035,0.035-0.053,0.052
			c-0.024,0.022-0.05,0.043-0.076,0.063c-0.02,0.016-0.039,0.031-0.06,0.046c-0.008,0.005-0.015,0.011-0.022,0.016l-14.129,9.42
			c-0.224,0.149-0.479,0.224-0.737,0.224c-0.257,0-0.514-0.074-0.736-0.224l-14.13-9.42c-0.007-0.005-0.014-0.011-0.021-0.016
			c-0.021-0.015-0.041-0.03-0.06-0.046c-0.026-0.021-0.051-0.041-0.075-0.063c-0.019-0.017-0.036-0.034-0.053-0.052
			c-0.023-0.022-0.045-0.047-0.066-0.071c-0.016-0.02-0.031-0.038-0.045-0.058c-0.02-0.026-0.039-0.054-0.056-0.081
			c-0.013-0.021-0.026-0.041-0.038-0.061c-0.016-0.029-0.031-0.059-0.045-0.089c-0.01-0.021-0.021-0.042-0.03-0.064
			c-0.013-0.032-0.024-0.065-0.034-0.098c-0.007-0.021-0.015-0.042-0.021-0.064c-0.01-0.036-0.016-0.073-0.023-0.111
			c-0.003-0.019-0.008-0.038-0.01-0.057c-0.008-0.058-0.012-0.115-0.012-0.174v-9.42c0-0.059,0.004-0.116,0.012-0.173
			c0.002-0.019,0.007-0.038,0.01-0.058c0.007-0.037,0.014-0.075,0.023-0.111c0.006-0.022,0.013-0.043,0.021-0.064
			c0.01-0.032,0.021-0.065,0.034-0.097c0.009-0.022,0.02-0.044,0.03-0.065c0.014-0.03,0.029-0.06,0.045-0.088
			c0.012-0.021,0.025-0.042,0.038-0.062c0.018-0.028,0.037-0.055,0.056-0.081c0.015-0.02,0.03-0.039,0.045-0.058
			c0.021-0.024,0.043-0.049,0.066-0.072c0.018-0.018,0.035-0.036,0.053-0.052c0.024-0.022,0.049-0.043,0.075-0.063
			c0.02-0.015,0.04-0.031,0.06-0.045c0.007-0.005,0.014-0.011,0.021-0.016l14.13-9.419c0.446-0.298,1.027-0.298,1.474,0
			l14.129,9.419c0.008,0.005,0.015,0.011,0.022,0.016c0.021,0.015,0.04,0.03,0.06,0.045c0.026,0.021,0.052,0.042,0.076,0.063
			c0.018,0.017,0.035,0.034,0.053,0.052c0.022,0.023,0.045,0.047,0.065,0.072c0.017,0.019,0.031,0.038,0.046,0.058
			c0.021,0.026,0.038,0.053,0.057,0.081c0.013,0.02,0.025,0.041,0.037,0.062c0.017,0.028,0.031,0.058,0.046,0.088
			c0.01,0.021,0.021,0.043,0.029,0.065c0.013,0.032,0.023,0.064,0.034,0.097c0.007,0.021,0.015,0.042,0.021,0.064
			c0.01,0.037,0.017,0.074,0.023,0.111c0.003,0.02,0.008,0.039,0.011,0.058c0.008,0.057,0.012,0.115,0.012,0.173V29.71z"/>
		<polygon fill="#FFFFFF" points="37.801,27.223 37.801,22.777 34.478,25"/>
	</g>
</g>
</svg>
    </li>
    <li class="cara"></li>
    <li class="cara"></li>
    <li class="cara"></li>
    <li class="cara"></li>
    <li class="cara"></li>
  </ul>
</div>
              
            
!

CSS

              
                *{box-sizing:border-box;}

html, body{height:100%;}

body{
  color:rgba(255,255,255,1);
  font: 75% normal "Verdana", sans-serif;
}

#contenedor{
  position:absolute;
	top:50%;
	left:50%;
	margin-top:-100px;
	margin-left:-100px;
	width:200px;
	height:200px;
	perspective:500;
}

ul{
	cursor:all-scroll;
	display:block;
	width:100%;
	height:100%;
	transform-style:preserve-3d;
	margin:0;
	padding:0;
}

li{
	background:rgba(255,255,255,.5);
	border:1px solid #555;
	display:block;
	list-style-type:none;
	position:absolute;
	width:100%;
	height:100%;
	font-size:1.5em;
	text-align:center;
	line-height:230px;
}

.cara:nth-child(1){
	background:rgba(0,0,0,.8);
	transform:rotate(0deg) translateZ(100px);
}

.cara:nth-child(2){
	transform:rotateX(-90deg) translateZ(100px);
}

.cara:nth-child(3){
	transform:rotateX(90deg) translateZ(100px);
}

.cara:nth-child(4){
	transform:rotateY(-90deg) translateZ(100px);
}

.cara:nth-child(5){
	transform:rotateY(90deg) translateZ(100px);
}

.cara:nth-child(6){
	transform:rotateY(180deg) translateZ(100px);
}

/************************************************************ animación */

.animar{
	transition:all 1s ease-in-out;
}

.noanimar{
	transition:none;
}
              
            
!

JS

              
                $(function(){

  var cube = $('.cube'),
			offset = $('#contenedor').offset(),
			offsetleft = (offset.left + 100),
			offsettop = (offset.top + 100);

	cube.on({
		mousemove: function(e) {
			$(this).css('transform','rotateX(' + (e.pageY - offsettop) + 'deg) rotateY(' + (e.pageX - offsetleft) + 'deg)');
			$(this).addClass('noanimar').removeClass('animar');
		},
		mouseout: function() {
			$(this).css('transform','rotateX(0deg) rotateY(0deg)');
			$(this).addClass('animar').removeClass('noanimar');
		}
	});

	//console.log('x=' + offsetleft + ', y=' + offsettop);

});
              
            
!
999px

Console